[jboss-user] [JBoss jBPM] - Re: understand asynchronous continuations

gujing01@gmail.com do-not-reply at jboss.com
Mon Nov 13 03:05:04 EST 2006


now i am continue to my test.
i want to know how to activate a message executor?

  | <process-definition name="sub">
  | 	<start-state name="start">
  | 		<transition to='auto' />
  | 	</start-state>
  | 	<node name="auto"  async='true' >
  | 		<action class="example.processmodel.NodeExecuteHandler" />
  | 		<transition name="endtran" to='end' />
  | 	</node>
  | 	<end-state name="end" />
  | </process-definition>
  | 

  | 
  |  JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
  | 		 jbpmContext.deployProcessDefinition(processDefinition);
  | 		
  | 		 
  | 		   /////////////////////////////////
  | 		Token token= processInstance.getRootToken();
  | 		System.out.println(token.getNode().getName());//START
  | 		
  | 		token.signal();
  | 		System.out.println(token.getNode().getName());//AUTO
  | 		jbpmContext.save(processInstance);
  | 		jbpmContext.close();
  | 

  | public class NodeExecuteHandler implements ActionHandler {
  | 
  | 
  | 	public void execute(ExecutionContext executionContext) throws Exception {
  | 		// TODO Auto-generated method stub
  | 		System.out.println("NodeExecuteHandler");
  | 		executionContext.setVariable("bianliang","value1");
  | 		executionContext.leaveNode("endtran");
  | 		}
  | 
  | }
  | 
It seems the example.processmodel.NodeExecuteHandler has not been execute as i could not see the system out.And i looked up in the database table jbpm.jbpm_message and saw 
1, 'N', 'CMD_EXECUTOR', '', 0, 1, '', , 2, '', 
the config:

  | static JbpmConfiguration jbpmConfiguration = null; 
  | 
  | 	  static {
  | 	    // An example configuration file such as this can be found in 
  | 	    // 'src/config.files'.  Typically the configuration information is in the 
  | 	    // resource file 'jbpm.cfg.xml', but here we pass in the configuration 
  | 	    // information as an XML string.
  | 	    
  | 	    // First we create a JbpmConfiguration statically.  One JbpmConfiguration
  | 	    // can be used for all threads in the system, that is why we can safely 
  | 	    // make it static.
  | 
  | 	    jbpmConfiguration = JbpmConfiguration.parseXmlString(
  | 	      "<jbpm-configuration>" +
  | 	      
  | 	      // A jbpm-context mechanism separates the jbpm core 
  | 	      // engine from the services that jbpm uses from 
  | 	      // the environment.  
  | 	      
  | 	      "  <jbpm-context>" +
  | 	      "    <service name='persistence' " +
  | 	      "             factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" + 
  | 	      "		<service name='message' " +
  | 		  "             factory='org.jbpm.msg.db.DbMessageServiceFactory' />" + 
  | 	      "  </jbpm-context>" +
  | 	      
  | 	      // Also all the resource files that are used by jbpm are 
  | 	      // referenced from the jbpm.cfg.xml
  | 	      
  | 	      "  <string name='resource.hibernate.cfg.xml' " +
  | 	      "          value='hibernate.cfg.xml' />" +
  | 	      "  <string name='resource.business.calendar' " +
  | 	      "          value='org/jbpm/calendar/jbpm.business.calendar.properties' />" +
  | 	      "  <string name='resource.default.modules' " +
  | 	      "          value='org/jbpm/graph/def/jbpm.default.modules.properties' />" +
  | 	      "  <string name='resource.converter' " +
  | 	      "          value='org/jbpm/db/hibernate/jbpm.converter.properties' />" +
  | 	      "  <string name='resource.action.types' " +
  | 	      "          value='org/jbpm/graph/action/action.types.xml' />" +
  | 	      "  <string name='resource.node.types' " +
  | 	      "          value='org/jbpm/graph/node/node.types.xml' />" +
  | 	      "  <string name='resource.varmapping' " +
  | 	      "          value='org/jbpm/context/exe/jbpm.varmapping.xml' />" +
  | 	      "</jbpm-configuration>"
  | 	    );
  | 	  }
  | 

but how to config a command executor?both in pure java application and in 
application server. thanks for help~


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

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



More information about the jboss-user mailing list