This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

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


persistent class EnsLib.MsgRouter.RoutingEngine extends Ens.BusinessProcess

SQL Table Name: EnsLib_MsgRouter.RoutingEngine

Property Inventory

Method Inventory


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


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 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 ];
Reason for Rule action
Property methods: RuleReasonDisplayToLogical(), RuleReasonGet(), RuleReasonIsValid(), RuleReasonLogicalToDisplay(), RuleReasonLogicalToOdbc(), RuleReasonNormalize(), RuleReasonSet()
property RuleUserData as %String) [ Transient ];
User defined variable
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()


classmethod GetDelegateConnections(Output pArray As %String, pRuleName As %String, pSeen As %List = "")
method IsErrorResponse(request As %Persistent, ByRef response As %Persistent) as %Boolean
method OnComplete(request As %Persistent, ByRef response As %Persistent) as %Status
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
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
classmethod OnGetConnections(Output pArray As %String, pItem As Ens.Config.Item)
Inherited description: This method is called when Ensemble 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)
method OnRequest(request As %Persistent, Output response As %Persistent) as %Status
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
Inherited description: Handle a 'Response'
method OnTimeout(request As %Persistent, ByRef response As %Persistent, callrequest As %Persistent, pCompletionKey As %String) as %Status
method OnValidate(pDoc As %Persistent, pValSpec As %String, Output pStatus As %Status = $$$OK) as %Boolean
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
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
classmethod normalizeValSpec(pValSpec As %String) as %String
Convert to lower case, with inverse spec chars converted to upper case

Inherited Members

Inherited Properties

Inherited Methods


Gray indicates storage defined by superclasses.

Storage Model: CacheStorage (Ens.BusinessProcess)


Storage Model: CacheStorage (Ens.BusinessProcess)


Storage Model: CacheStorage (Ens.BusinessProcess)


Storage Model: CacheStorage (Ens.BusinessProcess)


Storage Model: CacheStorage (EnsLib.MsgRouter.RoutingEngine)


Storage Model: CacheStorage (EnsLib.MsgRouter.RoutingEngine)