8.1 Command Transformation - Create Departmental Container - Part 1 and Part 2

This rule creates a department container in the destination data store, if one does not exist. Implement the rule on the Command Transformation policy in the driver. You can implement the rule on either the Subscriber or the Publisher channel or on both channels.

There are two steps involved in using the predefined rules: creating a policy in the Command Transformation policy set and importing the predefined rule. If you already have a Command Transformation policy that you want to add this rule to, skip to Importing the Predefined Rule.

8.1.1 Creating a Policy

  1. From the Outline view or the Policy Flow view, select the Publisher or Subscriber channel.

  2. Select the Command Transformation policy set in the Policy Set view, then click Create or add a new policy to the Policy Set icon Create or Add a New Policy icon to create a new policy.

  3. Click Create a new policy, then click Next.

  4. Name the policy.

  5. Use the default location or browse and select another location to place the policy in the driver.

    Create Policy Wizard
  6. Select Open Editor after creating policy, then click Next.

  7. Select DirXML Script for the type of policy, then click Finish.

  8. A file conflict window appears with the message “Before editing this item you need to save. Do you wish to save the editor’s changes and continue?” Click Yes. The Policy Builder is launched and the new Command Transformation policy is saved.

  9. Continue with Importing the Predefined Rule.

8.1.2 Importing the Predefined Rule

  1. Right-click in the Policy Builder, then click New > Predefined Rule > Insert Predefined Rule Before or Insert Predefined Rule After.

  2. Select Command Transformation - Create Department Container - Part 1, then click OK.

    Command Transformation - Create Department Container Part 1
  3. Right-click in the Policy Builder and click New > Predefined Rule > Insert Predefined Rule Before or Insert Predefined Rule After.

  4. Select Command Transformation - Create Department Container - Part 2, then click OK.

    Command Transformation - Create Department Container Part 2
  5. Save the rule by clicking File > Save.

There is no information to change that is specific to your environment.

IMPORTANT:Make sure that the rules are listed in order. Part 1 must be executed before Part 2.

8.1.3 How the Rule Works

This rule is used when the destination location for an object does not exist. Instead of getting a veto because the object cannot be placed, this rule creates the container and places the object in the container.

Part 1 looks for any Add event. When the Add event occurs, two local variables are set. The first local variable is named target-container. The value of target-container is set to the destination DN. The second local variable is named does-target-exist. The value of does-target-exist is set to the destination attribute value of objectclass. The class is set to OrganizationalUnit. The DN of the OrganizationalUnit is set to the local variable of target-container.

Local Variable

Part 2 checks to see if the local variable does-target-exist is available. It also checks to see if the value of the local variable does-target-exist is set to a blank value. If the value is blank, then an Organizational Unit object is created. The DN of the organizational unit is set to the value of the local variable target-container. It also adds the value for the OU attribute. The value of the OU attribute is set to the local variable of target-container. It uses the source format as the destination DN and the destination format is dot format.