|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.markers.bp.BusinessProcessManager
public class BusinessProcessManager
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
.
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.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. |
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. |
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.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 |
---|
public static java.lang.String CLASS_VERSION
protected java.util.Map mBusinessProcessNameToConfiguration
protected BusinessProcessConfiguration[] mBusinessProcessConfiguration
protected MarkerMessageSource mMarkerMessageSource
protected java.lang.String mStageReachedJMSType
protected boolean mGenerateEvents
protected javax.transaction.TransactionManager mTransactionManager
Constructor Detail |
---|
public BusinessProcessManager()
Method Detail |
---|
protected java.util.Map getBusinessProcessNameToConfiguration()
Contains the Map of business process name to business process configuration component.
public void setBusinessProcessConfigurations(BusinessProcessConfiguration[] pBusinessProcessConfiguration)
public BusinessProcessConfiguration[] getBusinessProcessConfigurations()
public MarkerMessageSource getMarkerMessageSource()
public void setMarkerMessageSource(MarkerMessageSource pMarkerMessageSource)
public void setStageReachedJMSType(java.lang.String pStageReachedJMSType)
public java.lang.String getStageReachedJMSType()
public void setGenerateEvents(boolean pGenerateEvents)
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.
public boolean isGenerateEvents()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public void doStartService() throws ServiceException
Configuration components that don't pass validation are not added to the map.
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting upprotected void sendBusinessProcessStageReachedEvent(RepositoryItem pBusinessProcessMarker, java.sql.Timestamp pProcessStartTime, java.lang.String pMarkedItemType, java.lang.String pMarkedItemId)
pBusinessProcessMarker
- the business process marker that was added.pProcessStartTime
- the time the business process was started by the ownerpMarkedItemType
- the item type of the new marker.pMarkedItemId
- the repository id of the item that was markedprotected void sendBusinessProcessEvent(BusinessProcessEventMessage pMessage, java.lang.String pMessageType)
Note that a transaction must exist for this method to send a message.
protected BusinessProcessEventMessage createBusinessProcessStageReachedEvent(RepositoryItem pBusinessProcessMarker, java.sql.Timestamp pProcessStartTime, java.lang.String pMarkedItemType, java.lang.String pMarkedItemId)
pBusinessProcessMarker
- the business process marker that was added.pProcessStartTime
- the time the business process was started by the ownerpMarkedItemType
- the item type of the new marker.pMarkerdItemId
- the repository id of the item that was markedprotected void setBaseBusinessProcessEventProperties(BusinessProcessEventMessage pBusinessProcessEventMessage, RepositoryItem pBusinessProcessMarker, java.sql.Timestamp pProcessStartTime, java.lang.String pMarkedItemType, java.lang.String pOwnerId)
pBusinessProcessEventMessage
- the BusinessProcessEventMessage objectpBusinessProcessMarker
- the business process marker that was added.pProcessStartTime
- the time the business process was started by the ownerpMarkedItemType
- the repository item type of the marked item.pOwnerId
- the id of the owning itemprotected ItemBasedProcessConfiguration findItemBasedProcessConfiguration(java.lang.String pBusinessProcessName) throws BusinessProcessException
pBusinessProcessName
- the business process name that identifies the configuration component
BusinessProcessException
- is the process configuration is not an
instance of ItemBasedProcessConfigurationpublic 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
BusinessProcessException
MarkerException
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)
public RepositoryItem addBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage) throws BusinessProcessException, MarkerException
BusinessProcessException
MarkerException
addBusinessProcessStage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, java.lang.String)
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
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.
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 datapMarkerItemType
- the type of marker to create.pMarkerPropertyName
- name of the item property that contains the collection of markers.pExtendedProperties
- the marker extended propertiespDuplicationMode
- the duplication mode used when adding the marker.
BusinessProcessException
MarkerException
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
BusinessProcessException
MarkerException
removeBusinessProcessStageFromItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public int removeBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage) throws BusinessProcessException, MarkerException
BusinessProcessException
MarkerException
removeBusinessProcessStageFromItem(atg.repository.MutableRepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
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
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.
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 datapMarkerPropertyName
- the property name on the pItem that contains the collection of markers.pExtendedProperties
- the marker extended properties
BusinessProcessException
MarkerException
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
BusinessProcessException
MarkerException
itemHasBusinessProcessStage(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public boolean hasBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage) throws BusinessProcessException, MarkerException
BusinessProcessException
MarkerException
hasBusinessProcessStage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
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
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.
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 datapMarkerItemType
- the item type of the markerpMarkerPropertyName
- the property name on the pItem that contains the collection of markers.pExtendedProperties
- the marker extended properties
BusinessProcessException
MarkerException
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
BusinessProcessException
MarkerException
matchMostRecentBusinessProcessStageOnItem(atg.repository.RepositoryItem, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public RepositoryItem matchMostRecentBusinessProcessStage(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage) throws BusinessProcessException, MarkerException
BusinessProcessException
MarkerException
matchMostRecentBusinessProcessStage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
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
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.
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 datapMarkerItemType
- the item type of the markerpMarkerPropertyName
- the property name on the pItem that contains the collection of markers.pExtendedProperties
- the marker extended properties
mode is used.
BusinessProcessException
MarkerException
public java.util.Map getNamesAndStages()
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.
public java.util.Collection findBusinessProcessNames()
public java.lang.String[] findBusinessProcessStages(java.lang.String pBPName)
public int findStageSequenceNumber(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage)
public BusinessProcessConfiguration getConfiguration(java.lang.String pBusinessProcessName)
pBusinessProcessName
- the name of the business process
public java.sql.Timestamp findProcessStartTime(RepositoryItem pMarkedItem, java.lang.String pBusinessProcessName, java.lang.String pMarkerPropertyName) throws BusinessProcessException
pMarkedItem
- the item in the business process.pBPName
- the business process namepMarkerPropertyName
- the name of the property that contains the markers for the business process
BusinessProcessException
public int deleteBusinessProcessMarkers(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage) throws BusinessProcessException
BusinessProcessException
deleteItemBasedBusinessProcessMarkers(java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public int deleteItemBasedBusinessProcessMarkers(java.lang.String pBusinessProcessName, java.lang.String pBusinessProcessStage, java.lang.String pData, java.util.Map pExtendedProperties) throws BusinessProcessException
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.
pBusinessProcessName
- (required) the name of the business processpBusinessProcessStage
- the business process stage.pData
- marker datapExtendedProperites
- a map containg the property to value mappings
BusinessProcessException
RepositoryMarkerManager.deleteMarkers(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |