Hi;
I create a BDM with business objects, each of them has others business object as attributs.
for each task in process, i assigned a form that was create from contrat, this contrat contains these business objetcts;
After running this process, there are no data in H2 data base? also, i can not display this data when i use:
…/{{context.adtaA04_ref.link}} ?
After reviewing your process I think I understand why data is not recorded in your H2 database at form submission.
Everything looks fine in the form, nevertheless you need to set up operations in Bonita Studio to update the BDM object with the value from form output.
When you are on a task, go to Execution/Operations, set up your target business object, the operation and write a script to parse all aggregated objects.
You can find it in the documentation in Operations section.
Please pay attention to the fact that you should not use the object DAO in the right operand of your script.
I hope it helps. If that’s the case I’ll let you validate my answer, it might be helpful for other members.
First a quick comment on the process you shared: in the process configuration, the username to use when running the process from the Studio is "Moufida " with a space at the end. This failed because the user is registered without this white space at the end: “Moufida”. I recommend to fix this configuration issue. I’ll continue my investigation based on your example.
In order to start, your process need to receive the data defined in the contract. In your example the contract include one complex input named “message2Input” with a single attribute “labelmpsg2”. I can confirm this work correctly in your example (the form sent the data expected by the contract).
The default value of your process business variable named “message2”, is set using a Groovy script that will use the contract “message2Input”, “labelmpsg2” attribute value.
This is correct and I can successfully execute this and see the attribute “labelmpsg2” of your business variable being stored in the test database used for business data (h2 database embedded in Bonita Studio).
Note that your business variable “message2” is of type “Message2”. This type has an attribute named “labelmpsg2” of type “string”, but also two other attributes “se1” and “se2” of type “Seg1” and “Seg2”. I cannot find any data for those two attributes because you don’t initialize them in “message2” default value. So if you want to initialized “se1” and “se2” attributes you need to update the “message2” default value script and optionally update the contract and form to get the data from the user.
Note that you probably don’t need to define “seg1” and “seg2” business variable as the data is already part of “message2” business variable.
do I have to initialized all the business variables even those that I use only in the business tasks? ?
as in the previous bos!!!
if yes, how i can do it?
In a process definition you can declare as you did several business data. You don’t need to initialize all of them when the process is start (i.e. when the process instance is created).
Initialization at process instance start is done using the business variable default value.
If you need to set the value of a business data later in the process execution you need to use operations (defined by selecting the task and going in “Execution” → “Operations” tab) to set the business variable attributes values.
You can take a look at the getting started tutorial, in the chapter about contract you can take a look at contract definition for the step Review and answer claim. When creating contract on a task, required operation to update the business variables are automatically generated for you.
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.