Home > Class Reference > ENSLIB namespace > EnsLib.MsgRouter.RoutingEngine

EnsLib.MsgRouter.RoutingEngine

persistent class EnsLib.MsgRouter.RoutingEngine extends Ens.BusinessProcess

SQL Table Name: EnsLib_MsgRouter.RoutingEngine

Property Inventory

Method Inventory

Parameters

parameter SETTINGS = BusinessRuleName:Basic:ruleSelector,AlertOnBadMessage,BadMessageHandler::selector?context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId},ResponseFrom::selector?multiSelect=1&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId},ResponseTargetConfigNames::selector?multiSelect=1&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId},ResponseTimeout,ForceSyncSend,ActOnTransformError,ActOnValidationError,RuleLogging:Dev;
Inherited description: List of properties can be set as settings in the configuration file format is a comma separated list of property names

Properties

property %ErrorStatus as %Status [ InitialExpression = $$$OK , Transient ];
Remember the error we return in OnError() so we can use it in OnComplete() if needed
Property methods: %ErrorStatusGet(), %ErrorStatusIsValid(), %ErrorStatusLogicalToOdbc(), %ErrorStatusSet()
property %ResponseList as list of %String);
List of responses we have gotten that we are going to send back
Property methods: %ResponseListBuildValueArray(), %ResponseListCollectionToDisplay(), %ResponseListCollectionToOdbc(), %ResponseListDisplayToCollection(), %ResponseListDisplayToLogical(), %ResponseListGet(), %ResponseListGetObject(), %ResponseListGetObjectId(), %ResponseListGetStored(), %ResponseListGetSwizzled(), %ResponseListIsValid(), %ResponseListLogicalToDisplay(), %ResponseListLogicalToOdbc(), %ResponseListNormalize(), %ResponseListOdbcToCollection(), %ResponseListSet(), %ResponseListSetObject(), %ResponseListSetObjectId()
property %TimedOut as %Boolean;
Did we time out while waiting for any response(s)?
Property methods: %TimedOutDisplayToLogical(), %TimedOutGet(), %TimedOutGetStored(), %TimedOutIsValid(), %TimedOutLogicalToDisplay(), %TimedOutNormalize(), %TimedOutSet()
property %WaitAll as %String (MAXLEN = 1);
Should we wait for all responses?
Property methods: %WaitAllDisplayToLogical(), %WaitAllGet(), %WaitAllGetStored(), %WaitAllIsValid(), %WaitAllLogicalToDisplay(), %WaitAllLogicalToOdbc(), %WaitAllNormalize(), %WaitAllSet()
property ActOnTransformError as %Boolean [ InitialExpression = 0 ];
Enable this to cause errors returned by a transformation to stop rule evaluation and the error to be handled by Reply Code Actions setting.
Property methods: ActOnTransformErrorDisplayToLogical(), ActOnTransformErrorGet(), ActOnTransformErrorGetStored(), ActOnTransformErrorIsValid(), ActOnTransformErrorLogicalToDisplay(), ActOnTransformErrorNormalize(), ActOnTransformErrorSet()
property ActOnValidationError as %Boolean [ InitialExpression = 0 ];
Enable this to cause errors returned by validation to be handled by Reply Code Actions setting.
Property methods: ActOnValidationErrorDisplayToLogical(), ActOnValidationErrorGet(), ActOnValidationErrorGetStored(), ActOnValidationErrorIsValid(), ActOnValidationErrorLogicalToDisplay(), ActOnValidationErrorNormalize(), ActOnValidationErrorSet()
property ActionTargets as %String) [ Transient ];
Property methods: ActionTargetsDisplayToLogical(), ActionTargetsGet(), ActionTargetsIsValid(), ActionTargetsLogicalToDisplay(), ActionTargetsLogicalToOdbc(), ActionTargetsNormalize(), ActionTargetsSet()
property AlertOnBadMessage as %Boolean [ Transient ];
Send an Alert if validation blocks a message
Property methods: AlertOnBadMessageDisplayToLogical(), AlertOnBadMessageGet(), AlertOnBadMessageIsValid(), AlertOnBadMessageLogicalToDisplay(), AlertOnBadMessageNormalize(), AlertOnBadMessageSet()
property BadMessageHandler as %String (MAXLEN = 1000) [ Transient ];
Name of the host that should handle messages that validation blocks
Property methods: BadMessageHandlerDisplayToLogical(), BadMessageHandlerGet(), BadMessageHandlerIsValid(), BadMessageHandlerLogicalToDisplay(), BadMessageHandlerLogicalToOdbc(), BadMessageHandlerNormalize(), BadMessageHandlerSet()
property BusinessRuleName as %String (MAXLEN = 1000) [ Transient ];
Business Rule Name. If this setting is empty, then the ConfigItem name is used as the rule name
Property methods: BusinessRuleNameDisplayToLogical(), BusinessRuleNameGet(), BusinessRuleNameIsValid(), BusinessRuleNameLogicalToDisplay(), BusinessRuleNameLogicalToOdbc(), BusinessRuleNameNormalize(), BusinessRuleNameSet()
property Document as %RegisteredObject [ Transient ];
Property methods: DocumentGet(), DocumentGetSwizzled(), DocumentIsValid(), DocumentNewObject(), DocumentSet()
property ForceSyncSend as %Boolean [ Transient ];
Make synchronous calls for 'send' actions. WARNING: this can cause deadlock if another BP is called by something called synchronously from here.

