1 Reply Latest reply on Sep 23, 2013 1:16 AM by Maciej Swiderski

    How to return the result of individual work item handlers after their completion

    Agent Malik Newbie

      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);




                  System.out.println(">>> Let's Start the Process");


                  ksession.startProcess("com.cl.cloud.createcompute", params);


                  System.out.println(">>> Disposing Session");