- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Getting a reference to the parent ruleset (template) at authoring time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-29-2012 12:11 PM
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!
Solved! Go to Solution.
Re: Getting a reference to the parent ruleset (template) at authoring time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content
05-29-2012 12:39 PM
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.
Re: Getting a reference to the parent ruleset (template) at authoring time
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content
05-29-2012 01:14 PM - edited 05-29-2012 01:20 PM
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.
Re: Getting a reference to the parent ruleset (template) at authoring time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Accept as Solution
- Email to a Friend
- Report Inappropriate Content
05-29-2012 03:15 PM
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.
Re: Getting a reference to the parent ruleset (template) at authoring time
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Not the Solution
- Email to a Friend
- Report Inappropriate Content
05-31-2012 12:30 PM
The Template Arguments was the answer! Thank you!

