[jboss-user] [JBoss jBPM] - Re: Problem execute actions on jboss

asmo do-not-reply at jboss.com
Wed Oct 11 08:38:17 EDT 2006


In the meantime,  i could isolate the problem a little bit. 
If i create a processinstance direct on the parsed processdefinition, jbpm executes the action.


step 1:
try{
  | 
  |      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml");
  |             
  |            
  |      JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  |      GraphSession graphSession = jbpmContext.getGraphSession();
  | 
  |      ProcessDefinition processDefinition =ProcessDefinition.parseXmlResource("activityWorkflow.par/processdefinition.xml");
  | 
  |      ProcessInstance  processInstance = processDefinition.createProcessInstance();
  | 
  |      processInstance.signal("startWorkflow");
  |      processInstance.signal("created");
  | 
  |      jbpmContext.save(processInstance);
  |             
  |      }catch(Exception e){
  |        e.printStackTrace();
  |       }finally{
  |        jbpmContext.close();
  |         }
  |     }


If i first save the processInstance and later load it back from the database, the action won't execute.



JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml");
  |             
  | JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 
  |      try{
  |      GraphSession graphSession = jbpmContext.getGraphSession();
  | 
  |       ProcessDefinition processDefinition =ProcessDefinition.parseXmlResource("activityWorkflow.par/processdefinition.xml");
  | 
  |        ProcessInstance  processInstance = processDefinition.
  |        Long id = Long.valueOf(processInstance.getId());
  | 
  |        jbpmContext.deployProcessDefinition(processDefinition);
  |        jbpmContext.save(processInstance);
  |        }catch(Exception e){
  |         e.printStackTrace;
  |        }finally{
  |          jbpmContext.close();
  |        }
  | return id;

step 2:

JbpmConfiguration jbmpConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml");
  | JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | try{
  |       GraphSession graphSession = jbpmContext.getGraphSession();
  |     
  |       ProcessInstance processInstance = graphSession.loadProcessInstance(processId.longValue());
  |       
  |       processInstance.signal();
  |       jbpmContext.save(processInstance);
  |       }catch(Exception e){
  |       e.printStackTrace;
  |       }finally{
  |       jbpmContext.close();
  | }

Is there something wrong in the way i save and load the processInstance? 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977515#3977515

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977515



More information about the jboss-user mailing list