CMMN Event Timer not activating human task

timerTask
I have a simple event timer that triggers at 10 seconds.

<?xml version="1.0" encoding="UTF-8"?>
<definitions 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" xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL"
             targetNamespace="http://www.flowable.org/casedef">
    <case id="timerCase" name="Timer Case" flowable:initiatorVariableName="initiator">
        <casePlanModel id="casePlanModel" flowable:formFieldValidation="true">
            <planItem id="planItem1" name="Timer Event" definitionRef="timerEvent"></planItem>
            <planItem id="planItem2" name="Human Task" definitionRef="humanTask">
                <entryCriterion id="sid-19DB8934-DC13-47D0-93CE-E539789D869D"
                                flowable:sentryRef="sentry1"></entryCriterion>
            </planItem>
            <planItem id="planItem3" name="Human Task Alone" definitionRef="humanTaskAlone"></planItem>
            <sentry id="sentry1">
                <planItemOnPart id="sentryOnPart1" sourceRef="planItem1">
                    <standardEvent>complete</standardEvent>
                </planItemOnPart>
            </sentry>
            <timerEventListener id="timerEvent" name="Timer Event">
                <timerExpression><![CDATA[PT10S]]></timerExpression>
            </timerEventListener>
            <humanTask id="humanTask" name="Human Task" flowable:formFieldValidation="true"></humanTask>
            <humanTask id="humanTaskAlone" name="Human Task Alone" flowable:formFieldValidation="true"></humanTask>
        </casePlanModel>
    </case>
    <cmmndi:CMMNDI>
        <cmmndi:CMMNDiagram id="CMMNDiagram_timerCase">
            <cmmndi:CMMNShape id="CMMNShape_casePlanModel" cmmnElementRef="casePlanModel">
                <dc:Bounds height="714.0" width="718.0" x="45.0" y="15.0"></dc:Bounds>
                <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
            </cmmndi:CMMNShape>
            <cmmndi:CMMNShape id="CMMNShape_planItem1" cmmnElementRef="planItem1">
                <dc:Bounds height="31.0" width="31.0" x="105.0" y="150.0"></dc:Bounds>
                <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
            </cmmndi:CMMNShape>
            <cmmndi:CMMNShape id="CMMNShape_planItem2" cmmnElementRef="planItem2">
                <dc:Bounds height="80.0" width="100.0" x="354.0" y="135.0"></dc:Bounds>
                <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
            </cmmndi:CMMNShape>
            <cmmndi:CMMNShape id="CMMNShape_sid-19DB8934-DC13-47D0-93CE-E539789D869D"
                              cmmnElementRef="sid-19DB8934-DC13-47D0-93CE-E539789D869D">
                <dc:Bounds height="22.0" width="14.0" x="346.24412135453343" y="167.7138447789366"></dc:Bounds>
                <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
            </cmmndi:CMMNShape>
            <cmmndi:CMMNShape id="CMMNShape_planItem3" cmmnElementRef="planItem3">
                <dc:Bounds height="80.0" width="100.0" x="235.0" y="299.0"></dc:Bounds>
                <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
            </cmmndi:CMMNShape>
            <cmmndi:CMMNEdge id="CMMNEdge_sid-AC116070-FB27-4F30-9195-17F58292257C" cmmnElementRef="planItem1"
                             targetCMMNElementRef="sid-19DB8934-DC13-47D0-93CE-E539789D869D">
                <di:waypoint x="136.92640054703503" y="166.87187578977202"></di:waypoint>
                <di:waypoint x="346.45156160249974" y="178.34354080288642"></di:waypoint>
                <cmmndi:CMMNLabel></cmmndi:CMMNLabel>
            </cmmndi:CMMNEdge>
        </cmmndi:CMMNDiagram>
    </cmmndi:CMMNDI>
</definitions>

debuggin:

            while (true) {

                def plannedItems = cmmnRuntimeService.createPlanItemInstanceQuery().includeEnded()
                                                     .caseInstanceId(caseInstance.getId())
                                                     .orderByName().asc()
                                                     .list()

                println "Planned itm size: ${plannedItems.size()}"
                println "task count: ${taskService.createTaskQuery().list().size()}"
                plannedItems.each {
                    println "Before Sleep : name: ${it.name}, state: ${it.state}"
                }
                Thread.sleep(1000)
            }

Planned itm size: 3
task count: 1
Before Sleep : name: Human Task, state: available
Before Sleep : name: Human Task Alone, state: active
Before Sleep : name: Timer Event, state: available

After a while the timer completes but Human Task stays avaliabe.

Planned itm size: 3
task count: 1
Before Sleep : name: Human Task, state: available
Before Sleep : name: Human Task Alone, state: active
Before Sleep : name: Timer Event, state: completed

So looks like state changed on timer to completed. I was expecting Expire Task to be active. Why does it stay available?

Hi, you need to change the standardEvent of the planItemOnPart of the sentry to occur, like this:

<sentry id="sentry1">
        <planItemOnPart id="sentryOnPart1" sourceRef="planItem1">
          <standardEvent>occur</standardEvent>
        </planItemOnPart>
</sentry>
1 Like

That was it. I really appreciate the help.

I can change it in the raw xml and it works. I cannot get it to change using the modeler. Start Trigger Transition Event choose occur, but xml still shows complete.

Never mind. You have to change the transition. :stuck_out_tongue_closed_eyes: