CMMN Entry Sentry is not captured if sourceRef is an Event Listener

Hello,

I was trying to create a case where a case is waiting for an events via JMS to happen. I was able to trigger the Event Listener in the case, but the problem is Entry Sentry associated with the Event Listener is not being triggered

As illustrated in image above, the “Receive Event” was triggered. I could see the variables being updated based on correlation parameters. But it did not trigger “Create Alert” task. I tried to check the database, it seems like the Sentry is not registered for createAlert task.

I tried to change the sourceRef to “Logging”, it works fine. But when the sourceRef is an Event Listener then this issue occurred. May I know what did I miss or my implementation is incorrect?

Below is the XML for the CMMN Model:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/cmmn" xmlns:cmmndi="http://www.omg.org/spec/CMMN/20151109/CMMNDI" xmlns:dc="http://www.omg.org/spec/CMMN/20151109/DC" xmlns:di="http://www.omg.org/spec/CMMN/20151109/DI" targetNamespace="http://www.flowable.org/casedef">
  <case id="orderDeliveryDateChange" name="Order Delivery Date Change" flowable:initiatorVariableName="initiator">
    <documentation>User to initiate order delivery date change for specific order line item.</documentation>
    <casePlanModel id="casePlanModel" flowable:formKey="changeOrderDeliveryDate" flowable:formFieldValidation="true">
      <planItem id="planItem5" definitionRef="sid-9D710CB1-F3E2-4DA3-843C-ED05514B5FEC"></planItem>
      <stage id="sid-9D710CB1-F3E2-4DA3-843C-ED05514B5FEC">
        <planItem id="planItem1" name="Receive Event" definitionRef="receiveEvent"></planItem>
        <planItem id="planItem2" name="Send Event" definitionRef="sendEvent">
          <entryCriterion id="entryCriterion1" flowable:sentryRef="sentry1"></entryCriterion>
        </planItem>
        <planItem id="planItem3" name="Logging" definitionRef="logging"></planItem>
        <planItem id="planItem4" name="Create Alert" definitionRef="createAlert">
          <entryCriterion id="entryCriterion2" flowable:sentryRef="sentry2"></entryCriterion>
        </planItem>
        <sentry id="sentry1">
          <planItemOnPart id="sentryOnPart1" sourceRef="planItem3">
            <standardEvent>complete</standardEvent>
          </planItemOnPart>
        </sentry>
        <sentry id="sentry2">
          <planItemOnPart id="sentryOnPart2" sourceRef="planItem1">
            <standardEvent>complete</standardEvent>
          </planItemOnPart>
        </sentry>
        <eventListener id="receiveEvent" name="Receive Event">
          <extensionElements>
	        <flowable:eventCorrelationParameter xmlns:flowable="http://flowable.org/cmmn" name="orderId" type="string" value="${orderId}"></flowable:eventCorrelationParameter>
	        <flowable:eventCorrelationParameter xmlns:flowable="http://flowable.org/cmmn" name="orderLineId" type="string" value="${orderLineId}"></flowable:eventCorrelationParameter>
	        <flowable:eventOutParameter xmlns:flowable="http://flowable.org/cmmn" source="orderId" sourceType="string" target="orderId"></flowable:eventOutParameter>
	        <flowable:eventOutParameter xmlns:flowable="http://flowable.org/cmmn" source="orderLineId" sourceType="string" target="orderLineId"></flowable:eventOutParameter>
	        <flowable:eventOutParameter xmlns:flowable="http://flowable.org/cmmn" source="status" sourceType="string" target="status"></flowable:eventOutParameter>
	        <flowable:channelType xmlns:flowable="http://flowable.org/cmmn"><![CDATA[jms]]></flowable:channelType>
	        <flowable:eventType xmlns:flowable="http://flowable.org/cmmn"><![CDATA[receiveEvent]]></flowable:eventType>
	      </extensionElements>
        </eventListener>
        <task id="sendEvent" name="Send Event" isBlocking="false" flowable:type="send-event">
          <extensionElements>
            <flowable:eventInParameter xmlns:flowable="http://flowable.org/cmmn" source="orderId" target="orderId" targetType="string"></flowable:eventInParameter>
            <flowable:eventInParameter xmlns:flowable="http://flowable.org/cmmn" source="orderLineId" target="orderLineId" targetType="string"></flowable:eventInParameter>
            <flowable:eventInParameter xmlns:flowable="http://flowable.org/cmmn" source="supplierSku" target="supplierSku" targetType="string"></flowable:eventInParameter>
            <flowable:eventInParameter xmlns:flowable="http://flowable.org/cmmn" source="supplierCode" target="supplierCode" targetType="string"></flowable:eventInParameter>
            <flowable:eventInParameter xmlns:flowable="http://flowable.org/cmmn" source="currentDeliveryDate" target="currentDeliveryDate" targetType="string"></flowable:eventInParameter>
            <flowable:eventInParameter xmlns:flowable="http://flowable.org/cmmn" source="newDeliveryDate" target="newDeliveryDate" targetType="string"></flowable:eventInParameter>
            <flowable:eventInParameter xmlns:flowable="http://flowable.org/cmmn" source="initiator" target="initiator" targetType="string"></flowable:eventInParameter>
            <flowable:eventInParameter xmlns:flowable="http://flowable.org/cmmn" source="status" target="status" targetType="string"></flowable:eventInParameter>
            <flowable:channelKey xmlns:flowable="http://flowable.org/cmmn"><![CDATA[ch-out-workflow-order-delivery-date-change]]></flowable:channelKey>
            <flowable:channelType xmlns:flowable="http://flowable.org/cmmn"><![CDATA[jms]]></flowable:channelType>
            <flowable:eventType xmlns:flowable="http://flowable.org/cmmn"><![CDATA[ev-workflow-order-delivery-date-change]]></flowable:eventType>
          </extensionElements>
        </task>
        <task id="logging" name="Logging" isBlocking="false" flowable:type="java" flowable:delegateExpression="${loggerDelegate}"></task>
        <task id="createAlert" name="Create Alert" isBlocking="false" flowable:type="java" flowable:delegateExpression="${notifyEnquirerDelegate}"></task>
      </stage>
    </casePlanModel>
  </case>
  <cmmndi:CMMNDI>
    <cmmndi:CMMNDiagram id="CMMNDiagram_orderDeliveryDateChange">
      <cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
        <dc:Bounds height="299.0" width="580.0" x="30.0" y="30.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem5" cmmnElementRef="planItem5">
        <dc:Bounds height="244.0" width="491.0" x="75.0" y="55.0"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
        <dc:Bounds height="30.0" width="30.0" x="256.75" y="227.8739096922775"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
        <dc:Bounds height="80.0" width="100.0" x="350.25" y="79.5"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_sid-AEEEA9E4-79B5-453C-A6FF-D6F7EF1D7A82" cmmnElementRef="sid-AEEEA9E4-79B5-453C-A6FF-D6F7EF1D7A82">
        <dc:Bounds height="22.0" width="14.0" x="343.0985712938304" y="107.26169311836618"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem3" cmmnElementRef="planItem3">
        <dc:Bounds height="80.0" width="100.0" x="196.75" y="79.5"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_planItem4" cmmnElementRef="planItem4">
        <dc:Bounds height="80.0" width="100.0" x="346.75" y="199.5"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNShape id="CMMNShape_sid-709515B1-0724-4E28-82A2-808CA0CB34E6" cmmnElementRef="sid-709515B1-0724-4E28-82A2-808CA0CB34E6">
        <dc:Bounds height="22.0" width="14.0" x="338.8192909769854" y="231.21696412998426"></dc:Bounds>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNShape>
      <cmmndi:CMMNEdge id="CMMNEdge_sid-ED5D3C7B-B0F5-4738-899E-D10C8E9E758A" cmmnElementRef="planItem3" targetCMMNElementRef="sid-AEEEA9E4-79B5-453C-A6FF-D6F7EF1D7A82">
        <di:waypoint x="296.69999999999857" y="118.90090759546484"></di:waypoint>
        <di:waypoint x="343.1515410959745" y="118.34433845167308"></di:waypoint>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNEdge>
      <cmmndi:CMMNEdge id="CMMNEdge_sid-AB22F0B5-9E4C-453B-BC47-625514AFA478" cmmnElementRef="planItem1" targetCMMNElementRef="sid-709515B1-0724-4E28-82A2-808CA0CB34E6">
        <di:waypoint x="303.69998206682783" y="242.21696412998426"></di:waypoint>
        <di:waypoint x="338.8192909769854" y="242.21696412998426"></di:waypoint>
        <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
      </cmmndi:CMMNEdge>
    </cmmndi:CMMNDiagram>
  </cmmndi:CMMNDI>
</definitions>

Many thanks in advance!

The problem is that you have your sentry configured on the ‘complete’ event. An event in CMMN cannot complete, it needs to ‘occur’. If you change the event to ‘occur’, it’ll work.

1 Like