Question
Blake Herlick · Oct 21, 2022

Need to derive Routing Rule Targets

Hello ALL!

I am having trouble fining a way to derive (a list, an array, a file doesnt matter yet how it returns) ALL of the targets of a routing rule.

For example lets say I have:

  • a router of class: EnsLib.MsgRouter.RoutingEngine
  • Business Rule: HappyRRN
  • 1 rule set having 5 rules that each send to 1 DTL and 1 Operation (5 targets total)

My intent is to use some utlities we have created to disable all of the target operations of this router if the router errors out.

To do that I need the list of target operations.

I suppose i could load the acutal .cls and $EXTRACT but I was hoping (since we can SEE the targets when we click on the router in the front end) there was a already exisitng function, method or SQL to do this.

 

thanks!

Product version: Ensemble 2018.1
1
0 113
Discussion (2)2
Log in or sign up to continue

Hi Blake,

This might get you started in the right direction:

Set tRuleName = "<rulename>"
Set tTarget = $ORDER(^Ens.Rule.Targets(tRuleName,""))
Set tArr = 0
Set tCnt = 1
While tTarget '= ""
{
    Set tArr(tCnt) = tTarget
    Set tTarget = $ORDER(^Ens.Rule.Targets(tRuleName,tTarget))
    Set tArr = tCnt
    Set tCnt = tCnt + 1
}

Replace <rulename> with the name of the rule as it appears in the router configuration pane.

Yep I think this will work great. Thanks Jeffery, you are always helpful!