how to Dynamically assign user?

Hi,

I am trying to develop an business process application where I have to dynamically assign the user for his approval.

like
I have an example here when Finance manager believes it to be within budget and acceptable they pass it on to Legal manager for review. Depending on the type of contract, it may route to a different legal team and the process ends.

Can anyone please help me with this?

Solution

Hi Pratima,

You should define Groups in user management (using the Users eSpace), then based on the decision of the manager assign the task to one of the Groups (using the ActivitySetGroup action in the On Ready action of the Human Activity).

Solution

Hi Pratima,

When designing a process in OutSystems you can assign an activity to a specific user or users by using the "Human Activity" Node (User property and Roles). 

I invite you to check the official documentation for better understanding.

Regards,

António Pereira

Thanks a lot.Issue got resolved.

How about if I want to assign to more than 1 user but not a group.

The reviewer/approvers are based on the condition on the form.

Pratima Solanki wrote:

Thanks a lot.Issue got resolved.

Hi Pratima,

Can you share how to get your issue resolved?

As Ishak asked, can we assign to multiple users instead of a group?


Thanks



Tommy GU wrote:

Pratima Solanki wrote:

Thanks a lot.Issue got resolved.

Hi Pratima,

Can you share how to get your issue resolved?

As Ishak asked, can we assign to multiple users instead of a group?


Thanks



Hi Tommy,

Can you share your specific use case pls?


Regards,

António Pereira


Tommy GU wrote:

Pratima Solanki wrote:

Thanks a lot.Issue got resolved.

Hi Pratima,

Can you share how to get your issue resolved?

As Ishak asked, can we assign to multiple users instead of a group?


Thanks




You have two choices:

1. Make a group in code, give it some sort of temporary name, mark "Is_Active" to False so it doesn't appear anywhere, assign users to it by adding records to Group_User, assign the group to the activity. After the activity is finished, delete the temporary group.

2. Make a separate process for the per-user stuff that accepts a UserId as a parameter in addition to whatever else it needs to start the approval workflow. For each user you want to assign to this, launch an instance of the separate process. When the sub-process finishes, find all other sub-processes associated with this record and terminate them.

Choose #1 if your workflow is "I need one person and only one person from this group of users to perform the activity". Chose #2 if your workflow is "I need multiple people from this group to perform the activity, or I want all of them to see if even after one person has looked at it from their task box".

I've done it BOTH ways. #1 feels "gimmicky" and I don't like creating a fake system record, and I feel like the system should validate that a group is actually active when you assign it to an activity, this feels like a cheap hack. #2 is significantly more effort to develop and debug and the code is "indirect" because you have activities/processes being closed by "remote control" rather than direct code.

I will be giving a talk at NextStep in Denver about BPT and this topic will get a lot of attention during that talk.

J.Ja

Thanks J.Ja for so detail solution.

I know how to implement #1, but not very sure how to implement #2. 

When is your talk in Dener? Is it live video?


Thank you so much

Tommy