Neil Graham

Template Arguments example for newbie?

Discussion created by Neil Graham on Jan 25, 2011
Latest reply on Feb 3, 2011 by Neil Graham

Hello,

 

Can someone provide any hints or examples of using template arguments?

 

I'm trying to structure my project such that I have a number of top-level reusable ruleset templates that use a NameVH in another top-level template.   I only want to type in the value for the NameVH once, but want to use it as placeholders for the label, ruleset name fields etc. to ensure my rules, rulesets, ruleflow all have unique instance names in my other top level templates.

This is pretty much exactly how the description on the docs indicates it should work (as below) but I usually get an error indicating I can't do so because I can't include a top-level or structured template.

 

Clearly I'm missing something :smileyhappy:  Any help would be greatly appreciated!

 

Fu

 

From the Developing Rule Maintenance Applications doc (they use "state" where I would want "Name"):

The primary purpose of template arguments is to facilitate the reuse of common set of templates. For example, suppose you have rules that vary from state to state. The functionality and structure of the rules is the same, but various names throughout the rules and ruleset items need to reflect the individual state name. You could develop a ruleset template with a regular Value Holder for the state name. You could then develop additional templates, for the rules and other ruleset items, that each included a template argument for the state name. The original ruleset template would also include Value Holders that reference the other templates. When the business user of the RMA goes to create the rules for a particular state, they enter the state name once, when they create the Instance for the ruleset. That value is then propagated to all of the other templates that are referenced by the ruleset template.

Outcomes