Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
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
https://www.ptc.com/appserver/cs/view/solution.jsp?n=144818
Any ideas would be appreciated.
Thx,
Steve D.
Probably a bit late for Stephen Drzewiczewski but for anyone else that runs into the same issue...
Solved (WC 10.2) by starting the expression with result = null as below