1 Reply Latest reply on Sep 22, 2005 6:55 AM by Susant Patnaik

    processdefinition

    Susanta Newbie

      Hi All,
      if any body will give some input on the following doubts will be highly appriciated .


      I have created one processdefinition but i might left something any body can review it because it is deploying properly but while process was not starting and following error coming.:-
      *************************************************************

      java.lang.NullPointerException
       at org.jbpm.taskmgmt.exe.TaskMgmtInstance.instantiateNewTaskInstance(TaskMgmtInstance.java:177)Exception is java.lang.NullPointerException
      *************************************************************

      and processdefinition.xml is as follows:
      $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition name="Testing a process">
      
       <!-- SWIMLANES -->
      
       <swimlane name='B1'>
       <delegation class="com.test.hndlrs.assignment.B1AssignmentHandler">B1</delegation>
       </swimlane>
      
       <swimlane name='B2'>
       <delegation class="com.test.hndlrs.assignment.B2AssignmentHandler">B2</delegation>
       </swimlane>
       <swimlane name='B3'>
       <delegation class="com.test.hndlrs.assignment.B3AssignmentHandler">B3</delegation>
       </swimlane>
       <swimlane name='B4'>
       <delegation class="com.test.hndlrs.assignment.B4AssignmentHandler">B4</delegation>
       </swimlane>
       <swimlane name='B5'>
       <delegation class="com.test.hndlrs.assignment.B5AssignmentHandler">B5</delegation>
       </swimlane>
      
       <swimlane name='B6'>
       <delegation class="com.test.hndlrs.assignment.BRAssignmentHandler">B6</delegation>
       </swimlane>
      
      
       <!-- START-STATE -->
       <start-state name="Initiate Budget">
       <task swimlane="B1" />
       <transition to="Create a Plan"/>
       </start-state>
      
       <!-- NODES -->
       <task-node name="Create a Plan">
       <task name="Create a Plan" swimlane="B2"/>
       <transition name="bcat" to="Decision1"/>
       </task-node>
      
       <!-- DECISION -->
       <decision name="Decision1" >
       <handler class="com.test.hndlrs.decision.ApprovalBgt_cat_DecisionHandler" />
       <transition name="Hardware" to="ApprovalofB1" />
       <transition name="software" to="ApprovalofB2" />
       </decision>
      
      
       <task-node name="ApprovalofB1">
       <task name="ApprovalofB1" swimlane="B3"/>
       <transition name="abc1" to="DecisionApproval1"/>
       </task-node>
      
       <!-- DECISION -->
       <decision name="DecisionApproval1" >
       <handler class="com.test.hndlrs.decision.ApprovalBgtDecisionHandler" />
       <transition name="approve" to="Final Approve and Release Bgt Plan" />
       <transition name="disapprove" to="Revise Budget Plan" />
       </decision>
      
      
       <task-node name="ApprovalofB2">
       <task name="ApprovalofB2" swimlane="B4"/>
       <transition name="a1" to="DecisionApproval2"/>
       </task-node>
      
       <!-- DECISION -->
       <decision name="DecisionApproval2" >
       <handler class="com.test.hndlrs.decision.ApprovalBgtDecisionHandler" />
       <transition name="approve" to="Final Approve and Release Bgt Plan" />
       <transition name="disapprove" to="Revise Budget Plan" />
       </decision>
      
       <!-- NODES -->
       <task-node name="Final Approve and Release Bgt Plan">
       <task name="Final Approve and Release Bgt Plan" swimlane='B5' />
       <transition name="a3" to="done" />
       </task-node>
      <!-- NODES -->
       <task-node name="Revise Budget Plan">
       <task name="Revise Budget Plan" swimlane='B6' />
       <transition name="a4" to="Final Approve and Release Bgt Plan" />
       </task-node>
      
       <!-- END-STATE -->
       <end-state name="done" />
      
      </process-definition>

      $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
      Please give some input if any change required:
      Code snippet i am trying to put is as follows:
      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
      public void startProcess() {
       try {
       jbpmSession = jbpmSessionFactory.openJbpmSession();
       long processDefinitionId = ((ProcessDefinition)jbpmSession.getGraphSession().findLatestProcessDefinitions().get(0)).getId();
       jbpmSession.beginTransaction();
       ProcessDefinition processDefinition = jbpmSession.getGraphSession().loadProcessDefinition(processDefinitionId);
       ProcessInstance processInstance = new ProcessInstance(processDefinition);
       processInstance.getTaskMgmtInstance().createTaskInstance().setActorId("BI");
       processInstance.signal();
       jbpmSession.getGraphSession().saveProcessInstance(processInstance);
       jbpmSession.commitTransaction();
       LoggingInstance loggingInstance = processInstance.getLoggingInstance();
       List assignmentLogs = loggingInstance.getLogs(TaskAssignLog.class);
       System.out.println("assignmentlogs: "+assignmentLogs);
       if (assignmentLogs.size()==1) {
       TaskAssignLog taskAssignLog = (TaskAssignLog) assignmentLogs.get(0);
       System.out.println("A new task has been assigned to '"+taskAssignLog.getTaskNewActorId()+"'");
       }
       jbpmSession.close();
       } catch (Exception e) {
       System.out.println("Exception is "+e);
       e.printStackTrace();
       }
       }

      @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

      Thanks & Regards,
      Susant Patnaik