org.yawlfoundation.yawl.elements
Class YAtomicTask

java.lang.Object
  extended by org.yawlfoundation.yawl.elements.YNetElement
      extended by org.yawlfoundation.yawl.elements.YExternalNetElement
          extended by org.yawlfoundation.yawl.elements.YTask
              extended by org.yawlfoundation.yawl.elements.YAtomicTask
All Implemented Interfaces:
Cloneable, Comparable, YVerifiable

public class YAtomicTask
extends YTask

A YAtomicTask object is the executable equivalent of the Atomic Task in the YAWL language. They have the same properties and behaviour.

Since:
0.1
Author:
Lachlan Aldred, Michael Adams (v2.0 and later)

Field Summary
 
Fields inherited from class org.yawlfoundation.yawl.elements.YTask
_AND, _dataMappingsForTaskEnablement, _dataMappingsForTaskStarting, _decompositionPrototype, _i, _mi_active, _mi_complete, _mi_entered, _mi_executing, _multiInstAttr, _OR, _XOR
 
Fields inherited from class org.yawlfoundation.yawl.elements.YExternalNetElement
_documentation, _name, _net
 
Constructor Summary
YAtomicTask(String id, int joinType, int splitType, YNet container)
          Constructs a new atomic task.
 
Method Summary
 void cancel(YPersistenceManager pmgr)
          Cancels a task.
 void cancel(YPersistenceManager pmgr, YIdentifier caseID)
          Cancels the task.
 Object clone()
          Clones this atomic task.
 Map getDataMappingsForEnablement()
          Deprecated. Since 2.0, enablement mappings have no function.
 boolean isRunning()
          Checks that a task is currently executing.
 org.jdom.Element prepareEnablementData()
          Deprecated. Since 2.0, enablement mappings have no function.
 void setDataMappingsForEnablement(Map<String,String> map)
          Deprecated. Since 2.0, enablement mappings have no function.
protected  void startOne(YPersistenceManager pmgr, YIdentifier id)
          Changes the inner state of an atomic task from entered to executing.
 boolean t_rollBackToFired(YPersistenceManager pmgr, YIdentifier caseID)
          Rolls back a task's inner state from 'executing' to 'entered'.
 List<YVerificationMessage> verify()
          Verifies this atomic task definition against YAWL semantics.
 
Methods inherited from class org.yawlfoundation.yawl.elements.YTask
addRemovesTokensFrom, checkExternalMapping, checkXQuery, createFiredIdentifier, get_inputLogDataItems, get_outputLogDataItems, getAllInternalConditions, getConfiguration, getConfigurationElement, getCustomFormURL, getData, getDataBindingForEnablementParam, getDataBindingForInputParam, getDataBindingForOutputParam, getDecompositionPrototype, getDefaultConfiguration, getDefaultConfigurationElement, getInformation, getJoinType, getMIActive, getMIComplete, getMIEntered, getMIExecuting, getMIOutputAssignmentVar, getMultiInstanceAttributes, getNetRunnerRepository, getParamNamesForTaskCompletion, getParamNamesForTaskEnablement, getParamNamesForTaskStarting, getPredicate, getPreSplittingMIQuery, getRemoveSet, getResetNet, getResourcingSpecs, getResourcingXML, getSpecVersion, getSplitType, getTimeParameters, getTimerVariable, getWorkItemRepository, isMultiInstance, isPopulatedEmptyTypeFlag, performDataExtraction, performExternalDataExtraction, prepareDataDocsForTaskOutput, prepareDataForInstanceStarting, produceDataRootElement, removeFromRemoveSet, rollbackFired, set_inputLogDataItems, set_outputLogDataItems, setConfiguration, setConfigurationElement, setCustomFormURI, setDataBindingForEnablementParam, setDataBindingForInputParam, setDataBindingForOutputExpression, setDataMappingsForTaskCompletion, setDataMappingsForTaskStarting, setDecompositionPrototype, setDefaultConfiguration, setDefaultConfigurationElement, setI, setJoinType, setMultiInstanceInputDataMappings, setMultiInstanceOutputDataMappings, setResetNet, setResourcingSpecs, setResourcingXML, setSplitType, setTimerParameters, setTimerParameters, setTimerParameters, setTimerParameters, setUpMultipleInstanceAttributes, t_add, t_addEnabled, t_complete, t_enabled, t_fire, t_isBusy, t_isExitEnabled, t_start, timerParamsToXML, toXML
 
