atg.markers.bp
Class BusinessProcessManager

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

public class BusinessProcessManager
extends GenericService
implements BusinessProcessConstants

This class provides the public API for maintaining business process markers.

Each business process has a name and a predefined list of stages, which are used for adding, removing, or testing for business process markers. The business process name is used as the marker key, and the business process stage is used as the marker value.

An example business process might be one that defines a commerce site's purchase process. The name could be "PurchaseProcess", and the stages may be, BrowsedCatalog, AddItemToCart, ViewedShippingInfo,.... Checkout.

Each business process is defined by a configuation component. The configuration component encapsulates the properties and configurations of a business process such as, the business process name, the stage names, the duplication mode for adding markers, etc.

This BusinessProcessManager class handles all business processes that have a configuration of type atg.markers.bp.ItemBasedProcessConfiguration.

When creating a configuration component for a business process that is based on (will mark) the current session profile, use the class atg.markers.bp.ProfileBasedProcessConfiguration, which is an extension of atg.markers.bp.ItemBasedProcessConfiguration. ProfileBasedProcessConfiguration provides automatic defaults for marking profiles using the ProfileMarkerManager.

To define a new business process, create a new business process configuration component and add it to the businessProcessConfigurations property of the BusinessProcessManager component.

When adding a business process marker, the marked item must be updated by calling repository.updateItem(item). If the caller does not provide an item to be marked, the BusinessProcessManager will get the item from the configuration component. After adding or removing the marker, the BusinessProcessManager will automatically call updateItem.
If the caller provides the item to be marked, the caller must also call updateItem.

See Also:
ProfileBasedProcessConfiguration

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  BusinessProcessConfiguration[] mBusinessProcessConfiguration
          Sets the array of business process configurations
protected  java.util.Map mBusinessProcessNameToConfiguration
           
protected  boolean mGenerateEvents
           
protected  MarkerMessageSource mMarkerMessageSource
           
protected  java.lang.String mStageReachedJMSType
           
