Form data not passed to business variable
My process have a simple business object / variable. I have created a simple script that returns the new instance with the default values for the mandatory fields.
I have created an instantiation form with a simple text field, according to the contract defined for the instantiation step (object.attribute), but the value is never passed to the business variable. It's like the variables is instantiated AFTER the form as been invoked and submitted.
If I take a loot at the database, I see the default data returned in my script.
This problem doesn't happen in other steps of the process. I assume it's because the operations assignations happen at the right time, after data from the form has been returned. But the instantiation form doesn't have this item.
What can I do to pass data from the instantiation form to the business variable?
You are right, the business variable is instantiated and initialized after the form submission.
Here is the succession of task, let's take an example with a String variable called "Test":
- Instantiation form contains one input field mapped to a JS variable called Test
- User enter "hey" in the input field and submit the form. The variable Test is sent to the engine.
- There is a contract defined on the process with one input called Test
- The form submission match with the contract and fill in the contract value Test with the value "Hey"
- The business variables are instantiated and initialized by the value returned in their default script.
See the succession of task. You can use the contract value in the default script of the business variable.