how to listen to the 'callback' from other system?


we have some automation procedure as below:
1: Bonitasoft workflow send a request to Mulesoft including the 'callback' address.
2: Mulesoft pass the request to Ansible tower to run playbook.
3: it may take up to 30 minutes to complete on Ansible Tower.
4: when it's done, Ansible tower send the result back to Mulesoft.
5: Mulesoft send the 'result' back to 'callback' address
6: Bonitasoft continue the workflow based on the result.
7: Bonitasoft store the output to database for reports purpose.

I want to know how to implement this in Bonitasoft and are there any document about this?


1 answer


If your request 'Bonita' -> 'Mulesoft' is a Rest request. You can't take your callback if it's take a long time to execute. Why? Because all Rest Connector is synchrone, not async, so, you will get a timeout exeption in bonita.
To do that, you need to create a business data object that contain your Mulesoft callback. So your MuleSoft need to add an entry in the bonita database when it's start and when it's done.

When it's done, you need to create your Rest call from your bonita process to your MuleSoft. After this task, create one other who check in the database the callback of MuleSoft. Rely to a conditionnal gate : if callback present go to the next task, otherwise, call a timer of x sec and re-execute the check.



Submitted by bill.gao_1410535 on Mon, 09/23/2019 - 17:10

thanks Bastien for your reply. actually when 'Bonita' send a Rest request with a unique 'transaction id' to 'Mulesoft', 'Mulesoft' reply with code '202' to acknowledge 'request received' immediately to 'Bonita'. then 'Mulesoft' will process the data with other system, it may take up to 30 minutes to process depending on the situation, when 'result' is ready, 'Mulesoft' will send the 'result' back to 'Bnonita' with the 'transaction id'. then 'Bonita' associate the 'result' with the related 'workflow task' using the 'transaction id' and move forward the 'workflow'.

Since 'connector' is not designed to process this kind of 'request', it looks we need to develop some 'application' to work between 'Bonita' and 'Mulesoft'.

anyway thanks again.