1 Reply Latest reply on Apr 4, 2014 2:50 AM by seeni

    populating JMS Queue using Human Task Handler

    seeni

      Hi Folks,

       

      I am looking to implement a Human Task Handler which populates JMS Queue. I tried to implement this using a similar approach as for a Service Task Handler. I have created a process with a human task and updated kmodule.xml with the below content. I have placed a jar with class com.sample.WIH under WEB-INF/lib/. This works in case of a Custom Service Task Handler (additionally created WorkItemDefinition and mapped that in kmodule.xml against the Work Item Handler), but the WIH class (executeWorkItem method) doesn't get called in case of Human Task. Please let me know how to go about in case of Human Task Handler. Please note that i am using jBoss BPMS console version 6.0.

       

       

      <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

         <kbase name="KBase-test" default="true" eventProcessingMode="stream" equalsBehavior="equality" scope="javax.enterprise.context.ApplicationScoped" packages="*">

           <ksession name="ksession-test" type="stateful" default="true" clockType="realtime" scope="javax.enterprise.context.ApplicationScoped">

             <workItemHandlers>

               <workItemHandler type="new com.sample.WIH()" name="Human Task

       

      "/>

             </workItemHandlers>

           </ksession>

         </kbase>

      </kmodule>

       

      Thanks,

      Seeni

        • 1. Re: populating JMS Queue using Human Task Handler
          seeni

          Hi All,

           

          There is some progress in invoking Human Task Handler. I mapped a Work Item Handler to Human Task with an entry (given below) in CustomWorkItemHandlers.conf

                                   "Human Task" : new com.sample.WIH1()

          Pasting below the WIH1 class. The constructor is getting executed as control comes to the Human Task. The executeWorkItem(..) method is not getting executed. I am not finding any relevant errors in the SystemOut.log. Also i am unable to perform the necessary operations in the constructor as i dont have access to WorkItem in the Constructor. Please let me know if any other configuration needs to be made.

           

          package com.sample;

            import org.jbpm.process.instance.impl.humantask.HumanTaskHandler;

            import org.kie.api.runtime.process.WorkItem;

            import org.kie.api.runtime.process.WorkItemHandler;

            import org.kie.api.runtime.process.WorkItemManager;

           

            public class WIH1 extends HumanTaskHandler {

            public WIH1() {     

                 System.out.println("Constructor WIH1");

                        }

            public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {

                // extract parameters

                System.out.println("inside executeWI of WIH1");

                System.out.println("To be completed - WIH1");

                System.out.println("workItem.getId() =" + workItem.getId());

                //manager.completeWorkItem(workItem.getId(), null);

            }

           

          Thanks,
          Seeni