Methods inherited from class org.yawlfoundation.yawl.elements.YExternalNetElement
addPostset, addPreset, addToCancelledBySet, addToYawlMappings, addToYawlMappings, getCancelledBySet, getDocumentation, getDocumentationPreParsed, getName, getNet, getPostsetElement, getPostsetElements, getPostsetFlow, getPostsetFlows, getPresetElement, getPresetElements, getPresetFlow, getPresetFlows, getProperID, getYawlMappings, removeFromCancelledBySet, removePostsetFlow, removePresetFlow, setDocumentation, setName, verifyPostsetFlows, verifyPresetFlows
 
Methods inherited from class org.yawlfoundation.yawl.elements.YNetElement
compareTo, getID, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

YAtomicTask

public YAtomicTask(String id,
                   int joinType,
                   int splitType,
                   YNet container)
Constructs a new atomic task.

Parameters:
id - the task identifier.
joinType - the task's join type.
splitType - the task's split type.
container - the task's containing net.
See Also:
YTask
Method Detail

setDataMappingsForEnablement

public void setDataMappingsForEnablement(Map<String,String> map)
Deprecated. Since 2.0, enablement mappings have no function.

Sets the enablement data mappings for an atomic task to those specified.

Parameters:
map - a map of [variable name, query] pairs.

startOne

protected void startOne(YPersistenceManager pmgr,
                        YIdentifier id)
                 throws YPersistenceException
Changes the inner state of an atomic task from entered to executing.

Specified by:
startOne in class YTask
Parameters:
pmgr - an instantiated persistence manager object.
id - the identifier to move from inner marking 'entered' to inner marking 'executing'.
Throws:
YPersistenceException - if there's a problem persisting the change.

isRunning

public boolean isRunning()
Checks that a task is currently executing.

Returns:
true if the task has 'executing' state.

cancel

public void cancel(YPersistenceManager pmgr)
            throws YPersistenceException
Cancels a task.

Overrides:
cancel in class YTask
Parameters:
pmgr - an instantiated persistence manager object.
Throws:
YPersistenceException - if there's a problem persisting the change.

cancel

public void cancel(YPersistenceManager pmgr,
                   YIdentifier caseID)
            throws YPersistenceException
Cancels the task. If the task is not currently executing, first check that the workitem is still referenced by the engine before attempting the cancellation.

Parameters:
pmgr - an instantiated persistence manager object.
caseID - the case identifier of this atomic task.
Throws:
YPersistenceException - if there's a problem persisting the change.

t_rollBackToFired

public boolean t_rollBackToFired(YPersistenceManager pmgr,
                                 YIdentifier caseID)
                          throws YPersistenceException
Rolls back a task's inner state from 'executing' to 'entered'.

The roll back will only occur if the task's inner 'executing' marking contains the identifier specified.

Parameters:
pmgr - an instantiated persistence manager object.
caseID - the case identifier of this atomic task.
Returns:
true if the rollback occurs, false if the rollback request could not be actioned because the task's inner 'executing' marking does not contain the identifier specified.
Throws:
YPersistenceException - if there's a problem persisting the change.

clone

public Object clone()
             throws CloneNotSupportedException
Clones this atomic task.

Overrides:
clone in class YTask
Returns:
a (Object) clone of the task.
Throws:
CloneNotSupportedException - if there's a problem cloning the task.

getDataMappingsForEnablement

public Map getDataMappingsForEnablement()
Deprecated. Since 2.0, enablement mappings have no function.

Gets the map of enablement mappings for the task.

Returns:
the map of enablement mappings.

prepareEnablementData

public org.jdom.Element prepareEnablementData()
                                       throws YQueryException,
                                              YDataStateException
Deprecated. Since 2.0, enablement mappings have no function.

Builds the enablement data set for the task.

Returns:
the enablement data set; that is, a set of data variables and corresponding values that were populated after evaluating their mapping expressions.
Throws:
YQueryException - if thre's a problem with a query evaluation.
YDataStateException - if there's a problem with the evaluated data.
YStateException - if there's a problem setting the task state.

verify

public List<YVerificationMessage> verify()
Verifies this atomic task definition against YAWL semantics.

Specified by:
verify in interface YVerifiable
Overrides:
verify in class YTask
Returns:
a List of error and/or warning messages. An empty list is returned if the atomic task verifies successfully.
See Also:
YVerificationMessage


Copyright © 2004-2012 The YAWL Foundation.