atg.commerce.markers.bp
Class CommerceBusinessProcessManager

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.markers.bp.BusinessProcessManager
              extended by atg.commerce.markers.bp.CommerceBusinessProcessManager
All Implemented Interfaces:
BusinessProcessConstants, MarkerConstants, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class CommerceBusinessProcessManager
extends BusinessProcessManager

This class extends BusinessProcessManager to provide processing for business process configurations that are an instance of atg.commerce.markers.bp.OrderBasedProcessConfiguration

See Also:
BusinessProcessManager, OrderBasedProcessConfiguration

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String COMMERCE_BUSINESS_PROCESS_RESOURCE_NAME
          The resource bundle name for user resources
static java.util.ResourceBundle sCommerceBusinessProcessResourceBundle
          The resource bundle gor user resources
 
Fields inherited from class atg.markers.bp.BusinessProcessManager
mBusinessProcessConfiguration, mBusinessProcessNameToConfiguration, mGenerateEvents, mMarkerMessageSource, mStageReachedJMSType, mTransactionManager
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.markers.bp.BusinessProcessConstants
BUSINESS_PROCESS_RESOURCE_NAME, sBusinessProcessResourceBundle
 
Fields inherited from interface atg.markers.MarkerConstants
ALLOW_DUPLICATES, ANY_VALUE, DEFAULT_MARKER_ID_PROPERTY_NAME, DEFAULT_MARKER_ITEM_TYPE, DEFAULT_MARKER_PROPERTY_NAME, DEFAULT_MARKER_SORT_PROPERTY_NAME, MARKER_CREATIONDATE_PROPERTY_NAME, MARKER_DATA_PROPERTY_NAME, MARKER_DUPLICATIONMODE_PROPERTY_NAME, MARKER_KEY_PROPERTY_NAME, MARKER_OWNER_PROPERTY_NAME, MARKER_RESOURCE_NAME, MARKER_VALUE_PROPERTY_NAME, NO_DUPLICATES, PARAM_DATA, PARAM_DUPMODE, PARAM_EXTENDED_PROPERTIES, PARAM_ITEM, PARAM_ITEM_ID, PARAM_KEY, PARAM_MARKED_ITEM_TYPE, PARAM_MARKER_ITEM_TYPE, PARAM_MARKER_MANAGER, PARAM_MARKER_PROPERTY_NAME, PARAM_VALUE, REPLACE_DUPLICATES, sResourceBundle
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
CommerceBusinessProcessManager()
           
 
Method Summary
 RepositoryItem addBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.lang.String pMarkerItemType, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties, java.lang.String pDuplicationMode)
          Adds a business process marker to the order defined by the business process configuration.
 RepositoryItem addBusinessProcessStageToOrder(Order pOrder, java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.lang.String pMarkerItemType, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties, java.lang.String pDuplicationMode)
          Adds a business process marker to an order.
 int deleteBusinessProcessMarkers(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage)
          Use this method to delete all markers that match the input parameters.
 int deleteOrderBasedBusinessProcessMarkers(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.util.Map pExtendedProperties)
          Use this method to delete all markers that match the input parameters.
protected  OrderBasedProcessConfiguration findOrderBasedProcessConfiguration(java.lang.String pBusinessProcessName)
          Finds an order based business process configuration component using the business process name
 java.sql.Timestamp findProcessStartTime(Order pOrder, java.lang.String pBusinessProcessName, java.lang.String pMarkerPropertyName)
          This method determines the time an order started a business process.
 boolean hasBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties)
          Use this method to test for a business process marker.
 RepositoryItem matchMostRecentBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties)
          Use this method to match the most recent marker for a business process.
 RepositoryItem matchMostRecentBusinessProcessStageOnOrder(Order pOrder, java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties)
          Use this method to match the most recent marker for a business process.
 boolean orderHasBusinessProcessStage(Order pOrder, java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties)
          Use this method to test for a business process marker on an order.
 int removeBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties)
          Use this method to remove markers for a business process.
 int removeBusinessProcessStageFromOrder(Order pOrder, java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.lang.String pMarkerPropertyName, java.util.Map pExtendedProperties)
          Use this method to remove markers for a business process.
 
