Question
· 23 hr ago

Using assign in a routing rule using XML

I'm trying to use the assign option within a ruleset. I can trace the value with no issues but when I try to assign the same value to a variable of Namespace I get an error.
Ideally I would like to use a variable instead of repeating the Piece repeatedly throughout the rules.

Ruleset


And this is the error that I am getting.

ERROR <Ens>ErrException: <PROPERTY DOES NOT EXIST>zevaluateRuleDefinition+14^SFT.RoutingRules.AlertManCreationRule.1 *Namespace,Ens.Alerting.Context.CreateAlert -- logged as '-' number - @' set pContext.Namespace=##class(Ens.Rule.FunctionSet).Piece((pContext.AlertRequest.SourceConfigName),("|"))'

Can someone advise on where and how I can add that Namespace property so that I can assign it a value? Or have I got the wrong idea of the use of assign.

Thank you.

Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1.2 (Build 574U) Fri Jan 13 2023 15:00:26 EST
Discussion (4)3
Log in or sign up to continue

That property doesn't exists in the class you are using as context. But in the rule editor, General tab, you have a section called Temporary Variables, you can create there, and reference it with @<name> in the rule. In your case, your assing will be:

assing @Namespace = Piece(AlertRequest.SourceConfigName,"|")

Here is the documentation:

Temporary Variables

User-specified temporary variables, which you can use in the rule definition. The variables must be separated by commas, for example:

FreeShippingValue,ShipMethod,PremierMember

You can reference a temporary variable in a rule definition by preceding the variable name with the @ (at sign) character, for example, @FreeShippingValue. You cannot use temporary variables outside the rule definition. To pass information to a transformation, you can instead use the RuleUserData property. For more information, see Selecting the Transformation and Target of a Send Action.