Namespace: OpenEdge.BusinessRules
Class 
DecisionService
Parent classes:
Inherits: Progress.Lang.Object

Copyright (c) 2013 by Progress Software Corporation. All rights reserved.
File:DecisionService
Purpose:API for interacting with a Corticon Rules Decision Service
Author(s):pjudge
Created:Thu Feb 28 15:00:43 EST 2013
Notes:* The building of the payload is separated out, since it
can be (it's a relatively stateless operation). The processing
of the payload is inline, since it interacts with a number of
data structures in this class, and it's more efficient to
keep it inline
for performance reasons.




Method Summary
Options Name Purpose
+ CacheAppDataSchema (handle) /** Caches the schema of the input data structure for mapping response data to the input data. @param handle The input dataset */
+ CreateOrFindRecord (character, character)
DestroyComponent ()
# GetMessages (table) /** Returns the messages for the most recent decision service invocation. Idempotent - a repeated call to this method will always return the same data. The message data is only cleared when a new InvokeService call is made. References in the RulesMessage table are to the response data structure used in the InvokeService()} call, which may differ from the input application data data structure. See the InvokeService documentation for details. @param output table The RulesMessage table as defined in {OpenEdge/BusinessRules/ttRulesMessage.i} */
Initialise ()
# InvokeService (dataset-handle) /** Invokes the decision service with the passed-in payload. Accepts a ProDataSet handle for passing to the decision service. Expected usage is that this method be called BY-REFERENCE for a shallow copy. The contents of this ProDataSert are removed and replaced by the results of the decision service call @param input-output dataset-handle Dataset containing the business data for processing by the decision service. */
# InvokeService (table-handle) /** Invokes the decision service with the passed-in payload. Accepts a table handle for passing to the decision service. Expected usage is that this method be called BY-REFERENCE for a shallow copy. The contents of this temp-table are removed and replaced by the results of the decision service call. The temp-table passed into this method can not be part of a ProDataSet (an AppError is thrown if it is) @param input-output table-handle The business data passed to and from the decision service. */
InvokeService (dataset-handle, dataset-handle) /** Protected 'worker' method that performs the service call. This method must be called BY-REFERENCE for performance reasons. The params are defined as DATASET-HANDLE for clarity/readability; they could just as easily be HANDLEs. @param dataset-handle Dataset containing the business applications data @param dataset-handle (Empty) Dataset for the service response data */
# InvokeService (dataset-handle, dataset-handle) /** Invokes the decision service with the passed-in payload. Accepts a ProDataSet handle for passing to the decision service. Expected usage is that this method be called BY-REFERENCE for a shallow copy. The results of the decision service call are returned in the output parameter, and the input data is not updated at all. The output dataset is a clone of the input dataset - the intent of this API is to allow callers to use the input data as a before-image for comparison purposes. References in the RulesMessage table returned by the GetMessages() call are to tables in the response ProDataSet (important if the reference key is a ROWID). @param dataset-handle Dataset containing the input business data for processing by the decision service @param output dataset-handle Dataset containing the return/response business data from the decision service. */
# InvokeService (table-handle, table-handle) /** Invokes the decision service with the passed-in payload. Accepts a table handle for passing to the decision service. Expected usage is that this method be called BY-REFERENCE for a shallow copy. The results of the decision service call are returned in the output parameter, and the input data is not updated at all. The temp-table passed into this method can not be part of a ProDataSet (an AppError is thrown if it is). The output table is a clone of the input table - the intent of this API is to allow callers to use the input data as a before-image for comparison purposes. References in the RulesMessage table returned by the GetMessages() call are to the response table (important if the reference key is a ROWID). @param table-handle The business data to pass to the decision service. @param output table-handle The result/response data of the decision service. */
# LOGICAL IsServiceAvailable () /** Returns true if the current Decision Service is deployed. @return logical Whether the decision service is deployed of not. */
+ LoadResponseDocument (longchar, dataset-handle) /** Convert XML response into application data and (linked) Rule Messages @param longchar An XML document containing the service response @param dataset-handle The dataset into which to load the data from the response document. */
# SaxReaderCharactersHandler (handle, longchar, integer) /** CHARACTERS event handler for the SAX-READER. Method implemented as per ABL documentation. */
# SaxReaderEndElementHandler (handle, character, character, character) /** END-ELEMENT event handler for the SAX-READER. Method implemented as per ABL documentation. */
# SaxReaderStartElementHandler (handle, character, character, character, handle) /** START-ELEMENT event handler for the SAX-READER. Method implemented as per ABL documentation. */
+ SetDataKeyValue (character) /** Updates the DataKeyValue and TableName fields in the RulesMessage buffer from the application data. @param character The value of the return messages' entityReference href attribute, which contains the link to the application data */

Constructor Summary
Options Name Purpose
# DecisionService (RulesServerConnection, character) /* Details shown by the private constructor doc. */
# DecisionService (RulesServerConnection, character, datetime-tz) /* Details shown by the private constructor doc. */
# DecisionService (RulesServerConnection, character, decimal) /* Details shown by the private constructor doc. */
+ DecisionService (RulesServerConnection, character, decimal, datetime-tz) /** Private constructor for this class. Used instead of a real constructor since some transformations have to happen before its called, and since a constructor must be invoked first via SUPER or THIS-OBJECT, there's no room for those transformations. @param RulesServerConnection (mandatory) The server connection to use @param character (mandatory) The name of the decision service @param decimal The version of the decision service to use. @param datetime-tz The effective date with which which to select the decision service to use. */

Property Summary
Options Name Purpose
# DATETIME-TZ EffectiveOn /* (optional) The effective date with which which to select the decision service to invoke. Defaults to unknown value, which is the latest/most recent version. Only one of Version or EffectiveOn can be used at a time; the choice of which is made by the developer when calling the constructor. */
# CHARACTER Name /* (Mandatory). The name of the decision service to invoke. */
OpenEdge.BusinessRules.RulesServerConnection ServerConnection /* (mandatory) The Server connection object representing the physical server on which this decision service will be run/invoked. */
# DECIMAL Version /* (optional) The version of the decision service to invoke. Defaults to unknown value, which is the latest/most recent version. Only one of Version or EffectiveOn can be used at a time; the choice of which is made by the developer when calling the constructor. */


Method Detail
Top

PUBLIC CacheAppDataSchema (handle)

Purpose: Caches the schema of the input data structure for mapping response
data to the input data.
Parameters:
phAppData HANDLE
Top

PUBLIC CreateOrFindRecord (character, character)

Parameters:
pcBufferName CHARACTER
pcHrefId CHARACTER
Top

DestroyComponent ()

Top

PROTECTED GetMessages (table)

Purpose: Returns the messages for the most recent decision service invocation.
Idempotent - a repeated call to this method will always return the same
data. The message data is only cleared when a new InvokeService call is
made. References in the RulesMessage table are to the response data
structure used in the InvokeService()} call, which may differ from the
input application data data structure. See the InvokeService
documentation for details.
{OpenEdge/BusinessRules/ttRulesMessage.i}
Parameters:
RulesMessage TABLE
Top

