4 Replies Latest reply: Oct 16, 2012 1:21 PM by kiransaravi RSS

    How to configure a user to use getManager() to get his manager in HumanTask

    kiransaravi
      Hi

      I have a simple qn.
      We create users and groups in weblogic, and assign Task Participants using those users.

      I want to build a simple human task, that needs an approval from the manager.
      But i dont want to assign the user statically, but i want to use "user.getManager()" funciton to assign task participant at the 2nd level.
      For this, first the user has to be mapped to a manager. But how do we do this?

      In weblogic --> security realms, I see only users & groups, but nowhere i see a manager where i can assign directs to a manager or map a user to a manager.
      Can someone help me out in this.

      Regards
      RaviKiran
        • 1. Re: How to configure a user to use getManager() to get his manager in HumanTask
          Ravi Jegga
          Hi Ravi
          1. There is nothing like a manager configured separately in weblogic console. Its like this. Even Manager is also a User, just another user. The link is like this. Each User will have standard properties like firstName, lastName, Department, dateOfBirth, phoneNumber, Email etc etc. They also have a attribute like manager and the value of this is just reference to another user. I hope you got the point.

          2. So, in Weblogic console, say you create 2 users: weblogic1, weblogic2, weblogic3. And you can assign some basic properties for each one of them like firstName, lastName etc. For weblogic1, assign manager as weblogic2. For weblogic2 assign manager as weblogic3 etc.

          3. Now behind the screens in Workflow, SOA, when you run user.getManager() and if user is weblogic2, the value will come automatically as weblogic2. And it goes on. You do not have to do any programming for this. The workflow will use LDAP APIs to get the value for each standard property if they are named using standards like firstName=givenName, lastName=sn, emailId=mail etc etc. These are all standard AD object properties for Users, Groups. By the way, most of these applies to Groups also in addition to Users.

          Now, the real trick is, when you create users in weblogic, you can specify firstname, lastname, mail etc. But to specify manager, for now, use this workaround given in below post. Before you run any samples or explore SOA/BPM, first create some testuser accounts in default weblogic embedded ldap using demo community seed app (servlet). You can open this EAR, and then WAR and extract .xml file and edit to add any stuff you want.

          The below link should give you more idea:
          Re: Realm is not populated for BPM app (See my reply)
          Re: Seed Demo Community Failes

          Thanks
          Ravi Jegga
          • 2. Re: How to configure a user to use getManager() to get his manager in HumanTask
            kiransaravi
            Hi Ravi

            This is really good info. It helped me create user hierarchy.

            But one thing i could not understand is, why am i not able to find the manager attribute in the user attributes(Even for those users who have managers configured/mapped)?



            Just FYI, it would be useful for others who face the same issue,
            the ear has to be deployed in the managed server, but the details u give in the url
            http://localhost:8001/integration/SOADemoCommunity/DemoCommunitySeedServlet has to be the admin server ones
            (localhost, 7001, weblogic, welcome1)

            Regards
            RaviKiran.

            Edited by: kiransaravi on Oct 16, 2012 9:22 AM
            • 3. Re: How to configure a user to use getManager() to get his manager in HumanTask
              Ravi Jegga
              Hi Ravi
              1. The Weblogic Console just shows only few attributes of the user and unfortunately none of them includes "manager" attribute. But it does have this information in internal LDAP data.

              2. Very simple. Just deploy the SOA Demo Seed App into the Server that has SOA Modules deployed means SOA Server. Sometimes in a domain we will have admin server and soa server separately. So deploy this EAR to soa server and use that host and port. But there is something called Developers domain also, where you will have just ONE server Admin Server that has all the soa modules also deployed. In that case, deploy the EAR to that admin server itself. Use that host, port and rest of the url is same. Basically this EAR needs some soa modules reference internally.

              So do not confuse to where it should be deployed and what host or port to be used. Deploy to server that has soa modules deployed and use that host, port. Thats it.

              Thanks
              Ravi Jegga
              • 4. Re: How to configure a user to use getManager() to get his manager in HumanTask
                kiransaravi
                Hi Ravi

                Thanks very much. Resolved.
                Yes, I could now see the manager in the user properties in the Human Task --> Task Assignment --> select user.
                Today, I learnt something new :)

                Regards
                RaviKiran.