2 Replies Latest reply on Mar 20, 2006 7:41 PM by badegg

    when the AssignmentHandler be invoked

    badegg Newbie

      i modifed the websale process as follow ,and deploy successfully ,but when i start the process ,all the AssignmentHandlers seems haven't been invoked , the actorid in swimlaneInstance table and in taskinstance table are all "null".what's the problem?


      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition name="websale2006">
       <!-- SWIMLANES (= process roles) -->
       <swimlane name="buyer">
       <assignment class='cims.wfs.websale.actions.buyerAssignmentHandler'/>
       </swimlane>
       <swimlane name="salesman">
       <assignment class='cims.wfs.websale.actions.salesmanAssignmentHandler'/>
       </swimlane>
       <swimlane name="accountant">
       <assignment class='cims.wfs.websale.actions.accountantAssignmentHandler'/>
       </swimlane>
       <swimlane name="shipper">
       <assignment class='cims.wfs.websale.actions.shipperAssignmentHandler'/>
       </swimlane>
      
      <!-- NODES -->
      
       <start-state name="create new web sale order">
       <task swimlane="buyer">
       <controller>
       <variable name="item" />
       <variable name="quantity" />
       <variable name="address" />
       </controller>
       </task>
       <transition to="evaluate web order" />
       </start-state>
      
       <task-node name="evaluate web order">
       <task swimlane="salesman">
       <timer duedate="20 seconds" repeat="10 seconds">
       <action class="org.jbpm.websale.RemindActor">
       <swimlane>salesman</swimlane>
       </action>
       </timer>
       <controller>
       <variable name="item" access="read"/>
       <variable name="quantity" access="read"/>
       <variable name="address" access="read"/>
       <variable name="comment"/>
       </controller>
       </task>
       <transition name="ok" to="salefork" />
       <transition name="more info needed" to="fix web order data" />
       </task-node>
      
       <task-node name="fix web order data">
       <task swimlane="buyer">
       <controller>
       <variable name="comment" access="read"/>
       <variable name="item" />
       <variable name="quantity" />
       <variable name="address" />
       </controller>
       </task>
       <transition to="evaluate web order" />
       </task-node>
      
       <fork name="salefork">
       <transition name="payment" to="wait for money" />
       <transition name="shipping" to="ship item" />
       </fork>
      
       <task-node name="wait for money">
       <task swimlane="accountant">
       <controller>
       <variable name="item" access="read" />
       <variable name="quantity" access="read" />
       <variable name="address" access="read" />
       <variable name="money received" />
       </controller>
       </task>
       <transition to="update books" />
       </task-node>
      
       <node name="update books">
       <action class="org.jbpm.websale.UpdateBooks">
       <msg>accountancy application is now informed of the payment</msg>
       </action>
       <transition to="salejoin" />
       </node>
      
       <node name="ship item">
       <action class="org.jbpm.websale.ShipItem">
       <swimlane>shipper</swimlane>
       <msg>${shipper} now ships ${item} to ${address}</msg>
       </action>
       <transition to="salejoin" />
       </node>
      
       <join name="salejoin">
       <transition to="end" />
       </join>
      
       <end-state name="end" />
      
      </process-definition>
      
      


        • 1. Re: when the AssignmentHandler be invoked
          jbpmndc Newbie

          "swimlaneInstance table and in taskinstance table are all "null"

          I did the same thing and it worked for me. What do you get when you call taskInstance.getActorId?

          • 2. Re: when the AssignmentHandler be invoked
            badegg Newbie

            when i execute taskinstance.getactorID() I got "null"
            My startworkflow code as follow:

            public long startWorkFlow(long workflowID, String userName)
             {
             log.debug("startworkflow " + workflowID + " start");
             long instanceID = -1;
             ProcessDefinition processDefinition = null;
             JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
             jbpmSession.beginTransaction();
             processDefinition = jbpmSession.getGraphSession().loadProcessDefinition(workflowID);
            
            
             ProcessInstance instance = new ProcessInstance(processDefinition);
            
             instanceID = instance.getId();
            
             // create a new taskinstance for the start task
             TaskInstance taskInstance = instance.getTaskMgmtInstance().createStartTaskInstance();
             System.out.println("taskInstance.getactorid="+taskInstance.getActorId());//
            
             instance.getContextInstance().setVariable("userName", userName);
            
            
             jbpmSession.getGraphSession().saveProcessInstance(instance);
            
             jbpmSession.commitTransaction();
             jbpmSession.close();
             return instanceID;
             }