ECR Process =================== primaryBusinessObject Analysis_Comments PR_Group approvalDate submitDate proposedSolution businessDecisionSummary AnalyzeClarify_Comments inInitialPhase ecrDescription ecrName ecrNumber ecrContainer =================== Set State Cancelled primaryBusinessObject aState =================== Set State Closed primaryBusinessObject aState =================== ECR Canceled subject message primaryBusinessObject =================== Set State Under Review primaryBusinessObject aState =================== Set State In Work primaryBusinessObject aState =================== ECR Rejected by Change Coordinator subject message primaryBusinessObject =================== ECR Closed subject message primaryBusinessObject =================== Set State Approved primaryBusinessObject aState =================== ECR Approved subject message primaryBusinessObject =================== Set PRAuthors primaryBusinessObject Analysis_Comments PR_Group approvalDate submitDate proposedSolution businessDecisionSummary AnalyzeClarify_Comments inInitialPhase ecrDescription ecrName ecrNumber ecrContainer _ROBOT_EXPRESSION_ String role=new String("wt.project.role.PR AUTHOR"); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECR((wt.change2.WTChangeRequest2)primaryBusinessObject,role); =================== Set Submit Date, etc. primaryBusinessObject Analysis_Comments PR_Group approvalDate submitDate proposedSolution businessDecisionSummary AnalyzeClarify_Comments inInitialPhase ecrDescription ecrName ecrNumber ecrContainer _ROBOT_EXPRESSION_ submitDate=new java.sql.Timestamp(System.currentTimeMillis()); ecrName = ((wt.change2.WTChangeRequest2)primaryBusinessObject).getName(); ecrNumber = ((wt.change2.WTChangeRequest2)primaryBusinessObject).getNumber(); ecrDescription = ((wt.change2.WTChangeRequest2)primaryBusinessObject).getDescription(); ecrContainer = ((wt.change2.WTChangeRequest2)primaryBusinessObject).getContainerName(); =================== Set PRAuthors primaryBusinessObject Analysis_Comments PR_Group approvalDate submitDate proposedSolution businessDecisionSummary AnalyzeClarify_Comments inInitialPhase ecrDescription ecrName ecrNumber ecrContainer _ROBOT_EXPRESSION_ String role=new String("wt.project.role.PR AUTHOR"); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECR((wt.change2.WTChangeRequest2)primaryBusinessObject,role); =================== Force PRs to Completion primaryBusinessObject Analysis_Comments PR_Group approvalDate submitDate proposedSolution businessDecisionSummary AnalyzeClarify_Comments inInitialPhase ecrDescription ecrName ecrNumber ecrContainer _ROBOT_EXPRESSION_ com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.forcePRsToResolved((wt.change2.WTChangeRequest2)primaryBusinessObject); =================== Set PRAuthors primaryBusinessObject Analysis_Comments PR_Group approvalDate submitDate proposedSolution businessDecisionSummary AnalyzeClarify_Comments inInitialPhase ecrDescription ecrName ecrNumber ecrContainer _ROBOT_EXPRESSION_ String role=new String("wt.project.role.PR AUTHOR"); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setRoleToECR((wt.change2.WTChangeRequest2)primaryBusinessObject,role); =================== Synch on ECO Completion primaryBusinessObject Analysis_Comments PR_Group approvalDate submitDate proposedSolution businessDecisionSummary AnalyzeClarify_Comments inInitialPhase ecrDescription ecrName ecrNumber ecrContainer _SYNCH_EXPRESSION_ // This code returns CLOSED if at least one Change Order is in state // "Closed" and the rest are in state "Closed" or "Cancelled". // It returns CANCELLED if all Change Orders are in state "Cancelled" or // NOT_FINISHED if at least one Change Order is pending // (i.e. has not reached either state "Closed" or "Cancelled"). wt.fc.QueryResult qResult = wt.change2.ChangeHelper2.service.getChangeOrders( (wt.change2.ChangeRequest2) primaryBusinessObject ); String result_value = "NO_SUBORDINATES"; while( qResult.hasMoreElements() ) { wt.fc.Persistable persistable = (wt.fc.Persistable) qResult.nextElement(); if( persistable instanceof wt.lifecycle.LifeCycleManaged ) { wt.lifecycle.LifeCycleManaged life_cycle_managed = (wt.lifecycle.LifeCycleManaged) persistable; if( life_cycle_managed.getLifeCycleState().equals(wt.lifecycle.State.toState("CLOSED")) ) { result_value = "CLOSED"; } else if( life_cycle_managed.getLifeCycleState().equals(wt.lifecycle.State.toState("CANCELLED")) ) { if( result_value == "NO_SUBORDINATES" || !result_value.equals("CLOSED") ) result_value = "CANCELLED"; } else { result_value = "NOT_FINISHED"; } } } if( result_value.equals("CLOSED") ) result = "Closed"; else if( result_value.equals("CANCELLED") ) result = "Cancelled"; else if( result_value.equals("NOT_FINISHED") ) result = null; _INITIAL_SYNCH_EXPRESSION_ System.out.println("DEBUG: ECO Process; Sync on ECO Completion, Initial expression"); =================== Submit Now primaryBusinessObject Analysis_Comments PR_Group approvalDate submitDate proposedSolution businessDecisionSummary AnalyzeClarify_Comments inInitialPhase ecrDescription ecrName ecrNumber ecrContainer _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; =================== CRB Review primaryBusinessObject approval_date Comments Clarification_Comments Change_Coordinator_Comments =================== Approve approval_date=new Timestamp(System.currentTimeMillis()); wt.session.SessionServerHelper.manager.setAccessEnforced( false ); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.processBusinessDecision((wt.change2.WTChangeRequest2)primaryBusinessObject,wt.change2.BusinessDecisionCategory.APPROVED, "COMPLEX", Comments); wt.session.SessionServerHelper.manager.setAccessEnforced( true ); =================== Submit ECR primaryBusinessObject approvalDate inInitialPhase =================== START result = inInitialPhase; =================== Clarify primaryBusinessObject Comments Change_Coordinator_Comments CRB_Comments =================== Create ECO primaryBusinessObject =================== Analyze ECR primaryBusinessObject Comments Clairification_Comments CRB_Comments =================== Fast_Track wt.session.SessionServerHelper.manager.setAccessEnforced( false ); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setTrack((wt.change2.WTChangeRequest2)primaryBusinessObject, "SIMPLE"); wt.session.SessionServerHelper.manager.setAccessEnforced( true ); =================== Full_Track wt.session.SessionServerHelper.manager.setAccessEnforced( false ); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setTrack((wt.change2.WTChangeRequest2)primaryBusinessObject, "COMPLEX"); wt.session.SessionServerHelper.manager.setAccessEnforced( true ); =================== Reject wt.session.SessionServerHelper.manager.setAccessEnforced( false ); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setTrack((wt.change2.WTChangeRequest2)primaryBusinessObject, "SIMPLE"); wt.session.SessionServerHelper.manager.setAccessEnforced( true ); =================== Verify ECR primaryBusinessObject Comments Clairification_Comments CRB_Comments =================== Reject wt.session.SessionServerHelper.manager.setAccessEnforced( false ); com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.setTrack((wt.change2.WTChangeRequest2)primaryBusinessObject, "SIMPLE"); wt.session.SessionServerHelper.manager.setAccessEnforced( true );