You can create custom scenario actions for Knowledge Manager and Self Service. ATG provides a sample application module that includes a custom scenario action to demonstrate how to use common ATG Service events.

See information about adding custom events and actions to scenarios in the ATG Personalization Programming Guide.

The sample application module is available in the ATG Service installation directory. The module files are in the following directory.

<ATG10dir>/Service10.1/Service/SampleCRMClient

To install and start the sample application module:

  1. Copy the SampleCRMClient directory to <ATG10dir>.

  2. Set the property LoggingDebug="true" in the following configuration file for your production and agent servers.

    <ATG10dir>/home/servers/servername/localconfig/atg/svc/
    scenario/ActionHelper.properties

  3. Restart your ATG Service servers. Include the SampleCRMClient module on your production server. Include the SampleCRMClient.InternalUsers module on your agent server.

  4. Create a simple scenario on your production or agent server. Include the sample custom action in your scenario. Confirm that log messages are written when the events configured in the scenario occur.

    For example, configure a scenario to execute the custom action whenever an internal user views content in Service Center.

Adding an Action to the Scenario Manager Configuration

The following scenario manager configuration files demonstrate how to make a custom scenario action available in the scenario editor. See information about adding custom events and actions to scenarios in the ATG Personalization Programming Guide.

  • <ATG10dir>/Service10.1/Service/SampleCRMClient/config/atg/
    scenario/scenarioManager.xml

  • <ATG10dir>/Service10.1/Service/SampleCRMClient/InternalUsers/config/atg/scenario/internalScenarioManager.xml

The scenarioManager.xml file shown below associates the action named sampleCRMAction with the class atg.crmintegration.scenario.action.SampleCRMAction.

<process-manager-configuration xml-combine="append">
  <action-registry>
    <action>
      <action-name>sampleCRMAction</action-name>
      <action-class>atg.crmintegration.scenario.action.SampleCRMAction
          </action-class>
      <display-name>Sample CRM Action</display-name>
      <description>Sample CRM Action</description>
      <action-execution-policy>collective</action-execution-policy>
      <action-error-response>continue</action-error-response>
    </action>
  </action-registry>
</process-manager-configuration>
Creating a Custom Action

The following files contain Java classes that implement the custom scenario actions in the sample application module. Use these classes as examples when developing your own custom actions.

The Java classes that implement custom scenario actions extend the class ActionImpl. See information about ActionImpl in the ATG Platform API Reference. See information about adding custom events and actions to scenarios in the ATG Personalization Programming Guide.

The executeAction methods of the example classes perform specific actions based on Knowledge Manager and Self Service scenario events.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices