Striving to invoke a Java Method via a Service Task in JBPM 6
tujasiri Jul 16, 2014 11:28 AMI'm striving to invoke a method from a service task. I've followed a few suggestions and examples, mainly Maciej Swiderski's-->HERE. I think everything set up correctly, for the most part, but my custom method is not being called.
I've:
- created the class with will execute my "task"
- created the necessary conf, and wid files
- registered my WorkItemHandler (and the executeWorkItem method is invoked)
And here are BPMN file contents:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools">
<itemDefinition id="_sItem" structureRef="String" />
<itemDefinition id="_jbpm-unique-3_InMessageType" structureRef="java.lang.String" />
<message id="_jbpm-unique-3_InMessage" itemRef="_jbpm-unique-3_InMessageType" />
<interface id="_jbpm-unique-3_ServiceInterface" name="com.sample.BriefVerify" implementationRef="" >
<operation id="_jbpm-unique-3_ServiceOperation" name="sayHello" implementationRef="" >
<inMessageRef>_jbpm-unique-3_InMessage</inMessageRef>
</operation>
</interface>
<process processType="Private" isExecutable="true" id="com.sample.bpmn.ServiceProcess" name="Service Process" >
<!-- process variables -->
<property id="s" itemSubjectRef="_sItem"/>
<!-- nodes -->
<startEvent id="_jbpm-unique-2" name="Start" isInterrupting="false"/>
<serviceTask id="_jbpm-unique-3" name="Hello" operationRef="_jbpm-unique-3_ServiceOperation" implementation="Other" >
<ioSpecification>
<dataInput id="_jbpm-unique-3_param" name="Parameter" />
<dataOutput id="_jbpm-unique-3_result" name="Result" />
<inputSet>
<dataInputRefs>_jbpm-unique-3_param</dataInputRefs>
</inputSet>
<outputSet>
<dataOutputRefs>_jbpm-unique-3_result</dataOutputRefs>
</outputSet>
</ioSpecification>
</serviceTask>
<endEvent id="_jbpm-unique-4" name="End" >
<terminateEventDefinition />
</endEvent>
<!-- connections -->
<sequenceFlow id="_jbpm-unique-2-_jbpm-unique-3" sourceRef="_jbpm-unique-2" targetRef="_jbpm-unique-3" />
<sequenceFlow id="_jbpm-unique-3-_jbpm-unique-4" sourceRef="_jbpm-unique-3" targetRef="_jbpm-unique-4" />
</process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="com.sample.bpmn.ServiceProcess" >
<bpmndi:BPMNShape bpmnElement="_jbpm-unique-2" >
<dc:Bounds x="0" y="0" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_jbpm-unique-3" >
<dc:Bounds x="197" y="3" width="100" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_jbpm-unique-4" >
<dc:Bounds x="0" y="0" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_jbpm-unique-2-_jbpm-unique-3" >
<di:waypoint x="24" y="24" />
<di:waypoint x="247" y="27" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_jbpm-unique-3-_jbpm-unique-4" >
<di:waypoint x="247" y="27" />
<di:waypoint x="24" y="24" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
The rest of the files are here: https://github.com/tujasiri/BriefReqVerify
Any help is appreciated!
-TU