Methods inherited from class atg.markers.bp.BusinessProcessManager
addBusinessProcessStage, addBusinessProcessStageToItem, createBusinessProcessStageReachedEvent, createBusinessProcessStageReachedEvent, deleteItemBasedBusinessProcessMarkers, doStartService, findBusinessProcessNames, findBusinessProcessStages, findItemBasedProcessConfiguration, findProcessStartTime, findStageSequenceNumber, getBusinessProcessConfigurations, getBusinessProcessNameToConfiguration, getConfiguration, getMarkerMessageSource, getNamesAndStages, getStageReachedJMSType, getTransactionManager, hasBusinessProcessStage, isGenerateEvents, itemHasBusinessProcessStage, matchMostRecentBusinessProcessStage, matchMostRecentBusinessProcessStageOnItem, removeBusinessProcessStage, removeBusinessProcessStageFromItem, sendBusinessProcessEvent, sendBusinessProcessStageReachedEvent, setBaseBusinessProcessEventProperties, setBaseBusinessProcessEventProperties, setBusinessProcessConfigurations, setGenerateEvents, setMarkerMessageSource, setStageReachedJMSType, setTransactionManager
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

COMMERCE_BUSINESS_PROCESS_RESOURCE_NAME

public static final java.lang.String COMMERCE_BUSINESS_PROCESS_RESOURCE_NAME
The resource bundle name for user resources

See Also:
Constant Field Values

sCommerceBusinessProcessResourceBundle

public static final java.util.ResourceBundle sCommerceBusinessProcessResourceBundle
The resource bundle gor user resources

Constructor Detail

CommerceBusinessProcessManager

public CommerceBusinessProcessManager()
Method Detail

addBusinessProcessStage

public RepositoryItem addBusinessProcessStage(java.lang.String pBusinessProcessName,
                                              java.lang.String pBusinessProcessStage,
                                              java.lang.String pData,
                                              java.lang.String pMarkerItemType,
                                              java.lang.String pMarkerPropertyName,
                                              java.util.Map pExtendedProperties,
                                              java.lang.String pDuplicationMode)
                                       throws BusinessProcessException,
                                              MarkerException
Adds a business process marker to the order defined by the business process configuration.

This method calls the addBusinessProcessStageToOrder method if the business process configuration is an instance of atg.commerce.markers.bp.OrderBasedProcessConfiguration. Otherwise super is called.

Overrides:
addBusinessProcessStage in class BusinessProcessManager
Throws:
BusinessProcessException
MarkerException
See Also:
addBusinessProcessStageToOrder(atg.commerce.order.Order, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)

addBusinessProcessStageToOrder

public RepositoryItem addBusinessProcessStageToOrder(Order pOrder,
                                                     java.lang.String pBusinessProcessName,
                                                     java.lang.String pBusinessProcessStage,
                                                     java.lang.String pData,
                                                     java.lang.String pMarkerItemType,
                                                     java.lang.String pMarkerPropertyName,
                                                     java.util.Map pExtendedProperties,
                                                     java.lang.String pDuplicationMode)
                                              throws BusinessProcessException,
                                                     MarkerException
Adds a business process marker to an order.

If an order is provided in pOrder, the caller is responsible for doing the order update. If an order is not provided, the order returned by the configuration component's findOrder method is used and order update is called automatically.

If pMarkerPropertyName is not provided, the markerPropertyName returned by the OrderBasedProcessConfiguration is used.

If pMarkerItemType is not provided, the markerItemType returned by the OrderBasedProcessConfiguration is used.

If pDuplicationMode is not provided, the duplicationMode returned by the OrderBasedProcessConfiguration is used.

Parameters:
pOrder - the order that will be marked. if null, the order defined by the business process is used.
pBusinessProcessName - the marker key.
pBusinessProcessStage - the marker value.
pData - the marker data
pMarkerItemType - the item type of the marker to be created.
pMarkerPropertyName - name of the order property that contains the collection of markers.
pExtendedProperties - the marker extended properties
pDuplicationMode - the duplication mode used when adding the marker.
Returns:
the marker item
Throws:
BusinessProcessException
MarkerException

removeBusinessProcessStage

public int removeBusinessProcessStage(java.lang.String pBusinessProcessName,
                                      java.lang.String pBusinessProcessStage,
                                      java.lang.String pData,
                                      java.lang.String pMarkerPropertyName,
                                      java.util.Map pExtendedProperties)
                               throws BusinessProcessException,
                                      MarkerException
Use this method to remove markers for a business process. All markers that match the parameter values are removed.

