IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing business processes > Building business state machines > Create a business state machine > Adding a transition to a business state machine
Adding a condition to a transition
A condition guards a transition, and will only allow movement to the next state when and if the condition evaluates to "True".
If an exception occurs while processing a condition, the exception is ignored, and the condition for the next triggered transition, if any, is checked.
If a state defines more than one transition that uses the same triggering event, then all of those transitions must define guard conditions. More to the point, if a state defines an outbound, unguarded transition, then that state cannot have any other outbound transitions that use the same triggering event. If the triggering event is the completion event, then the state cannot have any other outbound transitions at all. The one exception to this rule is for composite states, which can both define a default transition and also define exception transitions.
The visual or Java™ code should not change the value of variables. Any such changes will be ignored (the variables will have the same values before and after the condition is evaluated). To add a condition to a transition, proceed as follows:
Procedure
- On the canvas, select and hover over the transition that you want to modify.
- In the action bar that appears, click the condition icon as shown in this image.
![]()
- In the Properties area, click the Details tab.
- Select the Implementation. You have the following choices:
Option Description Visual Choose this to use the visual snippet editor to graphically compose Java code. Java Choose this to write the Java code yourself. Invoke Choose this to invoke an operation on a reference that will return a boolean. - If you would like to have the condition evaluate for "False" instead of "True", select the Invert result check box.
Results
Your newly created condition will appear on the canvas on top of the transition that it is associated with.