Initialise ()

Top

PROTECTED InvokeService (dataset-handle)

Purpose: Invokes the decision service with the passed-in payload. Accepts a
ProDataSet handle for passing to the decision service. Expected
usage is that this method be called BY-REFERENCE for a shallow copy. The
contents of this ProDataSert are removed and replaced by the results of
the decision service call
for processing by the decision service.
Parameters:
phAppData DATASET-HANDLE
Top

PROTECTED InvokeService (table-handle)

Purpose: Invokes the decision service with the passed-in payload. Accepts a table
handle for passing to the decision service. Expected usage is that this
method be called BY-REFERENCE for a shallow copy. The contents of this
temp-table are removed and replaced by the results of the decision
service call. The temp-table passed into this method can not be part of
a ProDataSet (an AppError is thrown if it is)
decision service.
Parameters:
phAppData TABLE-HANDLE
Top

InvokeService (dataset-handle, dataset-handle)

Purpose: Protected 'worker' method that performs the service call.
This method must be called BY-REFERENCE for performance reasons. The params
are defined as DATASET-HANDLE for clarity/readability; they could just
as easily be HANDLEs.
Parameters:
phAppData DATASET-HANDLE
phResponseData DATASET-HANDLE
Top

PROTECTED InvokeService (dataset-handle, dataset-handle)

Purpose: Invokes the decision service with the passed-in payload. Accepts a
ProDataSet handle for passing to the decision service. Expected usage is
that this method be called BY-REFERENCE for a shallow copy. The results
of the decision service call are returned in the output parameter, and
the input data is not updated at all.
The output dataset is a clone of the input dataset - the intent of this
API is to allow callers to use the input data as a before-image for
comparison purposes. References in the RulesMessage table returned by
the GetMessages() call are to tables in the response ProDataSet
(important if the reference key is a ROWID).
processing by the decision service
data from the decision service.
Parameters:
phAppData DATASET-HANDLE
phResponseData DATASET-HANDLE
Top

PROTECTED InvokeService (table-handle, table-handle)

