I'm working with GeneXus and I'm developing a business process diagram for GXFlow. I need that the user can select the owner of the next task. I can retrieve the list of the users of the specific role with this code:
&WorkflowServer.Connect('WFADMINISTRATOR','WFADMINISTRATOR')
&WorkflowOrganizationalModel = &WorkflowServer.GetOrganizationalModel()
&WorkflowFilter.Role = &WorkflowOrganizationalModel.GetRoleByName('RoleName')
&WorkflowUsers = &WorkflowOrganizationalModel.ListUsers(&WorkflowFilter)
//Adding users to a combobox
For &WorkflowUser in &WorkflowUsers
&users.AddItem( &WorkflowUser.Id.ToString(),&WorkflowUser.Name)
EndFor
In this case a user can select the owner of the next task from a combobox. How I can set the selected user as owner of the next task?
I found the best solution for my question. I hope it can be useful also for you:
You can save the selected user in a relevant data variable. In the target task properties you can change the property "Assign from a user in a relevant data" and assign the previous created variable to it.
This works good for me.