Latency Post Task Execution

1
0
-1

I have instantiated a Bonita Process which in turn creates a case id(C1) and associated tasks as well.

Now, i execute task T1 associated to case C by doing the following operations
For this example, I have purposefully masked the IP URL and considered the task id to be T1

  1. http://1xx.1xx.1xx.1xx:3000/bonita/API/bpm/humanTask/T1 (Assign Task to an User) [API1]
  2. http://1xx.1xx.1xx.1xx:3000/bonita/API/bpm/userTask/T1/execution (Execute Task associated to an user)[API2]

After the aforementioned api's are done with, I want to fire the following API to find the next active task in the user's bucket
3. http://1xx.1xx.1xx.1xx:3000/bonita/API/bpm/humanTask?c=200&f=caseId%3DC1&p=0 (Fetch Next Task in the Case)[API3]

Now the questions are:
1. When i fire the 1st and 2nd API, and i get a success response (200) on both of them, which basically leads to me fire the 3rd API. Whenever I fire the 3rd one, there's a marked time delay in receiving the array response. Initially it is an array which gives me the previous task, and after some seconds delay, i have the correct response.
To better represent the same, take this example:

After Initiation I have Task T1 belonging to Case C1.
I fire API 3 and this is my response

[{id:123,name:T1, rootContainerId: 001..........}]

After I run API1 and API2, and again executing API3, this is my response
[{id:123,name:T1, rootContainerId: 001..........}]
after few seconds
[{id:456,name:T2, rootContainerId: 001..........}]
It is taking some time delay for the next active task's detail to show up as a response.

How do i get past this? I would need the context/metadata of the next task T2 immediately after API1 and API2 is done. I mean to say, when i have received a 200 status on both the api's, i shouldnt be waiting on a response to pop up after some time delay.
Immediately, i get a stale response and after few seconds time delay, a correct response

2. Is the following latency removed in the subscription edition?

3. Why does Bonita send a success response of 200 even though all operations are not completed in the `Execution` API?

(I am currently using a Community Edition of Bonita)

1 answer

1
0
-1

Hi,

That is the expected behavior.
Bonita Engine accepts the API call, and introduce the work (execute task) in the work queue, and the receive a 200 code to say that it has been taken. From there, the work executor service will handle the completion of all related works, which may take more than milliseconds depending on the design and the current server load.

If you want to learn more about this mechanism give a look to this documentation section
https://documentation.bonitasoft.com/bonita/latest/runtime/execution-seq...

Notifications