Copy of Change Notice Workflow primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable Set State Implementation primaryBusinessObject aState Set State Under Review primaryBusinessObject aState Change Notice Submitted subject message primaryBusinessObject Set State Released primaryBusinessObject aState Set State Resolved primaryBusinessObject aState Change Notice Rejected subject message primaryBusinessObject Change Notice Complete Notification subject message primaryBusinessObject Set State Cancelled primaryBusinessObject aState Change Notice Approved subject message primaryBusinessObject Set ECRAuthors primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _ROBOT_EXPRESSION_ String role=new String("wt.project.role.ECR AUTHOR"); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECN((wt.change2.WTChangeOrder2)primaryBusinessObject,role); Set ECRAuthors primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _ROBOT_EXPRESSION_ String role=new String("wt.project.role.ECR AUTHOR"); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECN((wt.change2.WTChangeOrder2)primaryBusinessObject,role); role=new String("wt.project.role.PR AUTHOR"); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECN((wt.change2.WTChangeOrder2)primaryBusinessObject,role); Set CAI and CAII primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _ROBOT_EXPRESSION_ java.lang.String role="wt.project.role.CHANGE ADMINISTRATOR I"; com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECN((wt.change2.WTChangeOrder2)primaryBusinessObject, role); role="wt.project.role.CHANGE ADMINISTRATOR II"; com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECN((wt.change2.WTChangeOrder2)primaryBusinessObject, role); Set Changeables to Released primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _ROBOT_EXPRESSION_ com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.promoteChangeables((wt.change2.WTChangeOrder2)primaryBusinessObject); Set Change Notice Resolution Date primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _ROBOT_EXPRESSION_ com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setECNResolutionDate((wt.change2.WTChangeOrder2)primaryBusinessObject); Set ECRAuthors primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _ROBOT_EXPRESSION_ String role=new String("wt.project.role.ECR AUTHOR"); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECN((wt.change2.WTChangeOrder2)primaryBusinessObject,role); Set Submit Date primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _ROBOT_EXPRESSION_ submitDate=new Timestamp(System.currentTimeMillis()); Set Unpromotable primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _ROBOT_EXPRESSION_ wt.fc.collections.WTHashSet unpromChanges = (wt.fc.collections.WTHashSet) com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.getUnpromotableChangeables((wt.change2.WTChangeOrder2)primaryBusinessObject); java.util.Iterator i = unpromChanges.persistableIterator(); wt.enterprise.RevisionControlled p = null; String unpromotables = ""; if (i.hasNext()){ p = (wt.enterprise.RevisionControlled)i.next(); unpromotables = unpromotables + p.getDisplayIdentity(); } while (i.hasNext()){ p = (wt.enterprise.RevisionControlled)i.next(); unpromotables = unpromotables + "; " + p.getDisplayIdentity(); } if (unpromotables.length()!=0){ unpromotable = "- The following Resulting Data will not be promoted because there is no change transition defined: \n"; java.util.StringTokenizer s = new java.util.StringTokenizer( unpromotables, ";" ); while (s.hasMoreTokens()){ unpromotable += "- - " + s.nextToken() + "\n"; } unpromotable += "\n There are two ways to resolve the issue: \n 1. If you did not intend to promote the resulting data, then simply complete the task. \n 2. If you did intend to promote the resulting data, there may be a problem with the configuration of lifecycle templates. Select the Rework option and enter comments for Change Administrator II."; unpromotable += ""; } Submit Now primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _SYNCH_EXPRESSION_ // Continue if the primaryBusinessObject has progressed past the initial state inInitialPhase =wt.lifecycle.LifeCycleHelper.service.isInInitialPhase((wt.lifecycle.LifeCycleManaged)primaryBusinessObject) ; if (inInitialPhase != true) result = "Go"; else result = null; _INITIAL_SYNCH_EXPRESSION_ // Continue if the primaryBusinessObject has progressed past the initial state inInitialPhase =wt.lifecycle.LifeCycleHelper.service.isInInitialPhase((wt.lifecycle.LifeCycleManaged)primaryBusinessObject) ; if (inInitialPhase != true) result = "Go"; else result = null; Synch on CA Complete primaryBusinessObject cibComments auditComments submitDate approvalDate fastTrack amendComments inInitialPhase unpromotable _SYNCH_EXPRESSION_ // "Complete" and the rest are in state "Complete" or "Cancel." // It returns ProcessHelper.CANCELLED if all Change Orders are in state "Cancelled" or // ProcessHelper.NOT_FINISHED if at least one Change Order is pending // (i.e. has not reached either state "Complete" or "Cancelled"). String checkActivitiesFinished = null; checkActivitiesFinished = com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.checkActivitiesFinished((wt.change2.WTChangeOrder2)primaryBusinessObject); if (checkActivitiesFinished.equals(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.RESOLVED)) result = "Resolved"; else if (checkActivitiesFinished.equals(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.CANCELLED)) result = "Cancelled"; else if (checkActivitiesFinished.equals(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.NOT_FINISHED)) result = null; _INITIAL_SYNCH_EXPRESSION_ // "Complete" and the rest are in state "Complete" or "Cancel." // It returns ProcessHelper.CANCELLED if all Change Orders are in state "Cancelled" or // ProcessHelper.NOT_FINISHED if at least one Change Order is pending // (i.e. has not reached either state "Complete" or "Cancelled"). String checkActivitiesFinished = null; checkActivitiesFinished = com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.checkActivitiesFinished((wt.change2.WTChangeOrder2)primaryBusinessObject); if (checkActivitiesFinished.equals(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.RESOLVED)) result = "Resolved"; else if (checkActivitiesFinished.equals(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.CANCELLED)) result = "Cancelled"; else if (checkActivitiesFinished.equals(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.NOT_FINISHED)) result = null; Submit Change Notice primaryBusinessObject inInitialPhase START result = inInitialPhase; Audit Change Notice primaryBusinessObject Comments Unpromotables Rework Change Notice Task primaryBusinessObject Comments unpromotable2 COMPLETE wt.fc.collections.WTHashSet unpromChanges = (wt.fc.collections.WTHashSet) com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.getUnpromotableChangeables((wt.change2.WTChangeOrder2)primaryBusinessObject); java.util.Iterator i = unpromChanges.persistableIterator(); wt.enterprise.RevisionControlled p = null; String unpromotable1=""; if (i.hasNext()){ p = (wt.enterprise.RevisionControlled)i.next(); unpromotable1 = unpromotable1 + p.getName(); } while (i.hasNext()){ p = (wt.enterprise.RevisionControlled)i.next(); unpromotable1 = unpromotable1 + "; " + p.getName(); } if (unpromotable1.length()!=0){ unpromotable2 = "- The following Resulting Data will not be promoted because there is no change transition defined: \n"; java.util.StringTokenizer s = new java.util.StringTokenizer( unpromotable1, ";" ); while (s.hasMoreTokens()){ unpromotable2 += "- - " + s.nextToken() + "\n"; } unpromotable2 += "\n There are two ways to resolve the issue: \n 1. If you did not intend to promote the resulting data, then simply complete the task. \n 2. If you did intend to promote the resulting data, there may be a problem with the configuration of lifecycle templates. Select the Rework option and enter comments for Change Administrator II."; unpromotable2 += ""; } Amend Change Notice Plan primaryBusinessObject Comments Schedule CIB Review primaryBusinessObject approval_date Comments Approve approval_date=new Timestamp(System.currentTimeMillis());