This method calls the removeBusinessProcessStageFromOrder method if the business process configuration is an instance of atg.commerce.markers.bp.OrderBasedProcessConfiguration. Otherwise, super is called.

Overrides:
removeBusinessProcessStage in class BusinessProcessManager
Throws:
BusinessProcessException
MarkerException
See Also:
removeBusinessProcessStageFromOrder(atg.commerce.order.Order, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)

removeBusinessProcessStageFromOrder

public int removeBusinessProcessStageFromOrder(Order pOrder,
                                               java.lang.String pBusinessProcessName,
                                               java.lang.String pBusinessProcessStage,
                                               java.lang.String pData,
                                               java.lang.String pMarkerPropertyName,
                                               java.util.Map pExtendedProperties)
                                        throws BusinessProcessException,
                                               MarkerException
Use this method to remove markers for a business process. All markers that match the parameter values are removed.

If an order is provided in pOrder, the caller is responsible for doing the order update. If an order is not provided, the order returned by the configuration component's findOrder method is used and order update is called automatically.

If pMarkerPropertyName is not provided, the markerPropertyName returned by the OrderBasedProcessConfiguration is used.

All markers that match are removed. For a match to be successful, all the marker properties must match the parameter values provided. Use null for a parameter value if the associated property was originally created with null. For string properties that are not null but should not be included in the match, use the atg.markers.MarkerConstants.ANY_VALUE token string. This string indicates that the property can be any value for a successful match.

If the extended properties map is null then none of the extended properties will be included in the match.

For instance, using ANY_VALUE for pBusinessProcessStage will remove all markers for the given business process name.

Parameters:
pOrder - the order that contains the markers. if null, the order defined by the business process is used.
pBusinessProcessName - marker key to match
pBusinessProcessStage - marker value to match
pData - the marker data to match
pMarkerPropertyName - name of the order property that contains the collection of markers.
pExtendedProperties - the marker extended properties
Returns:
number of markers removed
Throws:
BusinessProcessException
MarkerException

hasBusinessProcessStage

public boolean hasBusinessProcessStage(java.lang.String pBusinessProcessName,
                                       java.lang.String pBusinessProcessStage,
                                       java.lang.String pData,
                                       java.lang.String pMarkerPropertyName,
                                       java.util.Map pExtendedProperties)
                                throws BusinessProcessException,
                                       MarkerException
Use this method to test for a business process marker. The test will be successful if a marker is found with property values that match the parameter values.

This method calls the orderHasBusinessProcessStage method if the business process configuration is an instance of atg.commerce.markers.bp.OrderBasedProcessConfiguration. Otherwise, super is called.

Overrides:
hasBusinessProcessStage in class BusinessProcessManager
Throws:
BusinessProcessException
MarkerException
See Also:
orderHasBusinessProcessStage(atg.commerce.order.Order, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)

orderHasBusinessProcessStage

public boolean orderHasBusinessProcessStage(Order pOrder,
                                            java.lang.String pBusinessProcessName,
                                            java.lang.String pBusinessProcessStage,
                                            java.lang.String pData,
                                            java.lang.String pMarkerPropertyName,
                                            java.util.Map pExtendedProperties)
                                     throws BusinessProcessException,
                                            MarkerException
Use this method to test for a business process marker on an order. The test will be successful if a marker is found with property values that match the parameter values.

For a match to be successful, all the marker properties must match the parameter values provided. Use null for a parameter value if the associated property was originally created with null. For string properties that are not null, but should not be included in the match, use the atg.markers.MarkerConstants.ANY_VALUE token string. This string indicates that the property can be any value for a successful match.

If the extended properties map is null then none of the extended properties will be included in the match.

For instance, using ANY_VALUE for pBusinessProcessStage will attempt to find a matching marker using only the business process name.

Parameters:
pOrder - the order that contains the markers. if null, the order defined by the business process is used.
pBusinessProcessName - the marker key to match.
pBusinessProcessStage - the marker value to match
pData - the marker data to match.
pMarkerPropertyName - name of the order property that contains the collection of markers.
pExtendedProperties - the marker extended properties to match
Returns:
true if the marker is found
Throws:
BusinessProcessException
MarkerException

matchMostRecentBusinessProcessStage

public RepositoryItem matchMostRecentBusinessProcessStage(java.lang.String pBusinessProcessName,
                                                          java.lang.String pBusinessProcessStage,
                                                          java.lang.String pData,
                                                          java.lang.String pMarkerPropertyName,
                                                          java.util.Map pExtendedProperties)
                                                   throws BusinessProcessException,
                                                          MarkerException
