Conditional Timer Boundary Event #252
-
Hello @ralphhanna, Is there anyway that we can make the timer boundary event to work based on the conditions. Say, i have one field in the data, "priority". Based on the type, i want to escalate, if the priority is "low", escalate after 4 days or if it is high, then escalate it in a day. Is there anyway we could achieve this ? That escalation of timer boundary event should trigger the service task to send out a mail. If you have any reference .bpmn file that you could share, that would be great for the understanding purpose. Thanks a lot in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, Timer Expression
<bpmn2:boundaryEvent id="Event_0hx26qc" cancelActivity="false" attachedToRef="Activity_0cijuru">
<bpmn2:timerEventDefinition id="TimerEventDefinition_0hwwvzf">
<bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">$appServices.getTimerDelay(this)</bpmn2:timeDuration>
</bpmn2:timerEventDefinition>
</bpmn2:boundaryEvent> In this case it is calling an appServices.ts method: getTimerDelay(item) {
// item passed is that of the boundary event
// need to find parent item
const parentItem = item.token.parentToken.currentItem;
const priority= parentItem.priority;
if (priority === 'high') {
return 'PT5S'; // 5 Seconds ISO 8601 duration format
} else if (priority === 'medium') {
return 'PT10S'; // 10 Seconds ISO 8601 duration format
} else if (priority === 'low') {
return 'PT15S'; // 15 Seconds ISO 8601 duration format
}
} The full bpmn file is here |
Beta Was this translation helpful? Give feedback.
Hello,
I have added the following to the documentation for future reference:
Timer Expression
PT30S
or can be a JavaScript Expression$appServices.getTimerDelay(this)
In this case it is calling an appServices.ts method: