As you can see, the “Decision” userTask has Assignee and Candidate Group.
If the process leads from “Registration” to “Decision”, I want to assign the task, based on the Candidate Group field which was filled in the “Decision” before.
And if the process leads from “Edit” to “Decision”, I want to assign the task, based on the Assignee field which was filled in the “Decision” before.
I used the execution.setVariable("determinerID",""); script in the flow which connects Registration and Edit.
However, the process did not reach the “Decision” I expected.
Actually, I want, only the user who made the edit to be able to decide about the edited information and for other cases the “Decision” userTask to be assigned with its Candidate Group.
Just to understand it correctly: If a new instance is started and goes from registration to decision, you want to set the candidate group for the “decision” task in the task registration?
Currently you are using expression language in your form. This won’t work. You can basically set a variable in the form of the registration task
and then access the variable in the decision task using an Expression:
@Nele
I created “userGroup1” and “userGroup2” variables in the Registration userTask.
And everything is fine, before I add the execution.setVariable("determinerID",""); in that flow.
What is my mistake?
p.s: I checked the posted model again and realized I used “${userGroup1}” instead of userGroup1 in the “Registration”.
And then I corrected the mistakes and updated the model in post #1.
But the problem still exists.
(Actually, I followed the variable definition in my main model correctly. I drew the model in #1 post just for mentioning what I want. because the main model is super big and may cause some mistakes.)
If you declare and initialize a variable in a user task you don’t have to set the variable with script to the process scope. When the user task is completed by the user the variable and the value will be set to the process.
So if you declare a variable called “userGroup1” (variable id) and give it the value “Management” ( The field the person in the user task fills in.). If you then use an expression like #{userGroup1} in the next user task for the candidate Group , the expression access the value of that variable. So in the case described above it will be assigned to the group “Management”.