I'm trying to do a "Synchronize On: Object Event"
Windchill Object: wf variable promotionNotice that is grabbed from a number input from a user.
Event: STATE CHANGE
Initial Expression and Routing Expression are the same:
if (promotionNotice.getLifeCycleState().equals (wt.lifecycle.State.toState("APPROVED"))){
result="Approved";
} else if (promotionNotice.getLifeCycleState().equals (wt.lifecycle.State.toState("REJECTED"))){
result="Rejected";
} else {
result=null;
}
If the Promotion Notice is already at Approved or Rejected the code works, but if it's at a different state, say Under Review and eventually moves to Approved the Synch Robot does not fire.
I must be missing something.
Looking at the help example they have a line of code
wt.doc.WTDocument targetObject = (wt.doc.WTDocument) ((wt.events.KeyedEvent) event).getEventTarget();
But this is for a different type of Synch Robot according to
https://www.ptc.com/appserver/cs/view/solution.jsp?n=144818
Any ideas would be appreciated.
Thx,
Steve D.