Question
· Oct 23, 2017

Routing Rule Condition based on RecordMap property

I am currently trying to add a condition to a routing rule that uses the %Source property of a routing rule.  Unfortunately I am getting compile errors when I use the "%", and if I get PROPERTY DOES NOT EXIST if I try and use any of field. I have tried referencing the messages as "Message." , "Record.",  "FullRecordMapClassName." , "Document." . Does anyone know how to reference the properties of a record map in a routing rule, or if it is even possible? Thanks!

Discussion (10)3
Log in or sign up to continue

Here's a potential solution. It's a method that will extract the %Source value from the message, and it should work for any Ensemble message type:

Class User.Util.MsgBody Extends Ens.Rule.FunctionSet

{

 

ClassMethod GetMsgSource(pMsg As Ens.Request) As %String

 {

       Return pMsg.%Source

 }

 

}

Since it extends Ens.Rule.FunctionSet, it's available as a function in the rule editor:

Out of the box there is no way to reference the %Source value of the recordmap via the UI. You will need to create a custom class as shown in previous replies/answers on this thread.

It is interesting though that if I modify the .int file directly with pContext.Document.%Source and compile, the code compiles AND the rule works.

So this must be a defect in IS code.

Also, it is disappointing that the documentation around RecordMapper usage is so poor that you need to go on this long debug sessions to figure out how things really work.