JBoss Community

registerWorkItemHandler workItemName

created by Tobias Wittur in jBPM - View the full discussion

Hello,

 

I was wondering if the workItemName in - registerWorkItemHandler(String workItemName, WorkItemHandler handler) in public interface WorkItemManager can receive any workItemName.

 

E.g. I created a standard service task and tried to register my own handler:

 

ksession.getWorkItemManager().registerWorkItemHandler("Test", new MyOwnServiceHandler());

 

and I get:

Caused by: org.drools.WorkItemHandlerNotFoundException: Could not find work item handler for Service Task

 

If I write this, it works: ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new MyOwnServiceHandler());

 

Where exactly is the Service Node linked to Service Task? Shouldn't there be something in the XML?

 

  <itemDefinition id="_2_InMessageType" structureRef="java.lang.String" />
  <message id="_2_InMessage" itemRef="_2_InMessageType" />

  <interface id="_2_ServiceInterface" name="com.sample.loyaltyManagementHelloService">
    <operation id="_2_ServiceOperation" name="hello">
      <inMessageRef>_2_InMessage</inMessageRef>
    </operation>
  </interface>

    <serviceTask id="_3" name="Hello" operationRef="_2_ServiceOperation" implementation="Other" >
      <ioSpecification>
        <dataInput id="_2_param" name="Parameter" />
        <dataOutput id="_2_result" name="Result" />
        <inputSet>
          <dataInputRefs>_2_param</dataInputRefs>
        </inputSet>
        <outputSet>
          <dataOutputRefs>_2_result</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>x</sourceRef>
        <targetRef>_2_param</targetRef>
      </dataInputAssociation>
      <dataOutputAssociation>
        <sourceRef>_2_result</sourceRef>
        <targetRef>x</targetRef>
      </dataOutputAssociation>
    </serviceTask>   

 

Best regards,

Tobias

Reply to this message by going to Community

Start a new discussion in jBPM at Community