Download Blaze Trial
Follow FICO
LinkedIn   Twitter   Youtube
Close To access this section, please choose the Community Neighborhood in which you have the most interest.

» Business Rules Management
» Collections & Recovery
» Fraud Management
» Risk Management
» Scoring
Close To access this section, please choose the Community Neighborhood in which you have the most interest.

» Business Rules Management
» Collections & Recovery
» Fraud Management
» Risk Management
» Scoring
Reply
Regular Visitor
dcovaliu
Posts: 5
Registered: ‎05-29-2012
Accepted Solution

Getting a reference to the parent ruleset (template) at authoring time

Hi,

 

I am having trouble with the following scenario:

 

I have 2 ruleset templates, each using the same rule template. Somewhere in the action template in the rule, I am invoking a DB provider having a parameter. My problem is, the value of this parameter, at authoring time depends on the ruleset template to which this action template instance belongs, at the moment of rule editing. I don't know how to say in the action template "if your being edited under the ruleset template 1 the parameter is whatever1, else whatever2. I hope this is clear...

 

Thank you!

Valued Contributor
Posts: 169
Registered: ‎03-12-2009

Re: Getting a reference to the parent ruleset (template) at authoring time

Hi,

 

     This request is a little foggy but let me give it a try.  Since a rule template is a child of a ruleset template, my suggestion would be first to try creating a provider in the ruleset template, and then a value holder for it.  Then, when you need to use the value holder in the rule template, choose to use an existing value holder and pick the one created in the ruleset template.  For the second ruleset template, create a value holder with the same name but different parameters for the provider.

 

     The other option is to pass a "template parameter" from the ruleset to the rule template and use conditional generation to make the correct selection.

 

     Good Luck,

 

     Tom Sheckells

     Business Rules Consulting, Inc.

Regular Visitor
dcovaliu
Posts: 5
Registered: ‎05-29-2012

Re: Getting a reference to the parent ruleset (template) at authoring time

[ Edited ]

Hi Tom,

 

Thank you for the prompt response. The second solution is N/A, because I am referring to rule authoring time, or design time, or rule editing (I don't know how to call it). Variables and parameters are playing their part at run time or rule execution time. Me, with my parametrized DB provider, I am just trying to help rule authors to pick values from a list. These values come, obviously, from a DB, and are supposed to be filtered by context. The context being provided, hopefully, by the ruleset template instance in which they belong at edit time. I hope this sheds more light.

 

I am trying the first solution, but all 3 artifacts, the 2 ruleset templates and the rule template are public. I cannot choose an existing value holder in this case. To quote you, "...and pick the one created in the ruleset template", I would ask, which ruleset template, because there would be a VH in each one and picking one would mean a hard coded reference. When I edit the rule It should dynamically display the correct values depending on the ruleset context.

Valued Contributor
Posts: 169
Registered: ‎03-12-2009

Re: Getting a reference to the parent ruleset (template) at authoring time

Hi dcovaliu,

 

     You should look up template parameter in the documentation.  They are a "rule authoring" time parameter.

 

     As to your second point,  a reusable template for a rule is "hooked" to a ruleset when you are assembling your templates.  That is the time when a value holder is "selected", not when the template is initially created.  So, when you are assembling your "rule" template into "Ruleset Template 1" a value holder can be selected, and when you start working on "Ruleset Template 2" assembly the assembly does not have to be exactly the same.

 

     Tom Sheckells

     Business Rules Consulting, Inc.

Regular Visitor
dcovaliu
Posts: 5
Registered: ‎05-29-2012

Re: Getting a reference to the parent ruleset (template) at authoring time

The Template Arguments was the answer! Thank you!