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 ConversationContext

All Known Implementing Classes:
  BasicCpHandlerStack

public interface ConversationContext

The ConversationContext interface represents the current conversational context of a Conversation.

The conversational context consists of a list of tuples, one for each conversation policy in the current stack of policies, starting with the root policy and ending with the currently active policy. The tuple for each conversation policy consists of the policy name, the role played by the owner of the Conversation, and the current state. See `ConversationPolicyHandler` for a discussion of the meaning of "current state".

Note that this reflects an architectural assumption that conversation policies are related to one another in the manner of entries in a stack, rather than, say, nodes in a tree. In the stack, the root conversation policy is defined to be level 0, and the child of the policy at level N is at level N+1. The currently active policy is always the one with the greatest level.

ConversationContext is a read-only interface because context changes can only be made by the Conversation itself, as it processes inputs. For example, the Conversation's DecisionLogicAdapter is not allowed to change the context directly; it can only do so by means of passing legal decisions into the Conversation.

Method Summary
`int` | `getActivePolicyLevel()` Returns the level of the currently active conversation policy.
`java.lang.String` | `getActivePolicyName()` Returns the name of the currently active conversation policy.
`java.lang.String` | `getActiveSelfRole()` Returns the role this agent is playing in the currently active conversation policy.
`java.lang.String` | `getActiveStateName()` Returns the name of the current state of the currently active conversation policy.
`int` | `getNumPolicyLevels()` Returns the current number of conversation policy levels.
`java.lang.String` | `getPolicyNameAt(int level)` Returns the name of the policy at the given level.
`java.lang.String` | `getSelfRoleAt(int level)` Returns the role this agent in playing in the policy at the given level.
`java.lang.String` | `getStateNameAt(int level)` Returns the current state of the policy at the given level.

Method Detail

### getNumPolicyLevels

    public int getNumPolicyLevels()

  Returns the current number of conversation policy levels.

  Returns:
    The current number of conversation policy levels.

### getActivePolicyLevel

    public int getActivePolicyLevel()

  Returns the level of the currently active conversation policy.

  This is equal to `getNumPolicyLevels()-1`.

  Returns:
    The level of the currently active conversation policy.

### getActivePolicyName

    public java.lang.String getActivePolicyName()

  Returns the name of the currently active conversation policy.

  Returns:
    The name of the currently active conversation policy, or `null` if there is none.

### getActiveSelfRole

    public java.lang.String getActiveSelfRole()

  Returns the role this agent is playing in the currently active conversation policy.

  Returns:
    The role this agent is playing in the currently active conversation policy, or `null` if there is none.

### getActiveStateName

    public java.lang.String getActiveStateName()

  Returns the name of the current state of the currently active conversation policy.

  See `ConversationPolicyHandler` for a discussion of the meaning of "current state".

  Returns:
    The name of the current state of the currently active conversation policy, or `null` if there is none.

### getPolicyNameAt

    public java.lang.String getPolicyNameAt(int level)

  Returns the name of the policy at the given level.

  The root policy is level 0.

  Parameters:
    `level` - The level in question.
  Returns:
    The name of the policy at the given level.

### getSelfRoleAt

    public java.lang.String getSelfRoleAt(int level)

  Returns the role this agent in playing in the policy at the given level.

  The root policy is level 0.

  Parameters:
    `level` - The level in question.
  Returns:
    The role at the given level.

### getStateNameAt

    public java.lang.String getStateNameAt(int level)

  Returns the current state of the policy at the given level.

  The root policy is level 0. See `ConversationPolicyHandler` for a discussion of the meaning of "current state".

  Parameters:
    `level` - The level in question.
  Returns:
    The name of the current state in the conversation policy at the given level, or `null` if there is none.

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