Apr 04

After deploying a new process I sure that you would like to run it ;)

It’s easy. First of all, you must create a new process instance:

        jbpmContext = jbpmConfiguration.createJbpmContext();
        processInstance = jbpmContext.newProcessInstance("processname");

Then you can initialize it by adding some variables to the process:

        contextInstance = processInstance.getContextInstance();
	contextInstance.setVariable("var", myVar);

To start it you have to send a signal to the process first token :

	processInstance.getRootToken().signal();

		

Related Posts

Mar 17

Deploy a process via java program not using Eclipse interface is very easy. You only need to write this lines.

JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();

ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/xxx/definitions/yyy/processdefinition.xml");

jbpmContext.deployProcessDefinition(processDefinition);

jbpmContext.close();

It is very useful when you have to write a setup program for your application.

Related Posts