Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.conversation
Interface CpStateTransition

All Known Implementing Classes:
  BasicCpStateTransition

public interface CpStateTransition

The CpStateTransition interface represents a transition in a CPStateMachine.

There are three types of transition:

- send-message: A transition taken when a message is sent by one of the partipants in the conversation.
- child-return A transition taken when a child conversation policy has terminated.
- timeout A transition taken when a state-timer has expired.

Connectivity constraints: There are constraints on the way in which states and transitions are connected together, as follows:

- A normal state may not have child-return transitions.
- An in-child state may not have send-message transitions.
- A terminal state may not have any transitions.
- A state with a timeout must have exactly one timeout transition.
- A state with no timeout may not have a timeout transition.

This is a single fat interface for all transition types. It was done this way, rather than as a base interface and three sub-interfaces, because of the relative simplicity of the transition's API.

Field Summary
`static int` | `CHILD_RETURN` The transition type for child-return transitions.
`static int` | `NO_TYPE` The transition type for transitions whose type has not been set.
`static int` | `SEND_MESSAGE` The transition type for send-message transitions.
`static int` | `TIMEOUT` The transition type for timeout transitions.
`static java.lang.String[]` | `TYPE_STRINGS` Strings for each of the transition types.

Method Summary
`java.lang.String` | `getChildReturn()` Returns the child-return code.
`MessageDescription` | `getMessageDescription()` Returns the MessageDescription for the message associated with this transition.
`java.lang.String` | `getName()` Returns the transition's name.
`java.lang.String` | `getSenderRole()` Returns the role that is the message sender.
`java.lang.String` | `getSourceName()` Returns the name of the transition's source state.
`java.lang.String` | `getTargetName()` Returns the name of the transition's target (or destination) state.
`int` | `getType()` Return the transition's type.
`int` | `getTypeFromString(java.lang.String str)` Returns the transition type matching the given string.
`java.lang.String` | `getTypeString()` Returns a string corresponding to the transition's type.
`boolean` | `setChildReturn(java.lang.String newReturn)` Sets the child-return code.
`boolean` | `setMessageDescription(MessageDescription desc)` Sets the MessageDescription for the message associated with this transition.
`void` | `setName(java.lang.String newName)` Sets the transition's name.
`boolean` | `setSenderRole(java.lang.String newRole)` Sets the role that sends the message.
`void` | `setSourceName(java.lang.String newName)` Sets the name of the transition's source state.
`void` | `setTargetName(java.lang.String newName)` Sets the name of the transition's target state.

Field Detail

### NO_TYPE

    public static final int NO_TYPE

  The transition type for transitions whose type has not been set.

  See Also:
    Constant Field Values

### SEND_MESSAGE

    public static final int SEND_MESSAGE

  The transition type for send-message transitions.

  See Also:
    Constant Field Values

### CHILD_RETURN

    public static final int CHILD_RETURN

  The transition type for child-return transitions.

  See Also:
    Constant Field Values

### TIMEOUT

    public static final int TIMEOUT

  The transition type for timeout transitions.

  See Also:
    Constant Field Values

### TYPE_STRINGS

    public static final java.lang.String[] TYPE_STRINGS

  Strings for each of the transition types. In order, these correspond to types {NO_TYPE, SEND_MESSAGE, CHILD_RETURN, TIMEOUT}.

  This is public as a side-effect of the design, but the values shouldn't be accessed directly. Use `getTypeString()` or `getTypeFromString()` instead.

Method Detail

### getType

    public int getType()

  Return the transition's type.

  Returns:
    The transition's type. The value will be one of: {NO_TYPE, SEND_MESSAGE, CHILD_RETURN, TIMEOUT}.

### getTypeString

    public java.lang.String getTypeString()

  Returns a string corresponding to the transition's type.

  Returns:
    The string giving the transition's type.

### getTypeFromString

    public int getTypeFromString(java.lang.String str)

  Returns the transition type matching the given string.

  Does not change this transition's type. (This method would be static, if static methods were allowed for interfaces.)

  Parameters:
    `str` - The string for the transition type.
  Returns:
    The transition type correponding to the given string. If no match was found, returns NO_TYPE.

### getName

    public java.lang.String getName()

  Returns the transition's name.

  Returns:
    The transition's name.

### setName

    public void setName(java.lang.String newName)

  Sets the transition's name.

  Parameters:
    `newName` - The new name.

### getSourceName

    public java.lang.String getSourceName()

  Returns the name of the transition's source state.

  Returns:
    The name of the transition's source state, or `null` if there isn't one.

### setSourceName

    public void setSourceName(java.lang.String newName)

  Sets the name of the transition's source state.

  This does not modify the source state itself, only the name stored in this transition. Therefore it should be used only in conjunction with calls to the `CpState` API to remove this transition from the old source state and add it to the new source state

  Parameters:
    `newName` - The new source state name.

### getTargetName

    public java.lang.String getTargetName()

  Returns the name of the transition's target (or destination) state.

  Returns:
    The name of the transition's target state, or `null` if there isn't one.

### setTargetName

    public void setTargetName(java.lang.String newName)

  Sets the name of the transition's target state.

  This does not modify the target state itself, only the name stored in this transition. Therefore it should be used only in conjunction with calls to the `CpState` API to remove this transition from the old target state and add it to the new target state.

  Parameters:
    `newName` - The new target state name.

### getMessageDescription

    public MessageDescription getMessageDescription()

  Returns the MessageDescription for the message associated with this transition.

  This is meaningful only for send-message transitions.

  Returns:
    The MessageDescription for this transitions's message, or `null` if there isn't one.

### setMessageDescription

    public boolean setMessageDescription(MessageDescription desc)

  Sets the MessageDescription for the message associated with this transition.

  This is meaningful only for send-message transitions.

  Parameters:
    `desc` - The MessageDescription for this transitions's message.
  Returns:
    true if this transition is a send-message transition, false if not.

### getSenderRole

    public java.lang.String getSenderRole()

  Returns the role that is the message sender.

  This is meaningful only for send-message transitions.

  Returns:
    The role that sends the message, or `null` if undefined.

### setSenderRole

    public boolean setSenderRole(java.lang.String newRole)

  Sets the role that sends the message.

  This is meaningful only for send-message transitions.

  Parameters:
    `newRole` - the role that sends the mesage.
  Returns:
    true if this transition is a send-message transition, false if not.

### getChildReturn

    public java.lang.String getChildReturn()

  Returns the child-return code.

  This is meaningful only for child-return transitions.

  Returns:
    The child-return code, or `null` if undefined.

### setChildReturn

    public boolean setChildReturn(java.lang.String newReturn)

  Sets the child-return code.

  This is meaningful only for child-return transitions.

  Parameters:
    `newReturn` - The new child-return code.
  Returns:
    true if this transition is a child-return transition, false if not.

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

(C) Copyright IBM Corporation 1999, 2005