Because many of the actions taken by an agent in Commerce Service Center are captured in the agent audit log, as well as ticket activities, Commerce Service Center provides a convenient way of creating a ticket activity from an AgentEvent.

The process mirrors that of recording an audit event whereby an AgentEvent is routed to a recorder component, which saves the information in the repository. The recorders are mapped by the activity type. Commerce Service Center provides classes for the most common cases of creating activities from the events.

The following steps outline what is needed to record an AgentEvent as a ticket activity. This assumes that the AgentEvent and audit log repository definitions are already in place.

  1. Define the new activity type in the TicketingRepository. You can define the ticket activity much the same as the audit log definition for the same type. However, the ticket activity definition can be defined as needed to meet your requirements.

  2. Create the recorder components. The recorder component generates a ticket activity from an AgentEvent. Commerce Service Center provides two classes for the most common cases, the atg.commerce.csr.ticketing.
    TicketingActivityRecorder
    class and the TicketingPropertyUpdateRecorder class.

    The TicketingActivityRecorder class is the base class for a recorder and supports the following features:

    The TicketingPropertyUpdateRecorder class is an extension of TicketingActivityRecorder that supports recording an AgentEvent that contains a List or PropertyUpdates. For example:

    /myapp/recorders/LoyaltyPointRecorder

      class=atg.commerce.csr.ticketing.TicketingActivityRecorder
      applicationName=MyApplicationName
      internalProfileRepository=/atg/userprofiling/InternalProfileRepository
      orderRepository=/atg/commerce/order/OrderRepository
      profileRepository=/atg/userprofiling/ProfileAdapterRepository
      ticketingManager=/atg/ticketing/TicketingManager

      customProperties=\
      pointsRedeemed=pointsRedeemed,\
      orderId=orderId

      CSRAgentTools=/atg/commerce/custsvc/util/CSRAgentTools
      ordersPropertyName=orders
      saveTransientOrderActivities=false

  3. Register the recorder component by activity type. Map the new recorder component by its activity type so an AgentEvent of the same type will be routed to it for processing. For example:

    /atg/commerce/custsvc/ticketing/TicketingEventListener.properties#13
    $$Change: 447205 $

    eventTypeToRecorderMap+=\
      RedeemedLoyaltyPoints=/myapp/recorders/LoyaltyPointRecorder


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