Sequence flow according to user's group

Hi all,

I have a 4 user groups and in a process, I want to flow user to next task according to his group.

Or how can I check user’s group in a gateway and change sequence flow according to that?

Thanks in advance,
Sadegh

Hi Sadegh,

you can access the groups of the user (which is currently authenticated) via internal function currentUserGroups(). Depending on your use case, it’s better to set the groups as process variable on start and access the variable instead.

Does this help you?

Best regards,
Philipp

1 Like

Thanks for your reply,

But how I can check if the user has a specific group in currentUserGroups() list?

Below code cannot check this for me:
${currentUserGroups().indexOf("org_1") != -1}

And how can I set groups as process variable on start? because of the return type of currentUserGroups() that is List.

Best Regards,
Sadegh

Hi Sadegh.

It should be possible to check the groups with ${currentUserGroups().contains("org_1")}.
If this doesn’t work then maybe there are no authenticated user groups at the moment of the evaluation. In that case, you must store the groups as process variables. If the process is started by an authenticated user then you can use a script task or an execution listener that stores the variable.

Does this help you?

Best regards,
Philipp

1 Like