protected  javax.transaction.TransactionManager 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
BusinessProcessManager()
           
 
Method Summary
 RepositoryItem addBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage)
          Adds a business process marker to the item defined by the business process configuration.
 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 item defined by the business process configuration.
 RepositoryItem addBusinessProcessStageToItem(MutableRepositoryItem pItem, 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 item.
protected  BusinessProcessEventMessage createBusinessProcessStageReachedEvent(RepositoryItem pBusinessProcessMarker, java.sql.Timestamp pProcessStartTime, java.lang.String pMarkedItemType, java.lang.String pMarkedItemId)
          Creates an event object for the business process stage reached event.
protected  BusinessProcessEventMessage createBusinessProcessStageReachedEvent(RepositoryItem pBusinessProcessMarker, java.sql.Timestamp pProcessStartTime, java.lang.String pMarkedItemType, java.lang.String pMarkedItemId, java.lang.String pSiteId)
          Creates an event object for the business process stage reached event.
 int deleteBusinessProcessMarkers(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage)
          Use this method to delete all markers that match the input parameters.
 int deleteItemBasedBusinessProcessMarkers(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.
 void doStartService()
          Builds a map of business process configuration components keyed by the business process names.
 java.util.Collection findBusinessProcessNames()
           
 java.lang.String[] findBusinessProcessStages(java.lang.String pBPName)
           
protected  ItemBasedProcessConfiguration findItemBasedProcessConfiguration(java.lang.String pBusinessProcessName)
          Finds an item based business process configuration component using the business process name
 java.sql.Timestamp findProcessStartTime(RepositoryItem pMarkedItem, java.lang.String pBusinessProcessName, java.lang.String pMarkerPropertyName)
          This method determines the time an item started a business process.
 int findStageSequenceNumber(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage)
          Using the stage names defined by the business process configuration, determines the positioning of the given stage name.
 BusinessProcessConfiguration[] getBusinessProcessConfigurations()
           
protected  java.util.Map getBusinessProcessNameToConfiguration()
          This map is updated by doStartService.
 BusinessProcessConfiguration getConfiguration(java.lang.String pBusinessProcessName)
          Returns the BusinessProcessConfiguration component for the given business process name
 MarkerMessageSource getMarkerMessageSource()
          Returns the message source that sends marker JMS messages.
 java.util.Map getNamesAndStages()
          Builds a map of the business process names and their possible stages.
 java.lang.String getStageReachedJMSType()
          Returns the JMS Message type used when sending stage reached messages.
 javax.transaction.TransactionManager getTransactionManager()
          Returns the transaction manager for all transactional processing
 boolean hasBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage)
          Use this method to test for a business process marker.
 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.
 boolean isGenerateEvents()
          Boolean flag for optionally generating JMS events.
 boolean itemHasBusinessProcessStage(RepositoryItem pItem, 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)
          Use this method to match the most recent marker for a business process.
 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 matchMostRecentBusinessProcessStageOnItem(RepositoryItem pItem, 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.
 int removeBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage)
          Use this method to remove business process markers.
 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 business process markers.
 int removeBusinessProcessStageFromItem(MutableRepositoryItem pItem, 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 business process markers.
protected  void sendBusinessProcessEvent(BusinessProcessEventMessage pMessage, java.lang.String pMessageType)
          Creates a BusinessProcessEventSynchronization object and attaches it to the current transaction.
protected  void sendBusinessProcessStageReachedEvent(RepositoryItem pBusinessProcessMarker, java.sql.Timestamp pProcessStartTime, java.lang.String pMarkedItemType, java.lang.String pMarkedItemId)
          Creates and sends the business process stage reached JMS event message.
protected  void setBaseBusinessProcessEventProperties(BusinessProcessEventMessage pBusinessProcessEventMessage, RepositoryItem pBusinessProcessMarker, java.sql.Timestamp pProcessStartTime, java.lang.String pMarkedItemType, java.lang.String pOwnerId)
          Sets the base property values of the business process event message.
protected  void setBaseBusinessProcessEventProperties(BusinessProcessEventMessage pBusinessProcessEventMessage, RepositoryItem pBusinessProcessMarker, java.sql.Timestamp pProcessStartTime, java.lang.String pMarkedItemType, java.lang.String pOwnerId, java.lang.String pSiteId)
          Sets the base property values of the business process event message.
 void setBusinessProcessConfigurations(BusinessProcessConfiguration[] pBusinessProcessConfiguration)
           
 void setGenerateEvents(boolean pGenerateEvents)
          Sets the boolean flag for optionally generating JMS events.
 void setMarkerMessageSource(MarkerMessageSource pMarkerMessageSource)
          Sets the message source that sends marker JMS messages.
 void setStageReachedJMSType(java.lang.String pStageReachedJMSType)
          Sets the JMS Message type used when sending stage reached messages
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Sets the transaction manager used for all transactional processing
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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 java.lang.String CLASS_VERSION
Class version string


mBusinessProcessNameToConfiguration

protected java.util.Map mBusinessProcessNameToConfiguration

mBusinessProcessConfiguration

protected BusinessProcessConfiguration[] mBusinessProcessConfiguration
Sets the array of business process configurations


mMarkerMessageSource

protected MarkerMessageSource mMarkerMessageSource

mStageReachedJMSType

protected java.lang.String mStageReachedJMSType

mGenerateEvents

protected boolean mGenerateEvents

mTransactionManager

protected javax.transaction.TransactionManager mTransactionManager
Constructor Detail

BusinessProcessManager

public BusinessProcessManager()
Method Detail

getBusinessProcessNameToConfiguration

protected java.util.Map getBusinessProcessNameToConfiguration()
This map is updated by doStartService.

Contains the Map of business process name to business process configuration component.


setBusinessProcessConfigurations

public void setBusinessProcessConfigurations(BusinessProcessConfiguration[] pBusinessProcessConfiguration)

getBusinessProcessConfigurations

public BusinessProcessConfiguration[] getBusinessProcessConfigurations()

getMarkerMessageSource

public MarkerMessageSource getMarkerMessageSource()
Returns the message source that sends marker JMS messages.


setMarkerMessageSource

public void setMarkerMessageSource(MarkerMessageSource pMarkerMessageSource)
Sets the message source that sends marker JMS messages.


setStageReachedJMSType

public void setStageReachedJMSType(java.lang.String pStageReachedJMSType)
Sets the JMS Message type used when sending stage reached messages


getStageReachedJMSType

public java.lang.String getStageReachedJMSType()
Returns the JMS Message type used when sending stage reached messages. Default value is "atg.business.process.stage.reached".


setGenerateEvents

public void setGenerateEvents(boolean pGenerateEvents)
Sets the boolean flag for optionally generating JMS events.

If this is false the all event generation is disabled. If it's true, then each business process can optionally disable/enable messages through the business process configuration component.


isGenerateEvents

public boolean isGenerateEvents()
Boolean flag for optionally generating JMS events. Default value is true.


setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets the transaction manager used for all transactional processing


getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Returns the transaction manager for all transactional processing


doStartService

public void doStartService()
                    throws ServiceException
Builds a map of business process configuration components keyed by the business process names.

Configuration components that don't pass validation are not added to the map.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

sendBusinessProcessStageReachedEvent

protected void sendBusinessProcessStageReachedEvent(RepositoryItem pBusinessProcessMarker,
                                                    java.sql.Timestamp pProcessStartTime,
                                                    java.lang.String pMarkedItemType,
                                                    java.lang.String pMarkedItemId)
Creates and sends the business process stage reached JMS event message. The JMSType is specified by the configurable property stageReachedJMSType.

Parameters:
pBusinessProcessMarker - the business process marker that was added.
pProcessStartTime - the time the business process was started by the owner
pMarkedItemType - the item type of the new marker.
pMarkedItemId - the repository id of the item that was marked

sendBusinessProcessEvent

protected void sendBusinessProcessEvent(BusinessProcessEventMessage pMessage,
                                        java.lang.String pMessageType)
Creates a BusinessProcessEventSynchronization object and attaches it to the current transaction. When the current transaction is committed the synchronization object sends the message.

Note that a transaction must exist for this method to send a message.


createBusinessProcessStageReachedEvent

protected BusinessProcessEventMessage createBusinessProcessStageReachedEvent(RepositoryItem pBusinessProcessMarker,
                                                                             java.sql.Timestamp pProcessStartTime,
                                                                             java.lang.String pMarkedItemType,
                                                                             java.lang.String pMarkedItemId)
Creates an event object for the business process stage reached event. The event is created and the base properties are set by calling setBaseBusinessProcessEventProperties.

Parameters:
pBusinessProcessMarker - the business process marker that was added.
pProcessStartTime - the time the business process was started by the owner
pMarkedItemType - the item type of the new marker.
pMarkerdItemId - the repository id of the item that was marked

createBusinessProcessStageReachedEvent

protected BusinessProcessEventMessage createBusinessProcessStageReachedEvent(RepositoryItem pBusinessProcessMarker,
                                                                             java.sql.Timestamp pProcessStartTime,
                                                                             java.lang.String pMarkedItemType,
                                                                             java.lang.String pMarkedItemId,
                                                                             java.lang.String pSiteId)
Creates an event object for the business process stage reached event. The event is created and the base properties are set by calling setBaseBusinessProcessEventProperties.

Parameters:
pBusinessProcessMarker - the business process marker that was added.
pProcessStartTime - the time the business process was started by the owner
pMarkedItemType - the item type of the new marker.
pMarkerdItemId - the repository id of the item that was marked
pSiteId - the site id associated with an event

setBaseBusinessProcessEventProperties

protected void setBaseBusinessProcessEventProperties(BusinessProcessEventMessage pBusinessProcessEventMessage,
                                                     RepositoryItem pBusinessProcessMarker,
                                                     java.sql.Timestamp pProcessStartTime,
                                                     java.lang.String pMarkedItemType,
                                                     java.lang.String pOwnerId)
Sets the base property values of the business process event message. The properties set in this method are common to all business process event messages.

Parameters:
pBusinessProcessEventMessage - the BusinessProcessEventMessage object
pBusinessProcessMarker - the business process marker that was added.
pProcessStartTime - the time the business process was started by the owner
pMarkedItemType - the repository item type of the marked item.
pOwnerId - the id of the owning item

setBaseBusinessProcessEventProperties

protected void setBaseBusinessProcessEventProperties(BusinessProcessEventMessage pBusinessProcessEventMessage,
                                                     RepositoryItem pBusinessProcessMarker,
                                                     java.sql.Timestamp pProcessStartTime,
                                                     java.lang.String pMarkedItemType,
                                                     java.lang.String pOwnerId,
                                                     java.lang.String pSiteId)
Sets the base property values of the business process event message. The properties set in this method are common to all business process event messages.

Parameters:
pBusinessProcessEventMessage - the BusinessProcessEventMessage object
pBusinessProcessMarker - the business process marker that was added.
pProcessStartTime - the time the business process was started by the owner
pMarkedItemType - the repository item type of the marked item.
pOwnerId - the id of the owning item
pSiteId - the site id associated with an event

findItemBasedProcessConfiguration

protected ItemBasedProcessConfiguration findItemBasedProcessConfiguration(java.lang.String pBusinessProcessName)
                                                                   throws BusinessProcessException
Finds an item based business process configuration component using the business process name

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

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 item defined by the business process configuration.

Throws:
BusinessProcessException
MarkerException
See Also:
addBusinessProcessStageToItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)

addBusinessProcessStage

public RepositoryItem addBusinessProcessStage(java.lang.String pBusinessProcessName,
                                              java.lang.String pBusinessProcessStage)
                                       throws BusinessProcessException,
                                              MarkerException
Adds a business process marker to the item defined by the business process configuration.

Throws:
BusinessProcessException
MarkerException
See Also:
addBusinessProcessStage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)

