hi maciej,
Sorry for the late reply. Thanks a lot for your response.
I have used the state nodes like human task in the process.
The java code that i use to run the process is as below:
package com.sample;
import org.drools.KnowledgeBase;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.logger.KnowledgeRuntimeLoggerFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler;
import org.jbpm.test.JBPMHelper;
/**
* This is a sample file to launch a process.
*/
public class ProcessMain {
public static final void main(String[] args) throws Exception {
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
//StatefulKnowledgeSession ksession = JBPMHelper.newStatefulKnowledgeSession(kbase);
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new CommandBasedWSHumanTaskHandler(ksession));
KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);
// start a new process instance
ksession.startProcess("KrpiSample");
System.out.println("Process started ...");
}
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("Krpi_sample.bpmn"), ResourceType.BPMN2);
return kbuilder.newKnowledgeBase();
}
}