alebu
alebu

Reputation: 513

How to specify service task in BPMN 2.0 to execute custom java code in JBPM 5

I'd like to add service test in JBPM-5 using BPMN-2.0 using only XML syntax. I want that service task to have an input and output parameters of some Java type.
Lets say I created mypackage.MyCustomTaskWorkItemHandler for my service task and registered it in corresponding WorkItemManager like MyCustomTask.
Now I'd like to describe a call of this service task in BPMN XML file.

<serviceTask id="myCustomTask1" ... implementation=??? operationRef=???>
    <!-- incoming,outgoing,etc -->
    <ioSpecification>
        ...
    </ioSpecification>
</serviceTask>

Tag serviceTask is from http://www.omg.org/spec/BPMN/20100524/MODEL namespace. How exacty should I specify input and output parameters for it?

Upvotes: 2

Views: 6861

Answers (1)

salaboy
salaboy

Reputation: 4133

This is an example: http://pastebin.com/4dpz0KZt You do the ioSpecification in the same way that you do it for a UserTask. jBPM5 will look in the tns:taskName="Start Procedure" to match with your WorkItemHandler registered name. In my case I've registered a "Start Procedure" workItemHandler. I've extracted this example code from the Emergency Services Application -> http://salaboy.com/2011/05/28/emergency-services-v2-jbpm5-and-drools-blueprint/

For this process: https://github.com/Salaboy/emergency-service-drools-app/blob/master/emergency-service-core/src/main/resources/processes/procedures/GenericEmergencyProcedure.bpmn Happy new year! Cheers

Upvotes: 2

Related Questions