ILOG JRules User Guide > Writing Rules > Tasks > Creating Business Rules > Setting Up a Business Rule Template

If you want to create a number of business rules with similar content and structure, you can create a business rule template, and protect (freeze) parts or all of a template so that they cannot be edited in the business rules created from the template.

If you change the freeze/unfreeze settings in the template, you can use a specific command to reflect the change in the rules created from it. However, if you change the template content, you can reflect these changes only by manually updating the associated business rules.

You build business rules in a template in the same way that you create a normal business rule, except that:

To create a business rule template:

  1. Select your rule project and on the File menu click New > Business Rule Template.
  2. The New Business Rule Template wizard opens.
  3. The default directory for templates to be saved is the templates folder in your rule project. If you want to save your template to a folder inside the templates folder, click Browse in the Folder field and navigate to the required folder.
  4. Type the name of your business rule in the Name field.
  5. Click Finish.
  6. The new business rule template appears in the folder you specified, and the Business Rule Template Guided Editor opens.
  7. Using the Guided Editor, build the contents of the template, leaving those parts of the rule empty where variations are likely to occur.
  8. Save your work.

Freeze parts through the Business Rule Template Guided Editor.

To freeze and unfreeze one or more parts of a business rule template:

  1. In the Business Rule Template Guided Editor, right-click each part that you want to freeze, and click Freeze.
  2. The part(s) you have frozen are grayed out. Note that fields are still shown in blue, indicating that you can still edit them.
    Note
    If you keep the same structure, the freeze information is kept. However, the freeze information is lost if you change the structure of the rule.
  3. To unfreeze a part of a business rule template, in the Business Rule Template Guided Editor, right-click the part that you want to unfreeze, and click Unfreeze.
  4. The part(s) you have unfrozen are shown in black.

You can also freeze the whole template. This action freezes everything except the place holders. These are still shown in blue, indicating that you can still edit them.

To freeze or unfreeze the whole template:

  1. Right-click anywhere in the Business Rule Template Guided Editor, and click Freeze All.
  2. To unfreeze the whole template, right-click anywhere in the Business Rule Template Guided Editor, and click Unfreeze All.
    Note
    The Freeze and the Freeze All functions also freeze the black arrow icon images/typeselect_icon.png that allows policy managers to change whether they edit a value or select an item. To allow them to make this choice, unfreeze the symbol.

To propagate changes to a template's freeze/unfreeze settings:

  1. In the Rule Explorer, select the template.
  2. Right-click the template and click Business Rule Template > Apply Freeze Information.
  3. The new freeze or unfreeze setting in the template is propagated through to the business rules created from the template.

Related Concepts

Business Rules
Business Rule Templates
Rule Project

Related Tasks

Creating Business Rules

Related Reference

Business Rule Guided Editor
Intellirule Template Editor
Business Action Language

Related Samples and Tutorials

Tutorial: Creating Business Rules