[jboss-user] [JBoss jBPM] - jbpmContext.close() save process instance automaticly

joy_wind do-not-reply at jboss.com
Tue May 13 05:43:46 EDT 2008


I noticed that in jbpm 3.2.2, a call on jbpmContext.close() will save process instance automaticly even I dont call jbpmContext.save(processInstance) explicitly. Why ?

How can I close the jbpmContext but not save the processInstance ?

The following is my test code.

                ... ...
  | 
  | 		JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
  | 		JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 		try {
  | 
  | 			GraphSession graphSession = jbpmContext.getGraphSession();
  | 			System.out.println("test: finding process def: " + processName);
  | 			ProcessDefinition processDefinition = graphSession
  | 					.findLatestProcessDefinition(processName);
  | 			System.out.println("test: found process def: " + processName
  | 					+ " . create a new instance ...");
  | 			ProcessInstance processInstance = new ProcessInstance(
  | 					processDefinition);
  | 			System.out.println("new instance created: " + processName
  | 					+ " . signal to run ...");
  | 			processInstance.signal();
  | 			System.out.println("done signal: " + processName
  | 					+ " . save process instance ....");
  | 			// Token token = processInstance.getRootToken();
  | 			// token.signal();
  | 			jbpmContext.save(processInstance);
  | 			System.out.println("save instance OK !");
  | 		} finally {
  | 			jbpmContext.close();
  | 		}
  | 
  |                 ... ...
  | 

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

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



More information about the jboss-user mailing list