Compensation Handlers

Hello everybody

I tried to implement Compensation Handlers according 8.5.16. Compensation Handlers.
Execution engine gives me the following error:

Compensation activity could not be found or it missing isForCompensation=“true”

Neither Web-Modeller nor Eclipse-Plugin Modeller produces BMMN XML with isForCompensation=“true” for the compensation task even though on the graphical representaion the corresponding task is marked with “<<” and associated with boundary compensation event.

Any Ideas? Thank you for help in advance.

I’m using Flowable 6.4.0 with Tomcat 9.0.13 (jdk 1.8.0_172)

Hi Roman,

I tried to create process model in web-modeler with isForCompensation flag on the master branch. Downloaded bpmn.xml has

<serviceTask id="sid-4BDF59F9-3982-48D1-A022-37810AEDC5F9" name="ServiceTask" isForCompensation="true"></serviceTask>

set. I was able to publish and run process model in the application. Could you provide more details to reproduce the issue?

Regards
Martin

Hello Martin

Thank You for you reply.

I did a small example. See below, what kind of BPMN XML is produced. I’m using the web-modeller, which I downloaded from Flowable Download page. According to war MANIFEST.MF

  • Implementation-Title: flowable-ui-modeler-app
  • Implementation-Version: 6.4.0
    There is no isForCompensation=“true” for Payback Task.

