Hi,
i want to transfer some data between two pages and change page clicking a button; how can i do it?
Thanks in advance
Hi,
i want to transfer some data between two pages and change page clicking a button; how can i do it?
Thanks in advance
Basically you need to store the data that the user will input in the form in a persistent storage in the first task and retrieve them in the second task. The easiest solution for storage is to use Business Data Management (BDM) feature of Bonita. And to retrieve data you will use form variables initialize by calling Bonita Engine REST API.
Here is a description of the data flow from the user web browser to the business database schema managed by Bonita BDM:
Value
property of the widget.Action
property of the widget button) to either start a new process instance or submit a task. When clicked it will call the Bonita Engine API giving the order to start the process or execute the task and, in the same call, data entered by the user are sent. Data to send are defined by the Data sent on click
property of the widget button. Value of Data sent on click
is usually a form variable. It can be directly a variable associated with one or several form widgets (as variable are JavaScript objects they can have multiple attributes and each attribute value can be updated by a different widget) or a JavaScript variable that is used to aggregate together values of different form variables. The form variable is convert into some JSON to be sent in the HTTP request to Bonita Engine API.Now here is a description of how to display some data in a form like in your second task:
../{{context.myBusinessVariable_ref.link}}
myBusinessVariable
must be exactly the name of the business variable as declared in the process definition. context
is a form variable initialize with a REST API call (to /bonita/API/bpm/userTask/{{taskId}}/context
) and taskId
is also a form variable initialize using an URL parameter named id
.myData.myAttributeName
where myData
is the name of the form variable and myAttributeName
is the name of one of the attribute of the BDM object.This process of creating a form to display data will become a lot easier in the upcoming Bonita version (7.9.0)
By two pages are you referring to:
?
Hi,
i’m referring to forms
ok, thanks
last question : how can i change form clicking a button? (target url on success)
In the configuration of the button widget you have an “Action” property:
In both case (instantiation and task forms), the “Target URL on success” value is by default /bonita
. Meaning the user will be redirected to the Bonita Portal and will be display the list of pending task it might performed.
In Bonita task processing is asynchronous. Meaning that if a user John submit a task, it immediately get a response from the Bonita Engine even if the task processing might still be on going. In a scenario where a single user perform the first task and the immediate next task it will be redirected to the Bonita Portal because the second task might not be available immediately after the submission of the first one. In the Portal he will be able to claim the second task when available (a task can possibly be performed by a set of candidates) and then actually be able to submit the form of the second task.
If you want to immediately redirect the user to the next form, you need:
Hope it will helps.
Thanks!