1

I start my flowable process by calling startProcessInstanceByMessage with variables as parameter. After that process starts and all service task are called. When process ends I get response with variable.

I don't want to wait until process ends with response. It may tooks ages and client can't wait. What I want is eg. processId variable returned after process starts and all other tasks should run in background without client awaiting. enter image description here

As it is presented above, I want response from my REST Api after Start event, before Task 1. Task 1 to N should work in background.

I tried to use asynchronous flag in XML configuration of BPMN in flowable. Unfortunately in my service tasks I use beans with @Autowire. After calling process I get exception

No thread-bound request found: 
Are you referring to request attributes outside of an actual web request  

Any advice how to get response after start event and continue tasks without client awaiting for response?

cwiq
  • 105
  • 2
  • 15

1 Answers1

1

In order to be able to run Task 1, Task 2, etc. in the background you need to set the asynchronous flag on the first task.

I don't know what you are using from the service task (expression, delegateExpression, class ). If you are using Spring then using class is not recommended. You should either use expression and call methods on your bean or use delegateExpression and make your bean implement JavaDelegate.

Filip
  • 19,269
  • 7
  • 51
  • 60