Async Intermediate none event

Hello, is it a way to force an intermediate none throwing event to be Async?
My use case is the following:

  • add none events in my workflow as business milestones
  • add a listener to each event to trace each milestone
  • this listener extracts information from the execution context and sends it to an external module.
    But if this sending fails, it means that this milestone step but also all previous steps before an asynchronous flag will be replayed by the engine, what I want to avoid. I would like to replay only the event (including using the dead letter if needed), not the full chain.

A solution would be to use in place of the event a service task which can be Async, but not really what I want in a BPMN point of view.
Thanks for your help.
Best Regards
William

Hi William,

Yes, intermediateThrowEvent can be asynchronous.

    <intermediateThrowEvent id="noneEvent" name="None Event" flowable:async="true">
      <extensionElements>
        <activiti:executionListener class="org.flowable.examples.bpmn.executionlistener.CurrentActivityExecutionListener" event="start" />
      </extensionElements>
    </intermediateThrowEvent>

You can hook into process parsing and set listener automatically.

 --> (async, business milestone) --> (nextStep)

The problem could be when the (nextStep) fails transaction is rolled back and writing to the external system can be triggered again (when it is not transactional). One possibility is to make (nextStep) asynchronous too.
May be a better option could be just to create a job in the business milestone listener. Custom JobHandler can handle this job and write the state to the external system. If the transaction fails, job is not created. It’s up to you where you put the transaction boundaries.

Regards
Martin

Ah ok, cool!

Thanks Martin for your quick answer as usual :grinning:

But it means that it is the modeler which isn’t up-to-date, because this option isn’t available in its GUI.
At least in version 6.3.1.

BTW, no news about the version 6.5 planned end of May?

Thanks & Regards
William

And about forcing next step to be asynchronous, you’re right, it’s unfortunately required because we have no notion of “asynchronous before” and “asynchronous after” in Flowable.

I hope this helps:

Regards
Martin

Thanks a lot Martin for your really reactive and efficient support.
:+1::clap:
Have a good weekend.
William