This setting is intended to ensure FIFO ordering when this router and the target Operations have PoolSize=1, and ancillary Operations might get called asynchronously from within a Transform or Operation called from this router.

Note that if there are multiple 'send' targets, this setting means they will be called one after another in serial fashion, with the next being called after the previous call completes.

Also note that synchronous calls are not subject to the ResponseTimeout setting.

Property methods: ForceSyncSendDisplayToLogical(), ForceSyncSendGet(), ForceSyncSendIsValid(), ForceSyncSendLogicalToDisplay(), ForceSyncSendNormalize(), ForceSyncSendSet()
property MsgClass as %String (MAXLEN = 128) [ Transient ];
Property methods: MsgClassDisplayToLogical(), MsgClassGet(), MsgClassIsValid(), MsgClassLogicalToDisplay(), MsgClassLogicalToOdbc(), MsgClassNormalize(), MsgClassSet()
property ResponseFrom as %String (MAXLEN = 1000) [ Transient ];
Names the target(s) from which a response should be forwarded back to the caller, if the caller requested
a response. If this value is empty, no reply will be requested from any target. Otherwise, this value is a
comma-separated list of target config names. The response returned will be the first one that arrives back
from any target in the list. A value of '*' will match any target, so the first response received will be
the one returned.

If none of the listed targets gets called and the caller requested a response, an empty 'OK' response header
will be returned.

If the list of targets begins with a '+' character, the responses from all the targets called will be returned as a list of message header IDs in the response header, or an empty 'OK' response header if no responses appear before the timeout expires.

If the list of targets begins with a '-' character, all error responses only from any of the targets called
will be returned as a list of message header IDs in the response header, or an empty 'OK' response header if no error responses appear before the timeout expires.

Property methods: ResponseFromDisplayToLogical(), ResponseFromGet(), ResponseFromIsValid(), ResponseFromLogicalToDisplay(), ResponseFromLogicalToOdbc(), ResponseFromNormalize(), ResponseFromSet()
property ResponseTargetConfigNames as %String (MAXLEN = 1000);
Names a destination or destinations in addition to the caller to which responses will be forwarded.

If this value is empty, responses are only returned to the caller. If one or more target config names are listed (separated by commas), each response from this router will be forwarded to each target config item listed.

This setting has effect only if ResponseFrom is not empty.

