2 Replies Latest reply on May 9, 2011 2:00 AM by janani anbarasan

    SEAM-jBPM : Assigning actor-id dynamically at each task node.

    Ambrish Singh Newbie
      Hi All,

      How can I assign actor-id dynamically (from drop-down of username) before processing any task node defined in process definition.

      For example,

      If first task node is applicable for actor-id "a1", then i want that second or third task nodes are applicable for the actor-id that is selected from some drop down. Consider the code given below, after approving the Inventory order, it is assigned to actor, which is selected from drop-down.

      What should be the expression for actor-id in
      <assignment pooled-actors="#{taskApplicableFor.assignActors}" actor-id="#{actor.id}"/>.

      where #{actor.id} represents the current user logged in.

      CODE:

      <process-definition
           name="InventoryManagement"
           xmlns="urn:jbpm.org:jpdl-3.2"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd"
           >

          <start-state name="start">
              <transition to="approval"/>
          </start-state>

           <task-node name="approval">
              <task name="approval" description="Review Inventory">
                  <assignment pooled-actors="#{taskApplicableFor.creatorActors}" actor-id="#{actor.id}"/>
              </task>
              <transition name="approve" to="assign"/>
              <transition name="reject"  to="cancelled"/>
          </task-node>
         
          <task-node name="assign">
              <task name="assign" description="Assign">
                  <assignment pooled-actors="#{taskApplicableFor.assignActors}" actor-id="#{actor.id}"/>
              </task>
          <transition name="closed"  to="complete"/>
          </task-node>
              
          <end-state name="complete"/>
          <end-state name="cancelled"/>
         
      </process-definition>