cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Include new participants after the workflow has started.

ptc-4896214
7-Bedrock

Include new participants after the workflow has started.

Hi!

I have a workflow starts, it opens a task for a role.

But I have been asked to include new participants after the workflow has started.

For new entrants to access the task we perform Reassign Life Cycle in documents that have already initiated the workflow.

Does anyone know another way to do this?

Thanks!

6 REPLIES 6

If the first (or any) task is of the type "setup participants" configured in the workflow template, then that user can select users for each Role. If you're using ProjectLink Route, then the existing Route can be edited to add more users.

Hi Mike,

Need to do this in PDMLink.

I suppose that's possible through an expression.

I tested the option of ProjectLink Route, but it still fails.

Thanks!

Team team = TeamHelper.service.getTeam(self.getObject());

team.addPrincipal(Role, WTPrincipal);

How and where would this this little snippet of code be utilised?

As an aside, adding participants to currently running workflows was a doddle in WC8, there used to be an "Update Team" facility. I take it that this is no longer possible in WC10?

update_team.JPG

In expression robot. You can add this robot before your task/

Sorry, but I have no any experience in WC8.

UPD: You can modify your role (context team) before task init. Or you can add the task2 before the task where somebody will modify your role (use appropriate task template).

Hi Guys,

I'm doing some tests for this functionality, but I could not move. For I can not call the method activity.getParentProcess().

Any idea how I can fix?

Thanks!

public class TestAddUser {

public static void main(String[] args) throws RemoteException, InvocationTargetException {

ObjectIdentifier obid;

ObjectIdentifier obidSelf;

ObjectReference self;

WTUser user = null;

Team team = null;

WfProcess process = null;

try {

obid = ObjectIdentifier.newObjectIdentifier("wt.workflow.work.WfAssignedActivity:510292536");

WfAssignedActivity activity = (WfAssignedActivity) PersistenceHelper.manager.refresh(obid);

user = OrganizationServicesHelper.manager.getAuthenticatedUser("doc");

obidSelf = ObjectIdentifier.newObjectIdentifier("wt.workflow.engine.WfProcess:510289896");

System.out.println("obidSelf: "+obidSelf);

self = (ObjectReference.newObjectReference(PersistenceHelper.manager.refresh(obidSelf)));

process = ((WfProcess) self.getObject());

team= (Team) process.getTeamId().getObject();

System.out.println("Team = "+team);

System.out.println("User = "+user);

System.out.println("Activity = "+activity.getName());

TeamHelper.service.addRolePrincipalMap(Role.toRole("CLIENTE"), user, team);

WorkflowHelper.service.doDynamicUpdate(activity.getParentProcess());

} catch (Exception e) {

e.printStackTrace();

}

}

}

WARNING: The ManagerService is not initialized! This can be caused by:

1) Attempting to invoke a server only method from a remote client

2) Attempting to invoke a method on a service from the constructor or static initializer of another service

Exception in thread "main" java.lang.ExceptionInInitializerError

at wt.workflow.engine.WfActivity.getParentProcess(WfActivity.java:778)

at com.anderson.testes.TesteAddUser.main(TesteAddUser.java:50)

Caused by: java.lang.NullPointerException

at wt.session.SessionServerHelper.<clinit>(SessionServerHelper.java:40)

... 2 more

Announcements


Top Tags