Property methods: ResponseTargetConfigNamesDisplayToLogical(), ResponseTargetConfigNamesGet(), ResponseTargetConfigNamesGetStored(), ResponseTargetConfigNamesIsValid(), ResponseTargetConfigNamesLogicalToDisplay(), ResponseTargetConfigNamesLogicalToOdbc(), ResponseTargetConfigNamesNormalize(), ResponseTargetConfigNamesSet()
property ResponseTimeout as %Numeric (MINVAL = -1) [ InitialExpression = -1 , Transient ];
Maximum length of time to wait for asynchronous responses before returning a timed-out error response header. A value of -1 means to wait forever; note that a value of 0 is not useful because every response would time out.

This setting has effect only if ResponseFrom is not empty.

Property methods: ResponseTimeoutDisplayToLogical(), ResponseTimeoutGet(), ResponseTimeoutIsValid(), ResponseTimeoutLogicalToDisplay(), ResponseTimeoutNormalize(), ResponseTimeoutSet()
property RuleActionReason as %String) [ Transient ];
RuleActionReason is not intended for user assignment.
This property is only valid if the RuleSet being called includes one or more assignments to the context property RuleActionUserData.
If this is the case then the the rule action reason is set at the start of each rule/when or rule/otherwise execution
The system assigned value is of the form rule#1when#1 or rule#1otherwise. (numbers change as appropriate).
If the rule action reason is set in the rule it is returned as part of a send return value allowing the Routing Engine to set RuleActionReason property to the value contained in the send return instruction.
This allows transformations to access aux.RuleActionUserData which will be the value of the RuleActionUserData set during the particular rule/when or rule/otherwise execution that led to the send transformation action.
This property value is reset to empty string at the end of the rule execution.
NOTE: If a send action takes place outside of a rule/when or rule/otherwise any value returned with the send instructions will be the last value set in the rule execution.
NOTE: This property is only valid if the rule being called is assigning one or more values to the routing engine context property RuleActionUserData.
Property methods: RuleActionReasonDisplayToLogical(), RuleActionReasonGet(), RuleActionReasonIsValid(), RuleActionReasonLogicalToDisplay(), RuleActionReasonLogicalToOdbc(), RuleActionReasonNormalize(), RuleActionReasonSet()
property RuleActionUserData as %String) [ Transient ];
A user defined variable that can be set in a specific rule/when or rule/otherwise action.
The value assigned will be paired with the system assigned RuleActionReason value at the time of assignment (using the internal RuleActionUserDataArray).
The RuleActionReason value is assigned by the system at the start of each rule/when or rule/otherwise execution if RuleActionUserData is used in the rule.
The value of aux.RuleActionUserData accessed in a transformation called from a routing rule as part of a send action will be the value assigned in the routing rule for the particular rule/when or rule/otherwise that led to the send action.
A transformation that is called from a routing rule as part of a send action can set aux.RuleActionUserData. Any subsequent transformations that are executed as part of a send action from the same rule/when or rule/otherwise will then retrieve the transformation modified value if they access aux.RuleActionUserData.
If the RuleActionReason is empty the RuleActionUserData assignment will not take place.
Property methods: RuleActionUserDataArrayDisplayToLogical(), RuleActionUserDataArrayGet(), RuleActionUserDataArrayIsValid(), RuleActionUserDataArrayLogicalToDisplay(), RuleActionUserDataArrayLogicalToOdbc(), RuleActionUserDataArrayNormalize(), RuleActionUserDataArraySet(), RuleActionUserDataDisplayToLogical(), RuleActionUserDataGet(), RuleActionUserDataIsValid(), RuleActionUserDataLogicalToDisplay(), RuleActionUserDataLogicalToOdbc(), RuleActionUserDataNormalize(), RuleActionUserDataSet()
property RuleActionUserDataArray as %String) [ MultiDimensional ];
Direct access to this array property is not intended.
Internal storage for user defined variables at specific rule/when or rule/otherwise states in the ruleset execution.
This property cannot be set directly in the rule.
NOTE: This property is only valid if the rule being called is assigning one or more values to the routing engine context property RuleActionUserData.
Property methods: RuleActionUserDataArrayDisplayToLogical(), RuleActionUserDataArrayGet(), RuleActionUserDataArrayIsValid(), RuleActionUserDataArrayLogicalToDisplay(), RuleActionUserDataArrayLogicalToOdbc(), RuleActionUserDataArrayNormalize(), RuleActionUserDataArraySet()
property RuleLogging as %String [ InitialExpression = $$$eRuleLogTypeReturn ];
This set of flags controls the logging performed by the rule engine whenever a routing rule is executed. The following flags are available:
  • 'e' - log errors only. All errors will be logged irrespective of other flags, so setting the value to 'e' or leaving the value empty will only log errors.
  • 'r' - log return values. This is the default value for the setting, and is also automatic whenever the 'd' or 'c' flags are specified.
  • 'd' - log user-defined debug actions in the rule. This will also include 'r'.
  • 'c' - log details of the conditions that are evaluated in the rule. This will also include 'r'.
  • 'a' - log all available information. This is equivalent to 'rcd'.
