hello all, please help me i am new to jbpm, everything is working fine for me but i want to return my "result" output parameter upon completion of my individual work item handlers, this is my code.
public void CreateCompute(String body) throws Exception
{
KnowledgeBase kbase = readKnowledgeBaseForCompute();
AssignTEPIPOnHypervisor tepIP = new AssignTEPIPOnHypervisor();
CreateIntegratedBridgeOnHost IB = new CreateIntegratedBridgeOnHost();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.getWorkItemManager().registerWorkItemHandler("AssignTEPIPToHypervisors", tepIP);
ksession.getWorkItemManager().registerWorkItemHandler("CreateIBOnHosts", IB);
System.out.println(" >>> Let's create a Persistent Knowledge Session");
Map<String,Object> params = new HashMap<String, Object>();
params.put("payload", body);
params.put("session_id",Integer.toString(ksession.getId()));
System.out.println(">>> Let's Start the Process");
ksession.startProcess("com.cl.cloud.createcompute", params);
System.out.println(">>> Disposing Session");
}
you need to use data output mapping to move results of work item into the process. See documentation and evaluation process for more details.
HTH