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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

On a Synching Ship.....

Cosmo
1-Visitor

On a Synching Ship.....


I'm not a java guru....but I'm working on some workflow stuff and I'm trying to set up a synchronization robot. I've taken the workflow training and there's an example of creating a robot. The robot in the example sends a notification when an object has a change in its state....great....almost what I want but not quite. I'm looking for a way to send a notification when the object has a very specific state (like "DEFINITION_REQUIRED"). Does anyone have a good example of the syntax to do this?
I'm winging it a bit here but.....
I've tried:if (((wt.lifecycle.LifeCycleManaged)primaryBusinessObject).getLifeCycleState()==DEFINITION_REQUIRED);result="Assign Task";
and I've tried:if (((wt.lifecycle.LifeCycleManaged)primaryBusinessObject).getLifeCycleState()==wt.lifecycle.State.DEFINITION_REQUIRED);result="Assign Task";

But when I select the CHECK SYNTAX button, I receive the message below which means nothing to me.....I just stare it hoping that I'll see the hidden message in there like one of those 3-D pictures.....and Yes....DEFINITION_REQUIRED is a valid life cycle state already.
Checking Syntax...D:\ptc\Windchill\temp\WfExpression35839124.java:30: cannot find symbolsymbol : variable DEFINITION_REQUIREDlocation: class wt.lifecycle.Stateif (((wt.lifecycle.LifeCycleManaged)primaryBusinessObject).getLifeCycleState()==wt.lifecycle.State.DEFINITION_REQUIRED); ^D:\ptc\Windchill\temp\WfExpression35839124.java:65: cannot find symbolsymbol : variable DEFINITION_REQUIREDlocation: class wt.workflow.expr.WfExpression35839124if (((wt.lifecycle.LifeCycleManaged)primaryBusinessObject).getLifeCycleState()==DEFINITION_REQUIRED); ^2 errorsSyntax check complete.

Mike -

2 REPLIES 2
bfrandsen
10-Marble
(To:Cosmo)

Try this code:

if(((wt.lifecycle.LifeCycleManaged) obj).getLifeCycleState().equals(wt.lifecycle.State.DEFINITION_REQUIRED))
result="Assign Task";
Remember to remove the semicolon after your if-statement. Otherwise it does nothing...

In Reply to Michael Kramer:


I'm not a java guru....but I'm working on some workflow stuff and I'm trying to set up a synchronization robot. I've taken the workflow training and there's an example of creating a robot. The robot in the example sends a notification when an object has a change in its state....great....almost what I want but not quite. I'm looking for a way to send a notification when the object has a very specific state (like "DEFINITION_REQUIRED"). Does anyone have a good example of the syntax to do this?
I'm winging it a bit here but.....
I've tried:if (((wt.lifecycle.LifeCycleManaged)primaryBusinessObject).getLifeCycleState()==DEFINITION_REQUIRED);result="Assign Task";
and I've tried:if (((wt.lifecycle.LifeCycleManaged)primaryBusinessObject).getLifeCycleState()==wt.lifecycle.State.DEFINITION_REQUIRED);result="Assign Task";

But when I select the CHECK SYNTAX button, I receive the message below which means nothing to me.....I just stare it hoping that I'll see the hidden message in there like one of those 3-D pictures.....and Yes....DEFINITION_REQUIRED is a valid life cycle state already.
Checking Syntax...D:\ptc\Windchill\temp\WfExpression35839124.java:30: cannot find symbolsymbol : variable DEFINITION_REQUIREDlocation: class wt.lifecycle.Stateif (((wt.lifecycle.LifeCycleManaged)primaryBusinessObject).getLifeCycleState()==wt.lifecycle.State.DEFINITION_REQUIRED); ^D:\ptc\Windchill\temp\WfExpression35839124.java:65: cannot find symbolsymbol : variable DEFINITION_REQUIREDlocation: class wt.workflow.expr.WfExpression35839124if (((wt.lifecycle.LifeCycleManaged)primaryBusinessObject).getLifeCycleState()==DEFINITION_REQUIRED); ^2 errorsSyntax check complete.

Mike -



Bjarne Frandsen

(Pro/ENGINEER Wildfire 4.0 M092andWindchill 9.1M020 on Windows)

try this:

wt.lifecycle.State.toState("DEFINITION_REQUIRED")

wt.lifecycle.State.DEFINITION_REQUIRED does not exist.

br
Frederik

Announcements


Top Tags