Using_policy clause


Policy instances can be referenced before the selection part of a rule as shown in the following example:

new bmc_im_internal_closure:
using_policy { EVENT_CLOSURE_POLICY($POL)
where [ calendars_active($POL.active_calendars) ] }
$POL.closing_event($CLOSING)
where [ $CLOSING.status != CLOSED ]
   updates ALL $POL.closed_event($CLOSED)
   within $POL.time_window
{
   $CLOSED.status = CLOSED;
      if ($POL.suppress_restoring_event == 1) then
      {
         drop_new;
      }
}

Each instance of EVENT_CLOSURE_POLICY is instantiated at run time. The closing_event and closed_event criteria are linked at run time.

ECF slots can be used in place of the class name in the main selection of a static rule. Where clauses specified in the rule are logically ANDed with the where clause in the ECF instance.

QUERY slots can be used in place of class names in using or update selections of a static rule. Where clauses specified in the rule are logically ANDed with the where clause of the QUERY instance.

This construct is called a DynamicSelection and is defined as follows:

<DynamicSelection>=
   
[ using_policy [ALL] '{' [ <UsingCriteria> { <UsingCriteria> } ] '}' ]
<DynamicCriteria>
[ using [ ALL ] '{'
[ <DynamicCriteria> { <DynamicCriteria> } ] '}' ]
<DynamicCriteria> =  
<VariableSlot>  
[ ( <Variable> ) ] [ where '[' [ <SlotExp> ] ']' ] ¦ <Criteria>
<Criteria> = <Class>
[ ( <Variable> ) ] [ where '[' [ <SlotExp> ] ']'  ]
<UsingCriteria> = <Class> [ '(' <Variable> ')' ] [ <Where> ] [ <Sorting> ]

The compiler ensures that the queries used in a dynamic selection respects the order of the query definitions. The compiler compiles the rule, taking into account the class for which the ECF and QUERYslots are defined. Only the slots of these classes can be referenced in the rest of the rule.

using_policy [ALL] executes the rule for all policy instances.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC ProactiveNet 9.6