image

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef">
  <process id="TestCompensation" name="TestCompensation" isExecutable="true">
    <startEvent id="sid-375CA047-9A1D-48FA-A983-4E61BC1EF663"></startEvent>
    <transaction id="sid-975B9F48-C98B-48CB-8F68-06DA2DE4B1EF" name="subProcess">
      <startEvent id="sid-C8F8AF15-78E0-43ED-B78C-76C0F2990D7F"></startEvent>
      <serviceTask id="sid-87175B25-E0A2-4F7E-B6E2-43FE61C5E6DE" name="Booking" flowable:class="ch.dxc.handler.Booking"></serviceTask>
      <endEvent id="sid-41735595-8D95-4849-B4F4-47DF1E12CD52"></endEvent>
      <boundaryEvent id="sid-10F1319E-B18B-4927-9D63-BEF8E3F30C69" attachedToRef="sid-87175B25-E0A2-4F7E-B6E2-43FE61C5E6DE" cancelActivity="false">
        <compensateEventDefinition></compensateEventDefinition>
      </boundaryEvent>
      <serviceTask id="sid-EB444FAA-6C9F-4FE8-8DFE-645F1931B2E3" name="Payback" flowable:class="ch.dxc.handler.Payback"></serviceTask>
      <sequenceFlow id="sid-364F4013-C73A-45AD-858D-4D1BA1B04A22" sourceRef="sid-C8F8AF15-78E0-43ED-B78C-76C0F2990D7F" targetRef="sid-87175B25-E0A2-4F7E-B6E2-43FE61C5E6DE"></sequenceFlow>
      <sequenceFlow id="sid-49FA5F97-DC48-4280-91B6-F8E3F0286CC9" sourceRef="sid-87175B25-E0A2-4F7E-B6E2-43FE61C5E6DE" targetRef="sid-41735595-8D95-4849-B4F4-47DF1E12CD52"></sequenceFlow>
    </transaction>
    <sequenceFlow id="sid-02503BD5-29D9-4AB8-9942-A799A9CFC356" sourceRef="sid-375CA047-9A1D-48FA-A983-4E61BC1EF663" targetRef="sid-975B9F48-C98B-48CB-8F68-06DA2DE4B1EF"></sequenceFlow>
    <endEvent id="sid-31C9DBC0-BC74-4584-9E6A-7EB02FCB3471"></endEvent>
    <sequenceFlow id="sid-6968E6A6-530A-4B14-8FE1-7BFFC17B1F9D" sourceRef="sid-975B9F48-C98B-48CB-8F68-06DA2DE4B1EF" targetRef="sid-31C9DBC0-BC74-4584-9E6A-7EB02FCB3471"></sequenceFlow>
    <association id="sid-B3CB194C-7760-4261-8743-7C6B121B67A1" sourceRef="sid-10F1319E-B18B-4927-9D63-BEF8E3F30C69" targetRef="sid-EB444FAA-6C9F-4FE8-8DFE-645F1931B2E3" associationDirection="None"></association>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_TestCompensation">
    <bpmndi:BPMNPlane bpmnElement="TestCompensation" id="BPMNPlane_TestCompensation">
      <bpmndi:BPMNShape bpmnElement="sid-375CA047-9A1D-48FA-A983-4E61BC1EF663" id="BPMNShape_sid-375CA047-9A1D-48FA-A983-4E61BC1EF663">
        <omgdc:Bounds height="30.0" width="30.0" x="150.0" y="277.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-975B9F48-C98B-48CB-8F68-06DA2DE4B1EF" id="BPMNShape_sid-975B9F48-C98B-48CB-8F68-06DA2DE4B1EF">
        <omgdc:Bounds height="284.0" width="569.0" x="259.0" y="150.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-C8F8AF15-78E0-43ED-B78C-76C0F2990D7F" id="BPMNShape_sid-C8F8AF15-78E0-43ED-B78C-76C0F2990D7F">
        <omgdc:Bounds height="30.0" width="30.0" x="325.0" y="252.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-87175B25-E0A2-4F7E-B6E2-43FE61C5E6DE" id="BPMNShape_sid-87175B25-E0A2-4F7E-B6E2-43FE61C5E6DE">
        <omgdc:Bounds height="80.0" width="100.0" x="465.0" y="228.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-41735595-8D95-4849-B4F4-47DF1E12CD52" id="BPMNShape_sid-41735595-8D95-4849-B4F4-47DF1E12CD52">
        <omgdc:Bounds height="28.0" width="28.0" x="705.0" y="253.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-10F1319E-B18B-4927-9D63-BEF8E3F30C69" id="BPMNShape_sid-10F1319E-B18B-4927-9D63-BEF8E3F30C69">
        <omgdc:Bounds height="30.0" width="30.0" x="550.7115745533276" y="285.36909014042186"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-EB444FAA-6C9F-4FE8-8DFE-645F1931B2E3" id="BPMNShape_sid-EB444FAA-6C9F-4FE8-8DFE-645F1931B2E3">
        <omgdc:Bounds height="80.0" width="100.0" x="420.0" y="330.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-31C9DBC0-BC74-4584-9E6A-7EB02FCB3471" id="BPMNShape_sid-31C9DBC0-BC74-4584-9E6A-7EB02FCB3471">
        <omgdc:Bounds height="28.0" width="28.0" x="873.0" y="278.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-B3CB194C-7760-4261-8743-7C6B121B67A1" id="BPMNShape_sid-B3CB194C-7760-4261-8743-7C6B121B67A1">
        <omgdc:Bounds height="23.847016269676715" width="32.779055740797844" x="520.1599263112117" y="309.66124985342367"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sid-02503BD5-29D9-4AB8-9942-A799A9CFC356" id="BPMNEdge_sid-02503BD5-29D9-4AB8-9942-A799A9CFC356">
        <omgdi:waypoint x="179.94999987237716" y="292.0"></omgdi:waypoint>
        <omgdi:waypoint x="259.0" y="292.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-6968E6A6-530A-4B14-8FE1-7BFFC17B1F9D" id="BPMNEdge_sid-6968E6A6-530A-4B14-8FE1-7BFFC17B1F9D">
        <omgdi:waypoint x="827.95" y="292.0"></omgdi:waypoint>
        <omgdi:waypoint x="873.0" y="292.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-364F4013-C73A-45AD-858D-4D1BA1B04A22" id="BPMNEdge_sid-364F4013-C73A-45AD-858D-4D1BA1B04A22">
        <omgdi:waypoint x="354.9499962730945" y="267.0"></omgdi:waypoint>
        <omgdi:waypoint x="410.0" y="267.0"></omgdi:waypoint>
        <omgdi:waypoint x="410.0" y="268.0"></omgdi:waypoint>
        <omgdi:waypoint x="464.99999999997624" y="268.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-49FA5F97-DC48-4280-91B6-F8E3F0286CC9" id="BPMNEdge_sid-49FA5F97-DC48-4280-91B6-F8E3F0286CC9">
        <omgdi:waypoint x="564.9499999999756" y="268.0"></omgdi:waypoint>
        <omgdi:waypoint x="635.0" y="268.0"></omgdi:waypoint>
        <omgdi:waypoint x="635.0" y="267.0"></omgdi:waypoint>
        <omgdi:waypoint x="705.0" y="267.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-B3CB194C-7760-4261-8743-7C6B121B67A1" id="BPMNEdge_sid-B3CB194C-7760-4261-8743-7C6B121B67A1">
        <omgdi:waypoint x="553.5810391701415" y="309.1647314795148"></omgdi:waypoint>
        <omgdi:waypoint x="519.95" y="333.62461374993785"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Hi.

Could you try perform the same test with master branch? Commit https://github.com/flowable/flowable-engine/commit/86972458f55e18d591198ba8c6260367e7c5f2b3 could fix the problem.

Regards
Martin

Hello Martin,

Cannot build it from master. I used scripts/build-all.sh. It reported diverse problems, most of them related to maven/jboss configurations/dependecies.

Do you have a build system, where I can download the latest successful build (master branch)?

best regards
Roman

See: How to build Flowable from source

flowable 6.4.1 was released just yesterday
https://github.com/flowable/flowable-engine/releases/download/flowable-6.4.1/flowable-6.4.1.zip

Compensation is working with 6.4.1.
Thank you.