atg.markers.scenario
Class ItemHasMarker

java.lang.Object
  extended by atg.process.filter.Filter
      extended by atg.process.filter.ExpressionFilter
          extended by atg.markers.scenario.MarkerExpressionFilter
              extended by atg.markers.scenario.ItemHasMarker
All Implemented Interfaces:
MarkerConstants
Direct Known Subclasses:
ProfileHasMarker

public abstract class ItemHasMarker
extends MarkerExpressionFilter
implements MarkerConstants

This abstract class can be extended to create marker test expressions for any type of repository item.

Extensions must provide the repository item to used in the hasMarker API calls, and also map the new expressions operator names to the ones provided by this class.

The operator names provided by this class are:
hasMarker
hasLastMarker
hasLastMarkerWithKey

See Also:
getItemToUse(atg.process.ProcessExecutionContext), MarkerConfiguration.getHasMarkerOperatorMap()

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String OP_HAS_LASTMARKER
           
static java.lang.String OP_HAS_LASTMARKER_WITHKEY
           
static java.lang.String OP_HAS_MARKER
          Scenario operators handled by the evaluate methods
 
Fields inherited from class atg.markers.scenario.MarkerExpressionFilter
mMarkerConfiguration
 
Fields inherited from class atg.process.filter.Filter
FALSE, TRUE
 
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
ItemHasMarker()
           
 
Method Summary
protected  Filter evaluate(ProcessExecutionContext pContext)
          Evaluates this filter in the given process execution context.
protected  java.lang.String getHasMarkerOperatorToPerform(ProcessExecutionContext pContext)
          This method is called by the evaluate method to determine the operator name.
protected abstract  RepositoryItem getItemToUse(ProcessExecutionContext pContext)
          This method is called by the evaluate method to provide the RepositoryItem that's used in the hasMarker API calls.
 void initialize(java.lang.String pOperator, Expression[] pOperands)
          called by Scenario Manager to initialize the expression
 
Methods inherited from class atg.markers.scenario.MarkerExpressionFilter
configure, getData, getDuplicationMode, getExtendedProperties, getKey, getMarkedItemType, getMarkerConfiguration, getMarkerItemType, getMarkerPropertyName, getRepositoryMarkerManager, getValue, setMarkerConfiguration
 
Methods inherited from class atg.process.filter.ExpressionFilter
equals, getOperands, getOperator, operandsEquals, setOperands, setOperator, toString
 
Methods inherited from class atg.process.filter.Filter
andFilters, andFilters, assumeFalse, assumeTrue, createProcessInstanceQuery, createSubjectQuery, getResourceBundle, getSubjectType, hashCode, implies, isCacheable, negate, orFilters, orFilters, setCacheable, test
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


OP_HAS_MARKER

public static final java.lang.String OP_HAS_MARKER
Scenario operators handled by the evaluate methods

See Also:
Constant Field Values

OP_HAS_LASTMARKER

public static final java.lang.String OP_HAS_LASTMARKER
See Also:
Constant Field Values

OP_HAS_LASTMARKER_WITHKEY

public static final java.lang.String OP_HAS_LASTMARKER_WITHKEY
See Also:
Constant Field Values
Constructor Detail

ItemHasMarker

public ItemHasMarker()
Method Detail

getItemToUse

protected abstract RepositoryItem getItemToUse(ProcessExecutionContext pContext)
This method is called by the evaluate method to provide the RepositoryItem that's used in the hasMarker API calls.

Parameters:
pContext - the scenario execution context
Returns:
RepositoryItem the repository item that contains the markers

getHasMarkerOperatorToPerform

protected java.lang.String getHasMarkerOperatorToPerform(ProcessExecutionContext pContext)
This method is called by the evaluate method to determine the operator name.

By default, this method uses the operator name returned by getOperator to lookup to the appropriate base operator name provided by ItemHasMarker.

The base operator names for ItemHasMarker are: hasMarker, hasLastMarker and hasLastMarkerWithKey

Because this class can be extended to implement any number of scenario hasMarker expressions, the new expression operator names must be mapped in the configuration component to one of the standard operators above.

Returns:
String the operator name
See Also:
MarkerConfiguration.getHasMarkerOperatorMap()

initialize

public void initialize(java.lang.String pOperator,
                       Expression[] pOperands)
                throws ProcessException
called by Scenario Manager to initialize the expression

Overrides:
initialize in class MarkerExpressionFilter
Parameters:
pOperator - the filter operator names
pOperands - the operands to the filter.
Throws:
ProcessException - if the operands argument is invalid

evaluate

protected Filter evaluate(ProcessExecutionContext pContext)
                   throws ProcessException
Evaluates this filter in the given process execution context.

The possible return values of this method are as follows:

Specified by:
evaluate in class Filter
Throws:
ProcessException - if there is a problem evaluating the filter (other than information missing from the context)