Use this method to match the most recent marker for a business process. The match will be successful if the most recent marker's property values match the parameter values provided.

This method calls the matchMostRecentBusinessProcessStageOnOrder method if the business process configuration is an instance of atg.commerce.markers.bp.OrderBasedProcessConfiguration. Otherwise super is called.

Overrides:
matchMostRecentBusinessProcessStage in class BusinessProcessManager
Throws:
BusinessProcessException
MarkerException
See Also:
#matchLastBusinessProcessStageOnOrder

matchMostRecentBusinessProcessStageOnOrder

public RepositoryItem matchMostRecentBusinessProcessStageOnOrder(Order pOrder,
                                                                 java.lang.String pBusinessProcessName,
                                                                 java.lang.String pBusinessProcessStage,
                                                                 java.lang.String pData,
                                                                 java.lang.String pMarkerPropertyName,
                                                                 java.util.Map pExtendedProperties)
                                                          throws BusinessProcessException,
                                                                 MarkerException
Use this method to match the most recent marker for a business process. The match will be successful if the most recent marker's property values match the parameter values provided.

For a match to be successful, all the marker properties must match the parameter values provided. Use null for a parameter value if the associated property was originally created with null. For string properties that are not null, but should not be included in the match, use the atg.markers.MarkerConstants.ANY_VALUE token string. This string indicates that the property can be any value for a successful match.

If the extended properties map is null then none of the extended properties will be included in the match.

Parameters:
pOrder - the order that contains the markers. if null the order defined by the business process is used.
pBusinessProcessName - the marker key to match.
pBusinessProcessStage - the marker value to match.
pData - the marker data to match.
pMarkerPropertyName - name of the order property that contains the collection of markers.
pExtendedProperties - the marker extended properties to match.
Returns:
the marker item, if match is successful.
Throws:
BusinessProcessException
MarkerException

findProcessStartTime

public java.sql.Timestamp findProcessStartTime(Order pOrder,
                                               java.lang.String pBusinessProcessName,
                                               java.lang.String pMarkerPropertyName)
                                        throws BusinessProcessException
This method determines the time an order started a business process.

Parameters:
pOrder - the order in the business process.
pBPName - the business process name
pMarkerPropertyName - the name of the property that contains the markers for the business process
Returns:
the timestamp of the earliest marker for a business process.
Throws:
BusinessProcessException

findOrderBasedProcessConfiguration

protected OrderBasedProcessConfiguration findOrderBasedProcessConfiguration(java.lang.String pBusinessProcessName)
                                                                     throws BusinessProcessException
Finds an order based business process configuration component using the business process name

Parameters:
pBusinessProcessName - the business process name that identifies the configuration component
Returns:
OrderBasedProcessConfiguration component
Throws:
BusinessProcessException - is the process configuration is not an instance of OrderBasedProcessConfiguration

deleteBusinessProcessMarkers

public int deleteBusinessProcessMarkers(java.lang.String pBusinessProcessName,
                                        java.lang.String pBusinessProcessStage)
                                 throws BusinessProcessException
Use this method to delete all markers that match the input parameters.

Overrides:
deleteBusinessProcessMarkers in class BusinessProcessManager
Throws:
BusinessProcessException
See Also:
deleteOrderBasedBusinessProcessMarkers(java.lang.String, java.lang.String, java.lang.String, java.util.Map)

deleteOrderBasedBusinessProcessMarkers

public int deleteOrderBasedBusinessProcessMarkers(java.lang.String pBusinessProcessName,
                                                  java.lang.String pBusinessProcessStage,
                                                  java.lang.String pData,
                                                  java.util.Map pExtendedProperties)
                                           throws BusinessProcessException
Use this method to delete all markers that match the input parameters.

Use the atg.markers.MarkerConstants.ANY_VALUE token string as the pBusinessProcessStage and pData parameters to delete all markers for the business process.

In contrast with removeMarkers, this method deletes ALL markers for the business process, and not just those for a single owner.

Parameters:
pBusinessProcessName - (required) the name of the business process
pBusinessProcessStage - the business process stage.
pData - marker data
pExtendedProperites - a map containg the property to value mappings
Returns:
total number of markers deleted
Throws:
BusinessProcessException
See Also:
OrderMarkerManager.deleteMarkers(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)