Hi all,
I’m trying to design a process with nested multi instance process.
The process should browse the json example input, and for each user in the list, browse all le roles, and for each role wait for a message that update its status. When all the roles update messages for a user are receveid, i should wait for a message to update the user status.
example input :
[
{
"id":"user1",
"state":"created",
"roles":[{"id":"user1.role1","state":"created"}]
},
{
"id":"user2",
"state":"created",
"roles":[{"id":"user2.role1","state":"created"}]
},
{
"id":"user3",
"state":"created",
"roles":[{"id":"user3.role1","state":"created"},{"id":"user3.role2","state":"created"}]
}
]
At the end of the process, I should have a list of my users with their updated status and roles.
Actually, I have two multi instance process (one to loop for users and one to loop for roles per user)
My configuration :
When i run the process, and i send all the messages
I’m getting this result :
[
{"id":"user1","state":"validated","roles":[{"id":"user3.role1","state":"ACTIVATED"},{"id":"user3.role2","state":"ACTIVATED"}]},
{"id":"user2","state":"validated","roles":[{"id":"user3.role1","state":"ACTIVATED"},{"id":"user3.role2","state":"ACTIVATED"}]},
{"id":"user3","state":"validated","roles":[{"id":"user3.role1","state":"ACTIVATED"},{"id":"user3.role2","state":"ACTIVATED"}]}
]
The roles collection has been overrited with the last roles collection receceived from the Browse Role multi instance.
My Excepected result is :
[
{"id":"user1","state":"validated","roles":[{"id":"user1.role1","state":"ACTIVATED"}]},
{"id":"user2","state":"validated","roles":[{"id":"user2.role1","state":"ACTIVATED"}]},
{"id":"user3","state":"validated","roles":[{"id":"user3.role1","state":"ACTIVATED"},{"id":"user3.role2","state":"ACTIVATED"}]}
]
Thanks for your help !