5 Replies Latest reply on Apr 16, 2015 5:14 AM by awizenm

    How to assign the Actor based on some condition in BPMN file

    rahul7163

      Hi,

       

      I am using the jBPM 6.1.0 and BPMN modeler plugin to create the bpmn diagram. I have one Human Task inside the flow. I need to set the Actor for this task dynamically when this task generated based on some if condition. Where i can write the condition so that the based on output i can update the actor id. Can someone tell me how we can achieve it?

        • 1. Re: How to assign the Actor based on some condition in BPMN file
          gianmere

          You can use a variable as actor for a human task, like #{myactor}.

           

          This variable takes the value of a process variable , which has its value assigned when the process starts or by a service task.

           

          Bye

          • 2. Re: How to assign the Actor based on some condition in BPMN file
            rahul7163

            I tried assigning the #{myActor} variable to Actors tab for the User/Human Task in the new BPMN2 plugin. The of value of myActor key and value is present in the process variable map already. To verify the variable contain the value, i tried to print it on "On Entry Script". It is printing the value of the variable correctly in console. However, it is not assigning/updating the "Potential Owner" Column value in TASK table. Not sure how to achieve this behavior. Can someone implemented this kind of behavior using jBPM 6.1.0 and BPMN2 0.2.7. Please reply if you have any solution.

            • 3. Re: How to assign the Actor based on some condition in BPMN file
              awizenm

              Does the user (Actor) you want to assign exist in the OrganizationalEntity table already? Or in other words, is this user configured and exists on the start-up of your application?

              • 4. Re: How to assign the Actor based on some condition in BPMN file
                rahul7163

                Hi Michael,

                 

                Yes. The user (Actor) you want to assign exist in the OrganizationalEntity table. Not sure its a bug in BPMN2 0.2.7 eclipse plugin. In jBPM 5.4 jbpm eclipse bpmn plugin i was able to assign the Actor to the human task when the task is added.

                • 5. Re: How to assign the Actor based on some condition in BPMN file
                  awizenm

                  Hi Amit,

                   

                  I still think that your issue maybe a question of a proper user management. I had a similar problem in a JUnit test. The example tests do work because there is a default user set configured in the test package (see usergroups.properties in jbpm-test-6.2.0.Final.jar). As I started to use my own user I had to change the way the UserGroupCallback works (in JbpmJUnitBaseTestCase initialized by JBossUserGroupCallbackImpl).