cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Sync Robot Syntax? (WC 9)

sdrzewiczewski
7-Bedrock

Sync Robot Syntax? (WC 9)

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.

1 REPLY 1

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

SyncBot.jpg

Top Tags