com.ibm.commerce.ubf.event

Class BusinessFlowEventListener

  • java.lang.Object
    • com.ibm.commerce.event.EventComponentConfiguration
      • com.ibm.commerce.ubf.event.BusinessFlowEventListener
  • All Implemented Interfaces:
    com.ibm.commerce.event.WCSEventListener, com.ibm.commerce.server.ComponentConfiguration, java.util.EventListener


    public class BusinessFlowEventListener
    extends com.ibm.commerce.event.EventComponentConfiguration
    implements com.ibm.commerce.event.WCSEventListener
    BusinessFlowEventListener is registered through demo.xml and will be instanciated during WCS Start-up time. When a BusinessFlowEvent is raised, WCSEventSource will route the event to this class by calling the method: processActivityEvent(com.ibm.commerce.event.WCSEvent event). This class is the runtime engine for UBF, in which all processing is done here.
    See Also:
    BusinessFlowEvent, BusinessFlowEventData, EventComponentConfiguration
    • Field Summary

      • Fields inherited from interface com.ibm.commerce.event.WCSEventListener

        COPYRIGHT
      • Fields inherited from interface com.ibm.commerce.server.ComponentConfiguration

        COPYRIGHT
    • Constructor Summary

      Constructors 
      Constructor and Description
      BusinessFlowEventListener()
      Construct a BusinessFlowEventListener object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void destroy()
      Remove BusinessFlowListener from WCSEventSource.
      void enable(boolean enable)
      Add or remove BusinessFlowEventListener from WCSEventSource.
      boolean isTransactionRequired()
      Get information about whether a transaction is required.
      void processActivityEvent(com.ibm.commerce.event.WCSEvent event)
      Process a BusinessFlowEvent.
      void throwECException(com.ibm.commerce.exception.ECApplicationException anException, BusinessFlowEventData data)
      Add errorMessage, errorStatus, and responseView into responseProeprties, which is set into the exception, finally throw the exception.
      • Methods inherited from class com.ibm.commerce.event.EventComponentConfiguration

        init
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BusinessFlowEventListener

        public BusinessFlowEventListener()
                                  throws java.lang.Exception
        Construct a BusinessFlowEventListener object. This method will be called at WCS start-up time.
        Throws:
        java.lang.Exception
    • Method Detail

      • destroy

        public void destroy()
        Remove BusinessFlowListener from WCSEventSource.
        Specified by:
        destroy in interface com.ibm.commerce.server.ComponentConfiguration
        Specified by:
        destroy in class com.ibm.commerce.event.EventComponentConfiguration
      • enable

        public void enable(boolean enable)
                    throws java.lang.Exception
        Add or remove BusinessFlowEventListener from WCSEventSource.
        Specified by:
        enable in interface com.ibm.commerce.server.ComponentConfiguration
        Specified by:
        enable in class com.ibm.commerce.event.EventComponentConfiguration
        Parameters:
        enable - The flag to indicate whether BusinessFlowEventListener needs to be added or removed from WCSEventSource.
        Throws:
        java.lang.Exception - If the execution fails.
      • isTransactionRequired

        public boolean isTransactionRequired()
        Get information about whether a transaction is required.
        Specified by:
        isTransactionRequired in interface com.ibm.commerce.event.WCSEventListener
        Returns:
        true if a transaction is needed.
      • processActivityEvent

        public void processActivityEvent(com.ibm.commerce.event.WCSEvent event)
                                  throws com.ibm.commerce.exception.ECException
        Process a BusinessFlowEvent. This method is the center of UBF runtime, proceesing all logic, handling guard checking (business logic and access control), exit action, transition action, entry action, response etc.
        Specified by:
        processActivityEvent in interface com.ibm.commerce.event.WCSEventListener
        Parameters:
        event - The event raised by application to contain information about the request.
        Throws:
        com.ibm.commerce.exception.ECException - If the command instantiation and execution fails.
      • throwECException

        public void throwECException(com.ibm.commerce.exception.ECApplicationException anException,
                                     BusinessFlowEventData data)
                              throws com.ibm.commerce.exception.ECApplicationException
        Add errorMessage, errorStatus, and responseView into responseProeprties, which is set into the exception, finally throw the exception. So we can display a JavaScript error dialog box in ToolsFrameWork environment.
        Parameters:
        anException - The ECApplicationException gets passed in for processing.
        data - The BusinessFlowEventData which contains information related to the request.
        Throws:
        com.ibm.commerce.exception.ECApplicationException - The ECApplicationException will get thrown after processing.