I am implementing a process which requires to get some data (currency rate for EURUSD pair) from a 3-rd party service at the instantiation form.
Initially, Bonita suggested to save the connector output into a process variable but I could not get its content on the form.
Then I tried to save the connector output into a business variable in the pool - I created a business object to store the currency rate.
I tested the connector - it succeeded both times and returned results from the API.
However, no connector output seems to be available on the instantiation form at all.
To retrieve the data as a process variable, I followed the approach suggested in the example “ProcessVariableDiagram.bos” using the case variable
…/API/bpm/caseVariable/{{task.caseId}}/myProcessVariable
To get the data as a business variable, I set up another form variable (External API) …/{{context.myBusinessData_ref.link}} as suggested in the documentation but it did not work either.
Please advise if such functionality can be implemented in Bonita at all.
If yes, a working example of a connector reading and providing some data to the instantiation form before starting a process will be appreciated.
I think the problem is that you used an output connector when you should have used an input one instead. If you want to display some data on a particolar form you need to define an input connector prior to the task where your form is defined. On the other hand, an output connector can be used, for example, to fetch the data a user inserted in a form and manipulate it/save it externally.
If you want to check wether your API requests suceeded, open the network tab and load the page, you should be able to see the get request relative to the API call (normally they are the last being executed).
Maybe I have not made my previous statement clear enough.
I did set up an input connector and expect to get the result from it at the instantiation form.
However, this result is supposed to be written into process variable which does not seem to be accessible in the instantiation form.
Anyway, this issue is in pending state and I plan to revisit it later.
Might be a problem with fetching the process variable or with using it in the form. Does the API request return something or do you get some error code?
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.