Property methods: RuleLoggingDisplayToLogical(), RuleLoggingGet(), RuleLoggingGetStored(), RuleLoggingIsValid(), RuleLoggingLogicalToDisplay(), RuleLoggingLogicalToOdbc(), RuleLoggingNormalize(), RuleLoggingSet()
property RuleReason as %String (MAXLEN = 2000, TRUNCATE = 1) [ Transient ];
FullReason for RuleSet action
Property methods: RuleReasonDisplayToLogical(), RuleReasonGet(), RuleReasonIsValid(), RuleReasonLogicalToDisplay(), RuleReasonLogicalToOdbc(), RuleReasonNormalize(), RuleReasonSet()
property RuleUserData as %String) [ Transient ];
User defined variable that applies to the RuleSet.
Only one value of the RuleUserData variable is available and it is the last value it is assigned in the RuleSet before the RuleSet returns.
Property methods: RuleUserDataDisplayToLogical(), RuleUserDataGet(), RuleUserDataIsValid(), RuleUserDataLogicalToDisplay(), RuleUserDataLogicalToOdbc(), RuleUserDataNormalize(), RuleUserDataSet()
property Source as %String (MAXLEN = 128) [ Transient ];
Property methods: SourceDisplayToLogical(), SourceGet(), SourceIsValid(), SourceLogicalToDisplay(), SourceLogicalToOdbc(), SourceNormalize(), SourceSet()
property Validation as %String [ Transient ];
Causes validation to be performed. Default implementation of OnValidate() does nothing; If you override it and want it to be configurable, override this description comment and add Parameter SETTINGS = "Validation"; to your subclass as well.
Property methods: ValidationDisplayToLogical(), ValidationGet(), ValidationIsValid(), ValidationLogicalToDisplay(), ValidationLogicalToOdbc(), ValidationNormalize(), ValidationSet()
property aRespFrom as array of %String (MAXLEN = 128);
Property methods: aRespFromBuildValueArray(), aRespFromCollectionToDisplay(), aRespFromCollectionToOdbc(), aRespFromDisplayToCollection(), aRespFromDisplayToLogical(), aRespFromGet(), aRespFromGetObject(), aRespFromGetObjectId(), aRespFromGetStored(), aRespFromGetSwizzled(), aRespFromIsValid(), aRespFromLogicalToDisplay(), aRespFromLogicalToOdbc(), aRespFromNormalize(), aRespFromOdbcToCollection(), aRespFromSet(), aRespFromSetObject(), aRespFromSetObjectId()

Methods

