Sun Identity Manager 8.1 Business Administrator's Guide

ProcedureTo View the Accept All Dates Sample Rule

This section describes the built-in Accept All Dates sample rule.

  1. In a text editor, open ReconRules.xml, which is located in Identity Manager’s sample directory.

  2. Search for the rule named SCHEDULING_RULE_ACCEPT_ALL_DATES.

    In order for a rule to be listed in the TaskSchedule Repetition Rule drop-down menu (on the Edit Reconciliation Policy page), the rule’s subtype attribute must be set to SUBTYPE_TASKSCHEDULE_REPETITION_RULE:


    <Rule subtype=’SUBTYPE_TASKSCHEDULE_REPETITION_RULE’ 
    name=’SCHEDULING_RULE_ACCEPT_ALL_DATES’>

    As noted previously, Task Schedule Repetition rules can modify the default reconciliation schedule.

    The variable calculatedNextDate can either accept the next date, which is calculated in the default manner, or return a different date. As it is written in the sample rule, calculatedNextDate unconditionally accepts the default date, as shown in the following excerpt:


    <RuleArgument name=’calculatedNextDate’/>
    <block>
      <ref>calculatedNextDate</ref>
    </block>

    To create a custom schedule, replace the rule logic in between the <block> elements. For example, to change the reconciliation start time to 10:00 AM on Saturdays, include the following JavaScript in between the <block> elements:


    <block>
      <script>
         var calculatedNextDate = env.get(’calculatedNextDate’);
    
        // Test to see if this task is scheduled for a Saturday
        // (Note that 6 is used to denote Saturday in JavaScript)
        if(calculatedNextDate.getDay() == 6) {
          // If so, set the time to 10:00:00
          calculatedNextDate.setHours(10);
          calculatedNextDate.setMinutes(0);
          calculatedNextDate.setSeconds(0);
        }
        // Return the modified date
        calculatedNextDate;
      </script>
    </block>

    In To View the Accept All Dates Sample Rule, calculatedNextDate is initially set to the default scheduled time. If the next scheduled run date is a Saturday, then the rule schedules reconciliation to start at 10:00. If the next scheduled run date is not a Saturday, To View the Accept All Dates Sample Rule returns calculatedNextDate without making any time adjustments, and the default schedule is used.

    For more information about creating custom rules for use in Identity Manager, see Chapter 5, Working with Rules, in Sun Identity Manager Deployment Reference.