• +43 660 1453541
  • contact@germaniumhq.com

Using Boundary Timer Events in Adhesive BPMN


Using Boundary Timer Events in Adhesive BPMN

When having a critical long running task, it’s imperative we get immediate feedback on things that run longer than they are allowed. With the new Timer boundary events, that’s trivial to model.

How to achieve that? Well, simply add a duration timer boundary (Long Running BPMN) event on a task, that fires after the timeout passes:

Long Running BPMN

To illustrate the long running task, we’ll just wait for 3 seconds:

@adhesive.task('Potentially Long Running Task')
def potentially_long_running_task(context):
    time.sleep(3)

When running it we’ll see:

2019-11-27 05:32:55,940 INFO     Run  [root process]
2019-11-27 05:32:55,941 INFO     Run  Potentially Long Running Task
2019-11-27 05:32:57,951 INFO     Running job Every 2 seconds do timer_triggered() (last run: [never], next run: 2019-11-27 05:32:57)
2019-11-27 05:32:57,955 INFO     Run  Notify Long Running Execution
2019-11-27 05:32:57,957 INFO     Done Notify Long Running Execution
2019-11-27 05:32:58,945 INFO     Done Potentially Long Running Task
2019-11-27 05:32:58,947 INFO     Done [root process]

Note that if you change the waiting time to less than 2 seconds, the boundary timer won’t get called at all. This is particularly useful to fire notifications that are modeled as business critical from the process itself.

The full process sample is available here: https://github.com/germaniumhq/adhesive-samples#timer-notification