@@@@@@@@@@@@@@@@@ ECO Task Process @@@@@@@@@@@@@@@@@ START // Initialize the parentChangeRequest variable parentChangeOrder=com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.findChangeOrder( (wt.change2.WTChangeActivity2) primaryBusinessObject); ================= Set State Completed Set State Implementation Set State Under Review Set State Implementation Set State Implementation Set Resulting Items Under Review _ROBOT_EXPRESSION_ wt.fc.QueryResult qResult = wt.change2.ChangeHelper2.service.getChangeablesAfter( (wt.change2.ChangeActivity2)primaryBusinessObject ); wt.pom.Transaction trx = new wt.pom.Transaction(); trx.start(); try { 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; wt.lifecycle.LifeCycleHelper.service.setLifeCycleState(life_cycle_managed, wt.lifecycle.State.toState("UNDERREVIEW") ); } } trx.commit(); } catch( Exception e ) { if(trx != null) trx.rollback(); } ================= Set Resulting Items Cancelled _ROBOT_EXPRESSION_ wt.fc.QueryResult qResult = wt.change2.ChangeHelper2.service.getChangeablesAfter( (wt.change2.ChangeActivity2)primaryBusinessObject ); wt.pom.Transaction trx = new wt.pom.Transaction(); trx.start(); try { 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; wt.lifecycle.LifeCycleHelper.service.setLifeCycleState(life_cycle_managed, wt.lifecycle.State.toState("CANCELLED") ); } } trx.commit(); } catch( Exception e ) { if(trx != null) trx.rollback(); } ================= Set Resulting Items Released _ROBOT_EXPRESSION_ wt.fc.QueryResult qResult = wt.change2.ChangeHelper2.service.getChangeablesAfter( (wt.change2.ChangeActivity2)primaryBusinessObject ); wt.pom.Transaction trx = new wt.pom.Transaction(); trx.start(); try { 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; wt.lifecycle.LifeCycleHelper.service.setLifeCycleState(life_cycle_managed, wt.lifecycle.State.toState("RELEASED") ); } } trx.commit(); } catch( Exception e ) { if(trx != null) trx.rollback(); } ================= Set Resulting Items In Work _ROBOT_EXPRESSION_ wt.fc.QueryResult qResult = wt.change2.ChangeHelper2.service.getChangeablesAfter( (wt.change2.ChangeActivity2)primaryBusinessObject ); wt.pom.Transaction trx = new wt.pom.Transaction(); trx.start(); try { 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; wt.lifecycle.LifeCycleHelper.service.setLifeCycleState(life_cycle_managed, wt.lifecycle.State.toState("INWORK") ); } } trx.commit(); } catch( Exception e ) { if(trx != null) trx.rollback(); } ================= Sync on ECO _SYNCH_EXPRESSION_ // Determine the state of the parent change request and branch accordingly String state = com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.checkImplementation(parentChangeOrder); if( state.equals("CLOSED") ) result = "Closed"; else if( state.equals("CANCELLED") ) result = "Cancelled"; else if( state.equals("IMPLEMENTATION") ) result = "Implementation"; else result = null; ================= _INITIAL_SYNCH_EXPRESSION_ // Determine the state of the parent change request and branch accordingly String state = com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.checkImplementation(parentChangeOrder); if( state.equals("CLOSED") ) result = "Closed"; else if( state.equals("CANCELLED") ) result = "Cancelled"; else result = null; ================= Synch on ECO Implementation _SYNCH_EXPRESSION_ // Determine the state of the parent change request and branch accordingly String state = com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.checkImplementation(parentChangeOrder); if (state.equals(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.IMPLEMENTATION)) result = "Go"; else result = null; ================= _INITIAL_SYNCH_EXPRESSION_ // Determine the state of the parent change request and branch accordingly String state = com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.checkImplementation(parentChangeOrder); if (state.equals(com.ptc.windchill.pdmlink.change.server.impl.WorkflowProcessHelper.IMPLEMENTATION)) result = "Go"; else result = null; ================= Submit Task for Rework Finalize ECO Review Task Rework ECO Task Complete ECO Task Review ECO Task