classmethod GetDelegateConnections(Output pArray As %String, pRuleName As %String, pSeen As %List = "") [ Language = objectscript ]
method IsErrorResponse(request As %Persistent, ByRef response As %Persistent) as %Boolean [ Language = objectscript ]
method OnComplete(request As %Persistent, ByRef response As %Persistent) as %Status [ Language = objectscript ]
Inherited description: Called when all the Async responses are received, or timeout has occurred
method OnError(request As %Persistent, ByRef response As %Persistent, callrequest As %Persistent, pErrorStatus As %Status, pCompletionKey As %String) as %Status [ Language = objectscript ]
Inherited description: This method is called when an error response is received.
Returning the same error will cause the BusinessProcess to set its status to error and close down Returning $$$OK from this method causes the BusinessProcess to recover from this error
For custom coded Business Processes that do not sub class Ens.BusinessProcessBPL it is also possible to use WillHandleErroredResponse() and OnErroredResponse()
classmethod OnGetConnections(Output pArray As %String, pItem As Ens.Config.Item) [ Language = objectscript ]
Inherited description: This method is called when Portal is drawing the production diagram pArray contains the config names the scanner found. Users can remove or add new names
method OnPrepareReply(request As %Persistent, ByRef response As %Persistent) [ Language = objectscript ]
method OnRequest(request As %Persistent, Output response As %Persistent) as %Status [ Language = objectscript ]
Inherited description: Handle a 'Request'
method OnResponse(request As %Persistent, ByRef response As %Persistent, callrequest As %Persistent, callresponse As %Persistent, pCompletionKey As %String) as %Status [ Language = objectscript ]
Inherited description: Handle a 'Response'
method OnTimeout(request As %Persistent, ByRef response As %Persistent, callrequest As %Persistent, pCompletionKey As %String) as %Status [ Language = objectscript ]
method OnValidate(pDoc As %Persistent, pValSpec As %String, Output pStatus As %Status = $$$OK) as %Boolean [ Language = objectscript ]
Override this method to implement your own method for validating a Document Return non-zero to prevent default validation of the message (if any); return an error code in pStatus to indicate a validation failure.
method RuleLoggingSet(pRuleLogging As %String = $$$eRuleLogTypeReturn) as %Status [ Language = objectscript ]
Ensure that the value of RuleLogging is normalized at the time that it is set.
method doOneAction(pRequest As %Persistent, pOneAction As %String, Output pQuitProcessing As %Boolean, pLevel As %Integer = 1, Output pSyncResponse As %Persistent) as %Status [ Language = objectscript ]
classmethod normalizeValSpec(pValSpec As %String) as %String [ Language = objectscript ]
Convert to lower case, with inverse spec chars converted to upper case

Inherited Members

Inherited Properties

Inherited Methods

Storage

Gray indicates storage defined by superclasses.

Storage Model: Storage (Ens.BusinessProcess)

^Ens.BusinessProcessD(ID,"pending",n)
=
%MasterPendingResponses(n)

Storage Model: Storage (Ens.BusinessProcess)

^Ens.BusinessProcessD(ID,"received",n)
=
%MessagesReceived(n)

Storage Model: Storage (Ens.BusinessProcess)

^Ens.BusinessProcessD(ID,"sent",n)
=
%MessagesSent(n)

Storage Model: Storage (Ens.BusinessProcess)

^Ens.BusinessProcessD(ID)
=
%%CLASSNAME
%ConfigQueueName
%IsCompleted
%MasterPendingResponsesOld
%PrimaryRequestHeader
%PrimaryResponseHeader
%RepliedStatus
%responseId
Adapter
%SessionId
%TimeCompleted
%TimeCreated
%ConfigName
%QuitTask
AlertOnError
%responseClassName
%IsTimerInterrupted
%IsTerminated
%StatusCode
%MessagesReceivedOld
%MessagesSentOld
ReplyCodeActions
RetryInterval
AlertRetryGracePeriod
FailureTimeout
Retry
SuspendMessage
QueueCountAlert
QueueWaitAlert
InactivityTimeout
BusinessPartner
AlertGroups
%SuperSession

Storage Model: Storage (EnsLib.MsgRouter.RoutingEngine)

^Ens.BusinessProcessD(ID,"RoutingEngine")
=
%WaitAll
%ResponseList
%TimedOut
ResponseTargetConfigNames
ActOnTransformError
RuleLogging
ActOnValidationError

Storage Model: Storage (EnsLib.MsgRouter.RoutingEngine)

^Ens.BusinessProcessD(ID,"aRespFrom",n)
=
aRespFrom(n)

Subclasses