Creating a Rule Template

Rule templates can contain one or more actions.

To create a rule template, use CustomAction.rtp file from Sample Action Rule Templates and User Interface Files.

Procedure

  1. Replace the string CustomAction with the actual custom action name and modify the version, category and subcategory as required.

    Parameters : Similar to action template. Action template requires the rule template to instantiate the policy fragment (unless some parameters are hidden and have a default value in the ActionTemplate). All parameters which the action template use in the policy fragment should have a value set or the velocity engine throws an exception.
  2. Enforcement Point Placement: Unlike the action template which specifies the allowed enforcement point placement, the rule template specifies the exact enforcement point placement for each action referred to in the rule template.

    A rule template can contain multiple action templates. These actions are configured using the parameterSetting tags. There should be a groupParameterSetting for each action that is contained in the rule template. And for each action, a relationship between the rule template parameter and the action template parameter is typically defined using the singleParameterSetting tag as shown in the figure. It is desirable to have the same parameter and parameter group names in the action and rule templates.
  3. Target Object Group information: In addition to the parameter group related to the action, the rule template has another parameter group that is used to define the type of Object Groups the custom policy can be applied to. The parameter group Default should not be changed. The valid object types can be specified by replacing $TYPEOFOBJECT in the template.

    For a list of all valid object types, see Parameters and Action Templates.
  4. UI handle: The Rule template additionally has three tags that serve as the UI handle.

    Change the uiResourcePath variable to the relative path of the UI resource. The uiHandlerType is set to default for UIs based on GI. The hidden parameter determines if the template is visible to the user or not. If set to false, the template is not visible in the policy creation wizard.
  5. Finally, it is a good practice to elevate the version of the template to a higher number (ogsei:templateVersion element value)
    After, these changes are made, the rule template is ready for use. For the complete rule template, see Sample Action Rule Templates and User Interface Files.