Use Case: When you submit data from a third-party system / when completing a task, you would want to set the variable name at the process level from within the modeler, and let the application always submit the same process variable name that represents the data from the form. (such as a json object.). Work around to date has been to submit the data with a variable that matches the activityId of the User Task.
Would be great if you could submit local variables as part of user task completion.
If for user task 1 we set approved=true what happens to the next user task, which has a gateway afterwards and flow is controlled with the same variable? Does it get automatically completed?
I see, this is going to complicate my code which calls REST API to complete the task. What if I add an event listener, which listens to Complete event and set the value to null or removes the variable, if the latter is possible?
There are different use cases depending on what you are tring to do, and the level of process variable documentation you want to keep. Example: you may want to keep each of the decisions for an easy audit trail. You could also append a JSON variable with multiple approval values, or you could null/delete your approval variable after each decision gateway using a script or delegate.
@nomadus the other thing you need to remember is: your use case seems to sound fairly simple, as in more complex examples you would be running into scenarios where you have multiple gateways that are triggering at varying times, and having a single “approval” variable is not tenable.