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

joy_wind do-not-reply at jboss.com
Thu May 15 20:56:14 EDT 2008


coolex, 

I run my test code as a standalone application(e.g, in a main method), not in a web container. 

My test app is like the following:
import org.apache.log4j.Logger;
  | import org.jbpm.JbpmConfiguration;
  | import org.jbpm.JbpmContext;
  | import org.jbpm.db.GraphSession;
  | import org.jbpm.graph.def.ProcessDefinition;
  | import org.jbpm.graph.exe.ProcessInstance;
  | 
  | public class Test {
  | 	private static Logger logger = Logger.getLogger(Test.class);
  | 
  | 	public static void main(String[] args) throws Exception {
  | 		JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
  | 		JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 		try {
  | 
  | 			GraphSession graphSession = jbpmContext.getGraphSession();
  | 			logger.info("loading definition ...");
  | 			ProcessDefinition processDefinition = graphSession
  | 					.findLatestProcessDefinition("test-process");
  | 			logger.info("create new process instance ...");
  | 			ProcessInstance processInstance = new ProcessInstance(
  | 					processDefinition);
  | 		} finally {
  | 			logger.info("closing context !");
  | 			jbpmContext.close();
  | 		}
  | 	}
  | }
As the code shows,I just create a new processInstance and do nothing else.But after jbpmContext.close(),jbpm create a new instance in my database even if i dont invoke the save method.
By check log output i found jbpm run serveral INSERT sql statements on my database when jbpmContext.close().

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

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



More information about the jboss-user mailing list