Haifisch7734

WF

Feb 16th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. String ecnOID = "VR:wt.change2.WTChangeOrder2:" + parentChangeOrder.getBranchIdentifier();
  2. wt.workflow.engine.WfProcess ecnProcess = com.eads.pzl.coversheet.reportservice.KartaZmianDocumentHelper.kzdService.getWfProcessByECNOID(ecnOID);
  3. wt.workflow.engine.WfProcess taskProcess = (wt.workflow.engine.WfProcess) self.getObject();
  4. wt.project.Role inzProduktu = null;
  5.  
  6.  
  7. java.util.Enumeration taskRoles = taskProcess.getRoles();
  8. System.out.println("$%$%$%$%$%$%$%%$%$%$%$%$%$%$");
  9. while (taskRoles.hasMoreElements()) {
  10.     wt.project.Role role = (wt.project.Role) taskRoles.nextElement();
  11.     if (role.toString().equals("CONFIGURATION MANAGER")) {
  12.         inzProduktu = role;
  13.     }
  14. }
  15.  
  16. if (inzProduktu != null) {
  17.     java.util.Enumeration roles = ecnProcess.getRoles();
  18.     System.out.println("$%$%$%$%$%$%$%%$%$%$%$%$%$%$");
  19.     while (roles.hasMoreElements()) {
  20.         wt.project.Role role = (wt.project.Role) roles.nextElement();
  21.         System.out.println(role);
  22.         if (role.toString().equals("CONFIGURATION MANAGER")) {
  23.             java.util.Enumeration princps = ecnProcess.getPrincipals(role);
  24.             while (princps.hasMoreElements()) {
  25.                 wt.org.WTPrincipalReference princp = (wt.org.WTPrincipalReference) princps.nextElement();
  26.                 wt.org.WTPrincipal pal = (wt.org.WTPrincipal) princp.getObject();
  27.                 System.out.println("Role " + inzProduktu);
  28.                 System.out.println("RoleKey " + inzProduktu.toString());
  29.                 System.out.println("Map " + taskProcess.rolePrincipalMapAsString());
  30.                 System.out.println("Principal " + pal);
  31.                 System.out.println("TaskProcess " + taskProcess);
  32.                 taskProcess.addPrincipal(inzProduktu, pal);
  33.             }
  34.         }
  35.     }
  36. }
  37.  
  38. System.out.println("$%$%$%$%$%$%$%%$%$%$%$%$%$%$");
Advertisement
Add Comment
Please, Sign In to add comment