1 Reply Latest reply on Jul 8, 2015 2:45 AM by Abhijit Humbe

    How to use a RecieveTask in KIE Workbench business process

    Suchismita Subudhi Newbie

      Hello All,

      I want to start a business process only when I receive certain message ( say "Start Me").

      I mapped the variables as can be seen in the attached screenshot (Sample_ReceiveTask.PNG) and also added the following section to workdefinition

      [

          "name" : "sampleMsg",

          "parameters" : [

              "startMe" : new StringDataType()

          ],

          "displayName" : "sampleMsg",

          "icon" : "defaultlogicon.gif"

        ]

       

       

      However I get the following error while trying to execute it.

      Process Instances failed to start: [Model.testReceive:32 - Entry Point:2] -- Could not find work item handler for Receive Task

       

      Also, I'm unable to reopen the file after running the instance ( please see the attached After_Error_Screen.png)

       

      I can input the value of the message, but where should I compare it to validate the string message?

       

      Thanks,

      Suchi

        • 1. Re: How to use a RecieveTask in KIE Workbench business process
          Abhijit Humbe Master

          To execute "Receive Task" we have to register "ReceiveTaskHandler" in kmodule.xml like as:

           

          ===============

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

            <kbase name="kbase" default="true" eventProcessingMode="stream" equalsBehavior="identity">

            <ksession name="ksession" type="stateful" default="true" clockType="realtime">

            <workItemHandlers>

            <workItemHandler type="new org.jbpm.bpmn2.handler.ReceiveTaskHandler(ksession)" name="Receive Task"/>

            </workItemHandlers>

            </ksession>

            </kbase>

          </kmodule>

          ===============

           

          we can register workitemhandler through "business-central.war/WEB-INF/classes/META-INF/CustomWorkItemHandlers.conf" file as well, like as:

           

          [

            "Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(),

            "WebService": new org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler(ksession),

            "Rest": new org.jbpm.process.workitem.rest.RESTWorkItemHandler(),

          "Receive Task": new org.jbpm.bpmn2.handler.ReceiveTaskHandler(ksession)

          ]

           

          Hope it helps..