Asynchronous JavaDelegate

Hello!

Is there a way to make JavaDelegate.execute() method asynchronous? We have a custom HTTP call inside it and it seems to me that under heavy pressure of processes all Flowable threads become busy because of waiting for HTTP responses. And this behavior slows down Flowable performance.

No, we do not want to use HttpTask because we have custom logic.

Maybe I am doing the wrong thing and the best solution is to increase the number of task execution threads (how to do this - found answer: spring.task.execution.pool.coreSize)?

Thank you!

Hi Vladimir,
you can mark the service task as triggerable service task and implement the TriggerableActivityBehavior. With that you can start in execute() something asynchronous and call runtimeService.trigger(executionId) as soon as you are done.

See also https://flowable.com/open-source/docs/bpmn/ch07b-BPMN-Constructs/#triggerable

Valentin

3 Likes

Thank you very much, Valentin!