addBusinessProcessStageToItem

public RepositoryItem addBusinessProcessStageToItem(MutableRepositoryItem pItem,
                                                    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 item.

If an item is provided in pItem, the caller is responsible for doing the updateItem. If an item is not provided, the item returned by the BusinessProcessConfiguration is used and updateItem is called automatically.

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

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

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

Parameters:
pItem - the item that will be marked. if null, the item defined by the business process is used.
pBusinessProcessName - becomes the marker key.
pBusinessProcessStage - becomes the marker value.
pData - the marker data
pMarkerItemType - the type of marker to create.
pMarkerPropertyName - name of the item 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 business process markers. All markers that match the parameter values are removed.

Throws:
BusinessProcessException
MarkerException
See Also:
removeBusinessProcessStageFromItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)

removeBusinessProcessStage

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

Throws:
BusinessProcessException
MarkerException
See Also:
removeBusinessProcessStageFromItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)

removeBusinessProcessStageFromItem

public int removeBusinessProcessStageFromItem(MutableRepositoryItem pItem,
                                              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 business process markers. All markers that match the parameter values are removed.

If an item is provided in pItem, the caller is responsible for doing the updateItem.

If an item is not provided, the item returned by the BusinessProcessConfiguration is used and updateItem is called automatically.

If pMarkerPropertyName is not provided, the markerPropertyName returned by the BusinessProcessConfiguration 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:
pItem - the item that contains the business process markers. if null, the item defined by the business process is used.
pBusinessProcessName - becomes the marker key.
pBusinessProcessStage - becomes the marker value.
pData - the marker data
pMarkerPropertyName - the property name on the pItem that contains the collection of markers.
pExtendedProperties - the marker extended properties
Returns:
the 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.

Throws:
BusinessProcessException
MarkerException
See Also:
itemHasBusinessProcessStage(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)

hasBusinessProcessStage

public boolean hasBusinessProcessStage(java.lang.String pBusinessProcessName,
                                       java.lang.String pBusinessProcessStage)
                                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.

Throws:
BusinessProcessException
MarkerException
See Also:
hasBusinessProcessStage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)

