Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
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!
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?
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