AnsweredAssumed Answered

Error while deploying bpmn with service task

Question asked by rahuldahiya on Aug 17, 2015
Latest reply on Aug 20, 2015 by pmsevestre

I am trying to import a bpmn file, while deploying the bpm file i get following error

Error while parsing: One of the attributes 'class','delegateExpression','type','operation' or 'expression' is mendatory on service task.

Below is my BPMN file :

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="" xmlns:xsi="" xmlns:xsd="" xmlns:activiti="" xmlns:bpmndi="" xmlns:omgdc="" xmlns:omgdi="" typeLanguage="" expressionLanguage="" targetNamespace="">
  <process id="myProcess" name="My process" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <serviceTask id="servicetask1" name="Service Task" activiti:type="shell">
    <activiti:field name="command" stringValue="echo" />
    <activiti:field name="arg1" stringValue="EchoTest" />
    <activiti:field name="arg2" stringValue="echo" />
    <activiti:field name="arg3" stringValue="EchoTest" />
    <activiti:field name="wait" stringValue="true" />
    <activiti:field name="outputVariable" stringValue="resultVar"/>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
  <bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
    <bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="90.0" y="240.0"></omgdc:Bounds>
      <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
        <omgdc:Bounds height="171.0" width="161.0" x="360.0" y="160.0"></omgdc:Bounds>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="710.0" y="228.0"></omgdc:Bounds>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="125.0" y="257.0"></omgdi:waypoint>
        <omgdi:waypoint x="360.0" y="245.0"></omgdi:waypoint>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="521.0" y="245.0"></omgdi:waypoint>
        <omgdi:waypoint x="710.0" y="245.0"></omgdi:waypoint>

In the documentation, in section 8.5.11. (Shell Task) I did everything the same way but it didn't work

In one of the posts I've read that currently service tasks are not suported in import/export and that I will need to wrtie my own custom class which extends ShellTaskBehaviour class. I am also unable to locate the ShellTaskBehaviour class. Please specify the jar in which this class is present and how can I use it to write my custom shell task. here the link to that post :

I would like to know how to execute my shell scripts using bpmn file. And if the import/export of service tasks is not currently supported then will it be implemented in the future releases and whats the best way to implement the shell tasks :)

Any help is appreciated.