Dynamically change dueDate in boundary event with processvariable

847 views
Skip to first unread message

Christoph Friedl

unread,
May 11, 2015, 10:28:51 AM5/11/15
to camunda-...@googlegroups.com

i got a special question regarding timer boundary events on a user task in Camunda:

When starting the process I set the timer duration with a process variable and use expressions in the boundary definition to resolve the variable. The boundary event is defined on a user task.

<bpmn2:boundaryEvent id="BoundaryEvent_1" name="" attachedToRef="withBoundary">

      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>

      <bpmn2:timerEventDefinition id="_TimerEventDefinition_11">

        <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">${hurry}</bpmn2:timeDuration>

      </bpmn2:timerEventDefinition>

    </bpmn2:boundaryEvent>

In some cases, when the timer is already running it can occur, that the deadline (dueDate) should be extended because the asignee has requested more time. For this purpose i want to change the value of the process variable defining the deadline.

As it happens, the variable is already resolved at the process-start and set to the boundary event.

Any further changes of the variable do not affect the dueDate of the boundary timer because it is stored in the database and is not updated when the value of the variable changes.

I know how to update the dueDate of the job element via the Java API, but i want to provide a generic approach like setting it with changing the value of the variable.

The most common use case for extending the deadline will be when the boundary timer is already running.

Any ideas how to cope with this situation?

Any tips are very apprechiated. Cheers Chris

thorben....@camunda.com

unread,
May 12, 2015, 4:53:33 AM5/12/15
to camunda-...@googlegroups.com, friedl.c...@gmail.com
Hi Christoph,

I don't see a good, existing solution for that problem. For the CMMN part of the engine, we have implemented variable listeners that are notified whenever a variable value changes. While there already existis a certain infrastructure that is shared between the CMMN and the BPMN implementation in the core engine, the BPMN engine does not yet invoke the listeners. We have a corresponding ticket [1]  which you may want to vote for and watch.

Cheers,
Thorben

[1] https://app.camunda.com/jira/browse/CAM-2899

friedl.c...@gmail.com

unread,
May 12, 2015, 5:53:42 AM5/12/15
to camunda-...@googlegroups.com, friedl.c...@gmail.com
Hi Torben,

"variable listeners" are exactly what I am looking for. In the meantime I try to get it done by modelling a workaround solution including a service task executing the update of the dueDate of the job depending on the value of a second process variable.

Unfortunately I am the only one who has voted yet for the ticket ...

Chris

thorben....@camunda.com

unread,
May 12, 2015, 5:57:37 AM5/12/15
to camunda-...@googlegroups.com, friedl.c...@gmail.com
Hi Chris,

Good that you have a workaround. If you don't want to wait until we tackle the issue, feel free to create a pull requeust. We can give you some pointers where to start and what to consider during implementation.

Cheers,
Thorben
Reply all
Reply to author
Forward
0 new messages