Skip to main content
14-Alexandrite
December 8, 2022
Question

About Using Participant İn Workflow

  • December 8, 2022
  • 2 replies
  • 2178 views

hello, I have a workflow and in this workflow, the flow goes to different parts according to the values ​​in the global enumeration in the attribute in a particular layout. In fact, I make users choose a section, and as a result, the flow progresses according to the selected section.

 

onur_0-1670506923155.png

onur_2-1670507122475.png

 

onur_1-1670506987958.png

 

 

 

The problem is that I do this for each partition and I have 30 partitions in total. which means task and etc required for 30 sections.

How should I use something here so that the participant I selected directly finds the role or group in the enumeration?

2 replies

avillanueva
23-Emerald I
23-Emerald I
December 8, 2022

Can you explain better? I loathe these fanned workflows for this reason. What happens in each sub-workflow block you show there?

14-Alexandrite
December 13, 2022

Hello avillanueva,
sorry for my late reply,

there is only task inside the blocks. I'm sending a task to a user whose name I just specified. For example "tanker silo manager".

 

onur_0-1670913217464.png

onur_0-1670913398743.png

 

 

 

 

16-Pearl
December 13, 2022

Maybe it would be cleaner the write an expression to add the group into the role, instead of all those blocks.

 

// find the team for this wf
wt.team.Team team = (wt.team.Team) ((wt.workflow.engine.WfProcess) self.getObject()).getTeamId().getObject();

wt.org.WTPrincipal wtprincipaltoadd = //the principal to add into the role

// remove everyone/anyone else from the role
java.util.Enumeration principals = team.getPrincipalTarget(wt.project.Role.toRole("SUBMITTER")); // the role KEY = SUBMMITER

while(principals.hasMoreElements())
{
	wt.org.WTPrincipalReference principalRef = (wt.org.WTPrincipalReference)principals.nextElement();
	wt.org.WTPrincipal wtprincipal = principalRef.getPrincipal();
	wt.team.TeamHelper.service.deleteRolePrincipalMap(wt.project.Role.toRole("SUBMITTER"), wtprincipal, team ); 
}

// add principal to the SUBMITTER role
wt.team.TeamHelper.service.addRolePrincipalMap(wt.project.Role.toRole("SUBMITTER"), wtprincipaltoadd, team);

 

14-Alexandrite
December 13, 2022

What does submitter do? 

I can direct the flow according to the section selections entered by the users, but when I want to send the tasks to the necessary people, I have to choose a separate participant for each section, which intensifies the flow. Is there any way I can do this problem in a single domain?

I can select participants according to the section selected below, but I need to create another one for a different section.

onur_0-1670938466295.png

 

16-Pearl
December 13, 2022

In my case the Submitter is the Role name for the user who submitted something for a review.

You can assign the task to always the same Role, the expression I shared above shows how to add a principal into the Role.