Basic Administration > Supporting Collaboration > Workflow Administration > Workflow Tools > Workflow Template Administration > Workflow Code Samples > Transition Samples > Transition to Set State
  
Transition to Set State
This is a basic example of using a Java expression under the Transitions tab in the activity properties.
The expression sets the state of the primary business object. This functionality is identical to what can be accomplished using a Set State method robot. However, if you have a complex workflow, using a transition expression instead of a robot node can help simplify the template interface.
Example
From the Transitions tab, select the appropriate transition (typically the Complete transition). Enter the following Java expression:
wt.lifecycle.LifeCycleServerHelper.service.setState((wt.lifecycle.LifeCycleManaged)primaryBusinessObject, wt.lifecycle.State.toState( "RELEASED"));
This moves the primary business object to the Released state.