atg.markers.scenario
Class MarkerAction

java.lang.Object
  extended by atg.process.action.ActionImpl
      extended by atg.markers.scenario.MarkerAction
All Implemented Interfaces:
MarkerConstants, Action
Direct Known Subclasses:
AddMarkerToItem, AddMarkerToOrder, BusinessProcessStageAction, RemoveAllMarkersFromItem, RemoveAllMarkersFromOrder, RemoveMarkersFromItem, RemoveMarkersFromOrder

public abstract class MarkerAction
extends ActionImpl
implements MarkerConstants

This abstract class can be extended to implement marker actions.

This class provides access to a configuration component of type MarkerConfiguration.

During initialization, the following action parameters are stored in the local parameter map.

PARAM_KEY
PARAM_VALUE
PARAM_DATA
PARAM_DUPMODE
PARAM_MARKER_ITEM_TYPE
PARAM_MARKED_ITEM_TYPE

Accessor methods are provided to return the parameters and configurable property values from the configuration component.

See Also:
getKey(atg.process.ProcessExecutionContext), getValue(atg.process.ProcessExecutionContext), getData(atg.process.ProcessExecutionContext), getDuplicationMode(atg.process.ProcessExecutionContext), getExtendedProperties(atg.process.ProcessExecutionContext), getMarkedItemType(atg.process.ProcessExecutionContext), getMarkerItemType(atg.process.ProcessExecutionContext), getMarkerPropertyName(atg.process.ProcessExecutionContext), configure(java.lang.Object), getMarkerConfiguration(), MarkerConfiguration

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  MarkerConfiguration mMarkerConfiguration
          The MarkerConfiguration reference
 
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
 
Constructor Summary
MarkerAction()
           
 
Method Summary
 void configure(java.lang.Object pConfiguration)
          The configuration object provides the reference to the RepositoryMarkerManager and also the default parameter values.
abstract  void doAction(ProcessExecutionContext pContext)
          This method is called by the executeAction method.
protected  boolean doesParameterExist(java.lang.String pParameterName)
          tests if a parameter has been provided.
protected  void executeAction(ProcessExecutionContext pContext)
          Ensures a transaction and calls the doAction method.
protected  java.lang.String getData(ProcessExecutionContext pContext)
          Returns the data parameter.
protected  java.lang.String getDuplicationMode(ProcessExecutionContext pContext)
          Returns the duplcationMode.
protected  java.util.Map getExtendedProperties(ProcessExecutionContext pContext)
          Called by the evaluate method to return the extendedProperties map that is passed to the hasMarker method call.
protected  java.lang.String getKey(ProcessExecutionContext pContext)
          Returns the key parameter.
protected  java.lang.String getMarkedItemType(ProcessExecutionContext pContext)
          Returns the markedItemType.
protected  MarkerConfiguration getMarkerConfiguration()
           
protected  java.lang.String getMarkerItemType(ProcessExecutionContext pContext)
          Returns the markerItemType.
protected  java.lang.String getMarkerPropertyName(ProcessExecutionContext pContext)
          Returns the markerPropertyName.
protected  java.lang.String getValue(ProcessExecutionContext pContext)
          Returns the value parameter.
 void initialize(java.util.Map pParameters)
          Called by scenario manager to initialize the action
protected  void setMarkerConfiguration(java.lang.Object pConfiguration)
           
 
Methods inherited from class atg.process.action.ActionImpl
execute, execute, getActionName, getParameterExpression, getParameterValue, storeOptionalParameter, storeRequiredMutableParameter, storeRequiredParameter, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mMarkerConfiguration

protected MarkerConfiguration mMarkerConfiguration
The MarkerConfiguration reference

Constructor Detail

MarkerAction

public MarkerAction()
Method Detail

getMarkerConfiguration

protected MarkerConfiguration getMarkerConfiguration()

setMarkerConfiguration

