ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.conversation
Class AbleRemoteUdfDecisionLogicAdapter

java.lang.Object
  |
  +--com.ibm.able.conversation.AbleRemoteUdfDecisionLogicAdapter
All Implemented Interfaces:
DecisionLogicAdapter

public class AbleRemoteUdfDecisionLogicAdapter
extends java.lang.Object
implements DecisionLogicAdapter

The AbleRemoteUdfDecisionLogicAdapter uses ABLE's user-defined functions (UDFs)--cf. com.ibm.able.AbleRemoteUserDefinedFunction--as the means of passing inputs to the agent's decision logic.

It contains a mapping from conversational contexts to names of user-defined functions, and a reference to an AbleUserDefinedFunctionManager--which is, in general, the agent that owns this DecisionLogicAdapter. When an AbleRemoteUdfDecisionLogicAdapter receives decision data from a Conversation, it uses the mapping to find the name of a user-defined function to invoke, then it uses the AbleUserDefinedFunctionManager to invoke that user-defined function.

Each of these user-defined functions must take parameters (Conversation, DecisionDataHandle)

The mapping from conversation contexts to names is highly constrained. The only parts of the conversational context used are the name and current state of the active conversation policy.

In addition to table entries for the decision data names, there are two special user-defined function names that must be supplied:


Constructor Summary
AbleRemoteUdfDecisionLogicAdapter()
          Constructs an AbleRemoteUdrDecisionLogicAdapter object.
AbleRemoteUdfDecisionLogicAdapter(AbleUserDefinedFunctionRemoteManager newMgr)
          Constructs an AbleRemoteUdrDecisionLogicAdapter object.
 
Method Summary
 void decisionPoint(Conversation conv, DecisionDataHandle ddh)
          Looks up and invokes the user-defined function associated with the Conversation's current context.
 java.lang.String getTimeoutUdfName()
          Returns the name of the user-defined function to invoke on all "timeout" inputs
protected  java.lang.String getUdfName(java.lang.String policyName, java.lang.String stateName)
          Returns the AbleUserDefinedFunction name associated with the given policy and state.
 java.lang.String getUnexpectedMessageUdfName()
          Returns the name of the user-defined function to invoke on all "unexpected message" inputs.
 void inboundData(Conversation conv, DecisionDataHandle ddh)
          Looks up and invokes the user-defined function associated with the Conversation's current context.
 void registerUdf(java.lang.String policyName, java.lang.String stateName, java.lang.String udfName)
          Associates the given AbleUserDefinedFunction name with the given policy and state.
 void setTimeoutUdfName(java.lang.String timeoutUdfName)
          Sets the the name of the user-defined function to invoke on all "timeout" inputs
 void setUdfManager(AbleUserDefinedFunctionRemoteManager newMgr)
          Sets the AbleUserDefinedFunctionRemoteManager to use.
 void setUnexpectedMessageUdfName(java.lang.String unexpectedMessageUdfName)
          Sets the name of the user-defined function to invoke on all "unexpected message" inputs.
 void timeout(Conversation conv, java.lang.String newStateName)
          Invokes the user-defined function with the name specified for "timeout" inputs.
 void unexpectedMessage(Conversation conv, MessageHandle mh)
          Invokes the user-defined function with the name specified for "unexpected message" inputs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbleRemoteUdfDecisionLogicAdapter

public AbleRemoteUdfDecisionLogicAdapter()
Constructs an AbleRemoteUdrDecisionLogicAdapter object.

AbleRemoteUdfDecisionLogicAdapter

public AbleRemoteUdfDecisionLogicAdapter(AbleUserDefinedFunctionRemoteManager newMgr)
Constructs an AbleRemoteUdrDecisionLogicAdapter object.
Method Detail

setUdfManager

public void setUdfManager(AbleUserDefinedFunctionRemoteManager newMgr)
Sets the AbleUserDefinedFunctionRemoteManager to use.

Parameters:
newMgr - The new AbleUserDefinedFunctionRemoteManager.

registerUdf

public void registerUdf(java.lang.String policyName,
                        java.lang.String stateName,
                        java.lang.String udfName)
Associates the given AbleUserDefinedFunction name with the given policy and state.

The user-defined function with the given name must take parameters (Conversation, DecisionDataHandle).

Parameters:
policyName - The policy part of the key to be associated with the given user-defined function name.
stateName - The state-name part of the key to be associated with the given user-defined function name.
udfName - The user-defined function name.

getUdfName

protected java.lang.String getUdfName(java.lang.String policyName,
                                      java.lang.String stateName)
Returns the AbleUserDefinedFunction name associated with the given policy and state.

Parameters:
policyName - The policy part of the key to be associated with the given user-defined function name.
stateName - The state-name part of the key to be associated with the given user-defined function name.
Returns:
The user-defined function name, or null if not found.

getTimeoutUdfName

public java.lang.String getTimeoutUdfName()
Returns the name of the user-defined function to invoke on all "timeout" inputs

Returns:
The user-defined function name.

setTimeoutUdfName

public void setTimeoutUdfName(java.lang.String timeoutUdfName)
Sets the the name of the user-defined function to invoke on all "timeout" inputs

The user-defined function with the given name must take parameters (Conversation, String).

Parameters:
timeoutUdfName - The user-defined function name to set.

getUnexpectedMessageUdfName

public java.lang.String getUnexpectedMessageUdfName()
Returns the name of the user-defined function to invoke on all "unexpected message" inputs.

Returns:
The user-defined function name.

setUnexpectedMessageUdfName

public void setUnexpectedMessageUdfName(java.lang.String unexpectedMessageUdfName)
Sets the name of the user-defined function to invoke on all "unexpected message" inputs.

The user-defined function with the given name must take parameters (Conversation, MessageHandle).

Parameters:
unexpectedMessageUdfName - The user-defined function name to set.

decisionPoint

public void decisionPoint(Conversation conv,
                          DecisionDataHandle ddh)
Looks up and invokes the user-defined function associated with the Conversation's current context.

The user-defined function is invoked with these input parameters: (conv, ddh).

Specified by:
decisionPoint in interface DecisionLogicAdapter
Parameters:
conv - The Conversation to which this decision point applies.
ddh - The decision-data for this decision point.

inboundData

public void inboundData(Conversation conv,
                        DecisionDataHandle ddh)
Looks up and invokes the user-defined function associated with the Conversation's current context.

The user-defined function is invoked with these input parameters: (conv, ddh).

Specified by:
inboundData in interface DecisionLogicAdapter
Parameters:
conv - The Conversation to which this inbound decision-data applies.
ddh - The inbound decision-data.

timeout

public void timeout(Conversation conv,
                    java.lang.String newStateName)
Invokes the user-defined function with the name specified for "timeout" inputs.

The user-defined function is invoked with these input parameters: (conv, newStateName).

Specified by:
timeout in interface DecisionLogicAdapter
Parameters:
conv - The Conversation to which this timeout applies.
newStateName - The policy's current state.

unexpectedMessage

public void unexpectedMessage(Conversation conv,
                              MessageHandle mh)
Invokes the user-defined function with the name specified for "unexpected message" inputs.

The user-defined function is invoked with these input parameters: (conv, mh).

Specified by:
unexpectedMessage in interface DecisionLogicAdapter
Parameters:
conv - The Conversation to which this unexpected message applies.
mh - The unexpected message.
See Also:
com.ibm.able.conversation

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003