Get Lifecycle State
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Get Lifecycle State
In one of my workflows I'm setting the lifecycle state of an object. I've already done some validation that the object's lifecycle template had the target state in it.
I only want to set the state, if the object is not at that target state. Does anybody have a snippet to show me how to get the current state? I'm not seeing what I need in the javadoc, but i'm probably looking in the wrong place.
Thanks,
Steve D.
- Labels:
-
Other
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
>
> In one of my workflows I'm setting the lifecycle state of an object. I've already done some validation that the object's lifecycle template had the target state in it.
>
> I only want to set the state, if the object is not at that target state. Does anybody have a snippet to show me how to get the current state?
>
For an epmDocument:
epmDocument epmDoc;
String state = epmDoc.getLifeCycleState().toString();
> I'm not seeing what I need in the javadoc, but i'm probably looking in the wrong place.
>
> Thanks,
> Steve D.
>
>
> ----------
--
------------------------------------------------------------------------
Randy Jones
Systems Administrator
Great Plains Mfg., Inc.
1525 E North St
PO Box 5060
Salina, KS USA 67401
email: -
Phone: 785-823-3276
Fax: 785-667-2695
------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Steve,
Try this. It should be bomb-proof andwill work for any object type
if (<your object=" here="> instanceof wt.lifecycle.LifeCycleManaged) {
String currentState = ((wt.lifecycle.LifeCycleManaged) <your object=" here=">).getState().toString();
}
FYI You don't have to cast your object to LifeCycleManaged in the second line. If it's an instance on LifeCycleManaged it can already do anything a LifeCycleManaged object can do. I added the cast only for clarity.
Hope this helps
Dave
In Reply to Stephen Drzewiczewski:
In one of my workflows I'm setting the lifecycle state of an object. I've already done some validation that the object's lifecycle template had the target state in it.
I only want to set the state, if the object is not at that target state. Does anybody have a snippet to show me how to get the current state? I'm not seeing what I need in the javadoc, but i'm probably looking in the wrong place.
Thanks,
Steve D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It's the getState() method on the objects themselves (WTPart, WTDocument).
Thanks,
Jason Schrader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks,
Jason Schrader
