Registering controller command names to match in a behavior rule

If you are creating a new trigger, target, or action that specifies a controller command in its behavior rule, you must register the controller command in a custom version of the marketing component configuration file (wc-admin-component.xml). When you register the controller command, you must also specify the Web application paths to exclude when the controller command is run from that Web application. This ensures that the behavior rule will match only for applicable Web applications that use the controller commands.

If your campaign element template definition does not have a behavior rule that matches a controller command, you can skip this step.

Before you begin

To understand the properties that the wc-admin-component.xml file contains, see Marketing component configuration files (wc-admin-component.xml).

Procedure

  1. Open HCL Commerce Developer and switch to the Enterprise Explorer view.
  2. Create a com.ibm.commerce.marketing-ext folder for your customized marketing component configuration file at the following path:

    workspace_dir\WC\xml\config\com.ibm.commerce.marketing-ext\

    If this folder exists and contains a customized version of the wc-admin-component.xml file, or if a customized version exists elsewhere, open the customized version and skip to the next step. If the folder does not exist and contain a customized version, complete these substeps:

    1. Go to the default marketing component configuration file at the following path:

      workspace_dir\WC\xml\config\com.ibm.commerce.marketing\

    2. Copy the wc-admin-component.xml file to the new \xml\config\com.ibm.commerce.marketing-ext\ folder.
    3. Open the copied wc-admin-component.xml in an editor. This copy becomes the customized version of the wc-admin-component.xml file.
  3. Register the controller command specified in your behavior rule in the customized version of the wc-admin-component.xml file:
    1. In the file, locate the following line of code:
      <!-- BEHAVIOR RULE - PROCESS COMMAND ON EXIT -->
    2. Ensure that the command you want to match is not already registered in the file.
    3. To register the command, add two lines of code that use the following syntax:
      <_config:property name="processOnCommandExitcommand_name" value="full_interface_name"/>
      <_config:property name="processOnCommandExitWebappFiltercommand_name" value="webapp1,webapp2,webapp3"/>
      Where:
      • command_name is the name of the controller command specified in the behavior rule.
      • full_interface_name is the full interface name of the controller command.
      • webapp1,webapp2,webapp3 is a comma-separated list of Web applications in which this event should not be matched.

      For example, for a trigger that detects when a customer logs onto the store, the lines of code to register the LogonCmd controller command look like this:

      <_config:property name="processOnCommandExitLogonCmd" value="com.ibm.commerce.security.commands.LogonCmd"/>
      <_config:property name="processOnCommandExitWebappFilterLogonCmd" value="/webapp/wcs/tools/servlet,/webapp/wcs/orgadmin/servlet,/webapp/wcs/admin/servlet"/>

      In the previous example, the second line ensures that logon events will be ignored for any logon commands issued by the administrative tools.

  4. Within the <_config:configgrouping name="MarketingRuntime"> element, remove any properties that are not set differently from the default marketing component configuration file. The customized file must contain only the differences.
  5. Save and close the customized file.
  6. To update the changes in a development environment, start, or restart the test servers.