Skip to Content
Author's profile photo Former Member

Assigning potential users for Task/Lane using expressions in Netweaver BPM

For quite sometime, I have been running busy with the implementation of Vendor Master Data Governance solution using Netweaver BPM due to which I wasn’t able to post new blogs. In this blog I will be focusing on a simple scenario for assigning potential owner for a task using expressions for use in real BPM scenarios. This blog is targeted for people who have just started/or want to start learning Netweaver BPM.


How it will work?

We will create an attribute of type string in our Web Dynpro Component and map it with the Process Context. This attribute will store the Unique ID of the Portal User which we will use in our expression to assign potential user for a Task/Lane. We can have the decision logic for selecting the potential owner in our web Dynpro component and this can also be fetched from any backend storage such as database table based on some dynamic conditions (i.e. Selection of a particular type of Product; we can maintain approvers for different products in a database table). I am not providing the logic for fetching the appropriate user here, but we will take a sample user approver1 for this example.


Use the below code to fetch the Unique ID of a Portal User:


public String getUniqueIdFromUserId(String strUserId) throws UMException, NullPointerException




            if (strUserId == null)

                  throw new NullPointerException(“getUniqueIdFromUserId() called with a null User Id.”);


            IUserFactory userFactory = UMFactory.getUserFactory();

            IUser user = userFactory.getUserByUniqueName(strUserId);


            if (user == null)

                  throw new NullPointerException(“User not found in UME.”);


            return user.getUniqueID();



      catch (UMException e)



            throw e;




After getting the unique ID for the potential user, set it in the context attribute that we have created and it will be used further in our expression for potential user assignment.


Follow the below steps to assign the potential users:


1. Open the properties tab after selecting the Lane and select the Potential Users Tab and click on the Edit Button beside the expression field to open Expression Editor

2. Select the function getPrincipal(String strUniqueId) from the inbuilt functions list and pass the Context attribute where we are storing the unique Id of the portal user

3. Save the process and deploy

Note: Make sure that proper Unique ID of the user is stored in the context, otherwise tasks would not be generated without the potential approvers.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Hello Arafat:
      A very good posting!
      What would be the usage of the next method
      getPrinicipalByUniqueName(String UniqueName) ?

      Did you happen to use that method too ?


      -Prasad Nutalapati

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Dear Prasad,

      Thanks for taking out time to read my blog. Inbuilt function getPrincipalByUniqueName(String uniqueName, String identityType) can be used to retrive a potential owner by specifying the Unique NAME and the type of identity eg 'user', 'role' or 'group'. But in our case we had got multiple userid's of the potential owners and fetched the Unique ID's. It is simpler and easier to use getPrincipal(strUniqueId) than the other one. 🙂

      Arafat Farooqui

      Author's profile photo Former Member
      Former Member
      Thanks Arafat for the info 🙂

      Coming back to the original idea of using uniqueID as part of assigning actors to the tasks
      shouldn't the actual values during the process be
      highlighted ?
      Like what is the first value when we called
      getUniqueIdFromUserId() method, then what would
      happen to that value when we processed it with
      getPrincipal() and why do we need unique id values
      anyways etc.

      I know, these would be clear once anyone sit through
      the execution of a test application and the blog
      gives the overall idea of using the expressions
      concept. But with these clarifications, the blog
      would be 'excellent'.

      But overall the blog is awesome,


      Author's profile photo Former Member
      Former Member

      This post has been very informative.

      I have a requirement where I must assign users based on conditions which I store in a decision table.

      Can you please give an overview/link to another blog on how this can be done?

      Author's profile photo Adnan Maqbool
      Adnan Maqbool


      I want to use relationships maintained in HCM Organization Structure to locate the supervisor of an employee as a potential owner. Any guide ?

      Author's profile photo Adnan Maqbool
      Adnan Maqbool


      Is there any way to pass current logged in user id of current task/step to a process context.

      Author's profile photo Rajesh PS
      Rajesh PS



      I'm using the same but errored with excepted xsd:string, found list of xsd:string'.


      Please suggest. Thanks!