protected void setMarkerConfiguration(java.lang.Object pConfiguration)
                               throws ProcessException
Throws:
ProcessException

configure

public void configure(java.lang.Object pConfiguration)
               throws ProcessException,
                      java.lang.UnsupportedOperationException
The configuration object provides the reference to the RepositoryMarkerManager and also the default parameter values.

Specified by:
configure in interface Action
Overrides:
configure in class ActionImpl
Throws:
ProcessException - if the action could not be configured - for example, because some of the required properties are missing from the configuration
java.lang.UnsupportedOperationException - if this action is not configurable
See Also:
MarkerConfiguration

initialize

public void initialize(java.util.Map pParameters)
                throws ProcessException
Called by scenario manager to initialize the action

Specified by:
initialize in interface Action
Overrides:
initialize in class ActionImpl
Throws:
ProcessException - if the action could not be properly initialized - for example, if not all of the required parameters are present in the Map
See Also:
Expression

getKey

protected java.lang.String getKey(ProcessExecutionContext pContext)
                           throws ProcessException
Returns the key parameter. The key param is identified in the parameter map by the key PARAM_KEY

Returns:
String the key
Throws:
ProcessException

getValue

protected java.lang.String getValue(ProcessExecutionContext pContext)
                             throws ProcessException
Returns the value parameter. The value param is identified in the parameter map by the key PARAM_VALUE

Returns:
String the value
Throws:
ProcessException

getData

protected java.lang.String getData(ProcessExecutionContext pContext)
                            throws ProcessException
Returns the data parameter. The data param is identified in the parameter map by the key PARAM_DATA

Returns:
String the data
Throws:
ProcessException

doesParameterExist

protected boolean doesParameterExist(java.lang.String pParameterName)
tests if a parameter has been provided. i.e. was the user allowed to specify it through the UI

Returns:
true if the parameter is available.

getMarkerPropertyName

protected java.lang.String getMarkerPropertyName(ProcessExecutionContext pContext)
                                          throws ProcessException
Returns the markerPropertyName. By default, the marker configuration's defaultMarkerPropertyName is returned. Override this method to return an alternate value such as something provided as a parameter or dynamically based on the context.

Throws:
ProcessException

getMarkerItemType

protected java.lang.String getMarkerItemType(ProcessExecutionContext pContext)
                                      throws ProcessException
Returns the markerItemType. By default, the marker configuration's defaultMarkerItemType is returned. Override this method to return an alternate value such as something provided as a parameter or dynamically based on the context.

Throws:
ProcessException

getMarkedItemType

protected java.lang.String getMarkedItemType(ProcessExecutionContext pContext)
                                      throws ProcessException
Returns the markedItemType. By default, the marker configuration's defaultMarkedItemType is returned. Override this method to return an alternate value such as something provided as a parameter or dynamically based on the context.

Throws:
ProcessException

getDuplicationMode

protected java.lang.String getDuplicationMode(ProcessExecutionContext pContext)
                                       throws ProcessException
Returns the duplcationMode. By default, the marker configuration's defaultDuplicationMode is returned. Override this method to return an alternate value such as something provided as a parameter or dynamically based on the context.

Throws:
ProcessException

getExtendedProperties

protected java.util.Map getExtendedProperties(ProcessExecutionContext pContext)
                                       throws ProcessException
Called by the evaluate method to return the extendedProperties map that is passed to the hasMarker method call. The based implementation returns null.

Throws:
ProcessException

executeAction

protected void executeAction(ProcessExecutionContext pContext)
                      throws ProcessException
Ensures a transaction and calls the doAction method.

Specified by:
executeAction in class ActionImpl
Throws:
ProcessException - if the action can not be executed
See Also:
doAction(atg.process.ProcessExecutionContext)

doAction

public abstract void doAction(ProcessExecutionContext pContext)
                       throws ProcessException
This method is called by the executeAction method. Use this method to implement action specific processing.

Throws:
ProcessException - if the action can not be executed