Skip to Content

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.

To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. 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

    1. Former Member 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

      1. 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,


  2. 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?


Leave a Reply