The simplest solution is to set the two users (the Rep and the Local Admin) as the Candidate Users. In the UI they would then have a “inbox” and one of them can claim the task and complete the work.
Hi @StephenOTT.
I must explain some things about the following screenshot of my process diagram:
The 1st task form (Create a list of products) is submitted by 1 user (Central Admin).
This user creates a list of products which is a JSON Array.
On the submission of my 1st task form, this Array (products) is stored in a variable named myList
This variable (myList) is injected in another variable named (representatives) which is the created Array in my Script Task (Create Array).
This Array (representatives) is converted to a String variable named mySpin in order to be read by the server.
What I want to do here is to automatically assign 1 instance of the 2nd task form (Select from the list of products) to each one of the Representatives. By this way, every Representative will have to complete the same task form.
But my difficulty here is how Camunda engine understand who users are Representatives and who users are Local Administrators?
As I told you yesterday there are multiple Representatives and multiple Local Administrators in my process scenario. That is why I 've defined this task as a multi-instance.
The inline script of my Script Task
var myList = product
var representatives = {"myList" : myList}
var mySpin = S(JSON.stringify(representatives));
execution.setVariable('assignees', mySpin.prop('myList').elements());
Hope this makes sense
Thanks,
Steve
Hi @StephenOTT.
Based on our old discussion here, I tried to submit my task form but for some reason, I 'm always taking a server error like this: SPIN/JACKSON-JSON-01004 Unable to find ‘myList’
To be more specific, in my Script Task, “myList” is a defined variable in which I’ve saved a created (from the previous task form) JSON array.
My process diagram:
My server log file:
catalina.2018-09-04.log (68.2 KB)
Have you got any idea on this?
Thank you in advance,
Steve