Purpose: Invokes the decision service with the passed-in payload. Accepts a table
handle for passing to the decision service. Expected usage is that this
method be called BY-REFERENCE for a shallow copy. The results of the
decision service call are returned in the output parameter, and the
input data is not updated at all. The temp-table passed into this method
can not be part of a ProDataSet (an AppError is thrown if it is).
The output table is a clone of the input table - the intent of this API
is to allow callers to use the input data as a before-image for comparison
purposes. References in the RulesMessage table returned by the
GetMessages() call are to the response table (important if the reference
key is a ROWID).
service.
Parameters:
phAppData TABLE-HANDLE
phResponseData TABLE-HANDLE
Top

PROTECTED LOGICAL IsServiceAvailable ()

Purpose: Returns true if the current Decision Service is deployed.
Returns LOGICAL
logical Whether the decision service is deployed of not.
Top

PUBLIC LoadResponseDocument (longchar, dataset-handle)

Purpose: Convert XML response into application data and (linked) Rule Messages
response document.
Parameters:
pcResponseDocument LONGCHAR
phResponseData DATASET-HANDLE
Top

PROTECTED SaxReaderCharactersHandler (handle, longchar, integer)

Purpose: CHARACTERS event handler for the SAX-READER. Method implemented as per
ABL documentation.
Parameters:
phSaxReader HANDLE
pcCharData LONGCHAR
piNumChars INTEGER
Top

PROTECTED SaxReaderEndElementHandler (handle, character, character, character)

Purpose: END-ELEMENT event handler for the SAX-READER. Method implemented as per
ABL documentation.
Parameters:
phSaxReader HANDLE
pcNamespaceURI CHARACTER
pcLocalName CHARACTER
pcQName CHARACTER
Top

PROTECTED SaxReaderStartElementHandler (handle, character, character, character, handle)

Purpose: START-ELEMENT event handler for the SAX-READER. Method implemented as per
ABL documentation.
Parameters:
phSaxReader HANDLE
pcNamespaceURI CHARACTER
pcLocalName CHARACTER
pcQName CHARACTER
phAttributes HANDLE
Top

PUBLIC SetDataKeyValue (character)

Purpose: Updates the DataKeyValue and TableName fields in the RulesMessage buffer
from the application data.
attribute, which contains the link to the application
data
Parameters:
pcMessageEntityHref CHARACTER


Constructor Detail
Top

PROTECTED DecisionService (RulesServerConnection, character)

/* Details shown by the private constructor doc.
Parameters:
poServer OpenEdge.BusinessRules.RulesServerConnection
pcDecisionServiceName CHARACTER
Top

PROTECTED DecisionService (RulesServerConnection, character, datetime-tz)

/* Details shown by the private constructor doc.
Parameters:
poServer OpenEdge.BusinessRules.RulesServerConnection
pcDecisionServiceName CHARACTER
ptEffectiveOn DATETIME-TZ
Top

PROTECTED DecisionService (RulesServerConnection, character, decimal)

/* Details shown by the private constructor doc.
Parameters:
poServer OpenEdge.BusinessRules.RulesServerConnection
pcDecisionServiceName CHARACTER
pdVersion DECIMAL
Top

PUBLIC DecisionService (RulesServerConnection, character, decimal, datetime-tz)

Purpose: Private constructor for this class. Used instead of a real constructor
since some transformations have to happen before its called, and since
a constructor must be invoked first via SUPER or THIS-OBJECT, there's
no room for those transformations.
decision service to use.
Parameters:
poServer OpenEdge.BusinessRules.RulesServerConnection
pcDecisionServiceName CHARACTER
pdVersion DECIMAL
ptEffectiveOn DATETIME-TZ


Property Detail
Top

PROTECTED DATETIME-TZ EffectiveOn

/* (optional) The effective date with which which to select the decision
service to invoke.
Defaults to unknown value, which is the latest/most recent version. Only
one of Version or EffectiveOn can be used at a time; the choice of which
is made by the developer when calling the constructor.
Returns DATETIME-TZ
Top

PROTECTED CHARACTER Name

/* (Mandatory). The name of the decision service to invoke.
Returns CHARACTER
Top

OpenEdge.BusinessRules.RulesServerConnection ServerConnection

/* (mandatory) The Server connection object representing the physical server
on which this decision service will be run/invoked.
Returns OpenEdge.BusinessRules.RulesServerConnection
Top

PROTECTED DECIMAL Version

/* (optional) The version of the decision service to invoke.
Defaults to unknown value, which is the latest/most recent version. Only
one of Version or EffectiveOn can be used at a time; the choice of which
is made by the developer when calling the constructor.
Returns DECIMAL


10.27.2015 12:36:15