com.ibm.commerce.bi.events

Class EventProcessorCmdImpl

  • All Implemented Interfaces:
    EventProcessorCmd, AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class EventProcessorCmdImpl
    extends ControllerCommandImpl
    implements EventProcessorCmd
    This command, designed to be run by the scheduler, is needed to do further processing on analytics events that have been raised and persisted in the BUSEVENT table so they can be transmitted in a batch to an external (non-WebSphere Commerce) analytics system.
    Alternately the command is also invoked by the business event file generation utility which is used to save the processed events to an XML file instead of transmitting the events to an external (non-WebSphere Commerce) analytics system.
    If Analytics Event Configuration component is enabled, 200 events are fetched and updated from 'process' state (default -10) to 'inProcess' state (default -15). Any qualifying analytics events (events for stores that are enabled, with the correct type, transport and channel ID's) in this batch are transformed and then transmitted to the analytics system, and then updated to purge state. Any non-qualifying events in this batch are updated to purge state (default -20). This process of fetching and processing 200 events is repeated until the maxBatchSize analytics events are processed. If maxBatchSize is set to -1, then the batching will continue until all the events in the BUSEVENT table are processed.
    If Analytics Event Configuration component is disabled or stores is disabled, up to getMaxEventsToPurge() (default 500,000) events in the process state (-10) are deleted from the BUSEVENT table in batches of 5000.
    Note: CleanECEvent is a separate scheduled job that runs periodically to delete jobs that are in the purge state.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright
        See Also:
        Constant Field Values
      • OUTPUT_XML

        public static final java.lang.String OUTPUT_XML
        The output format for an XML result.
        See Also:
        Constant Field Values
      • OUTPUT_NONE

        public static final java.lang.String OUTPUT_NONE
        The output format for no output, or silent operation. This is the default output format.
        See Also:
        Constant Field Values
    • Constructor Detail

      • EventProcessorCmdImpl

        public EventProcessorCmdImpl()
        Creates an instance of the event processor.
    • Method Detail

      • setMaxEvents

        public void setMaxEvents(int max)
        Sets the maximum number of analytics events to process in this run. This attribute is used when the EventProcessorCmd is invoked by the command line utility which saves the event data in a xml file.
        Specified by:
        setMaxEvents in interface EventProcessorCmd
        Parameters:
        max - the maximum number of events to process
      • setOutput

        public void setOutput(java.lang.String format)
        Sets the output format. The possible output formats are 'xml' and 'none' In the common case, this command will be executed by the scheduler and so doesnt require any output or view to be sent as a response. However, if set to xml, all of the transformed event XMLs will be returned as part the response view. This output mode is used for the File Generation Utility.
        Specified by:
        setOutput in interface EventProcessorCmd
        Parameters:
        format - One of OUTPUT_XML or OUTPUT_NONE.
      • setStoreId

        public void setStoreId(java.lang.Integer storeId)
        Sets the ID of the store of which events will be processed
        Specified by:
        setStoreId in interface EventProcessorCmd
        Parameters:
        storeId - the ID of the store of which events will be processed
      • performExecute

        public void performExecute()
                            throws ECException
        If Analytics Event Configuration component is enabled, 200 events are fetched and updated from 'process' state (default -10) to 'inProcess' state (default -15). Any qualifying analytics events (events for stores that are enabled, with the correct type, transport and channel ID's) in this batch are transformed and then transmitted to the analytics system, and then updated to purge state. Any non-qualifying events in this batch are updated to purge state (default -20). This process of fetching and processing 200 events is repeated until the maxBatchSize analytics events are processed. If maxBatchSize is set to -1, then the batching will continue until all the events in the BUSEVENT table are processed.
        If Analytics Event Configuration component is disabled or stores is disabled, up to getMaxEventsToPurge() (default 500,000) events in the process state (-10) are deleted from the BUSEVENT table in batches of 5000.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • purgeEvents

        public static void purgeEvents(int numEventsToPurge,
                                       int processState,
                                       int purgeState)
                                throws ECApplicationException
        Updates the CHECKED state of the specified number of events in the BUSEVENT table from 'process' to 'purge'. This is committed in batches of 5000.
        Parameters:
        numEventsToPurge - The maximum number of events to purge
        processState - The integer value which represents the process state of an event, by default -10.
        purgeState - The integer value which represents the purge state of an event, by default -20.
        Throws:
        ECApplicationException