To do this, I’ve created a variable varTestRest with external API type and I’ve set in url this : http://localhost:20414/bonita/API/system/session/{{userId}}.
I’ve added a text widget and I’ve type in text propriety varTestRest.
When I run or when I click on preview, nothing is displayed…
Someone could tell me what is wrong please ?
Thanks in advance.
The user_id is inside the session object. If you have followed the getting started tutorial, you already have a variable called session, which points to …/API/system/session/unusedid.
To display the userid, add a text widget and bind the text property to session.user_id.
You can also get the name of the user from the session object, by binding to session.user_name.
This will not display anything when you preview your form, because there is no session, but it should work when you run the process that displays the form.
To put the user_id in a table widget, bind the Content property to session.user_id. However, you will get a table containing a single cell, which is maybe not what you want.
I’ve solved this issue by adding in server side an Access-Control-Allow-Origin header. Now I get data from Rest server and I can to display it in text widget but I can not to do same in table.
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.