Users assigned to tasks. How to assign different roles in different tasks for the same user?

I have a Tasks entity, I use it to create a list of tasks. This entity is associated with the System Account entity, this way I can assign users to tasks.  When a user is assigned to the task, he has is also assigned to some role in this task. How can I implement it so, that one user could be assigned to several tasks and have different roles in each task? I can store roles in the enumerator parameter. But if I store it in the account entity, the role won’t be associated with a task. And if I store it in the Task entity, it’s not associated with the user.
1 answers

Create a roles entity that contains the different roles as data.

Associate the roles to the user so that a user can have multiple roles.

Associate the roles to the tasks so that a task can have 1 role.

Associate the user to the task by selection in a reference selector and select the role via a second reference selector. Make sure the selectable objects source is xpath and constrain the data via the path that includes the user. This way the associated user’s roles are the only ones that can be selected. See