itemHasBusinessProcessStage

public boolean itemHasBusinessProcessStage(RepositoryItem pItem,
                                           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.

If an item is not provided, the item returned by the BusinessProcessConfiguration is used.

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:
pItem - the item that contains the business process markers. if null, the item 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
pMarkerPropertyName - the property name on the pItem that contains the collection of markers.
pExtendedProperties - the marker extended properties
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.

Throws:
BusinessProcessException
MarkerException
See Also:
matchMostRecentBusinessProcessStageOnItem(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)

matchMostRecentBusinessProcessStage

public RepositoryItem matchMostRecentBusinessProcessStage(java.lang.String pBusinessProcessName,
                                                          java.lang.String pBusinessProcessStage)
                                                   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.

Throws:
BusinessProcessException
MarkerException
See Also:
matchMostRecentBusinessProcessStage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)

matchMostRecentBusinessProcessStageOnItem

public RepositoryItem matchMostRecentBusinessProcessStageOnItem(RepositoryItem pItem,
                                                                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.

If an item is not provided, the item returned by the BusinessProcessConfiguration is used.

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

Parameters:
pItem - the item that contains the business process markers. if null, the item 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
pMarkerPropertyName - the property name on the pItem that contains the collection of markers.
pExtendedProperties - the marker extended properties mode is used.
Returns:
the marker item if match successful
Throws:
BusinessProcessException
MarkerException

getNamesAndStages

public java.util.Map getNamesAndStages()
Builds a map of the business process names and their possible stages. The possible values are constructed from the BusinessProcessConfiguration component associated with the business process name.

This method is called by the ACC when constructing the scenario grammar extension for business process marker actions and conditionals. The map provides the necessary information for prepopulating the key and value choices.

Returns:
a map of business process names to the their possible stage values.

findBusinessProcessNames

public java.util.Collection findBusinessProcessNames()

findBusinessProcessStages

public java.lang.String[] findBusinessProcessStages(java.lang.String pBPName)

findStageSequenceNumber

public int findStageSequenceNumber(java.lang.String pBusinessProcessName,
                                   java.lang.String pBusinessProcessStage)
Using the stage names defined by the business process configuration, determines the positioning of the given stage name.


getConfiguration

public BusinessProcessConfiguration getConfiguration(java.lang.String pBusinessProcessName)
Returns the BusinessProcessConfiguration component for the given business process name

Parameters:
pBusinessProcessName - the name of the business process
Returns:
the BusinessProcessConfiguration associated with the business process name

findProcessStartTime

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

Parameters:
pMarkedItem - the item 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

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.

Throws:
BusinessProcessException
See Also:
deleteItemBasedBusinessProcessMarkers(java.lang.String, java.lang.String, java.lang.String, java.util.Map)

deleteItemBasedBusinessProcessMarkers

public int deleteItemBasedBusinessProcessMarkers(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:
RepositoryMarkerManager.deleteMarkers(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)