org.yawlfoundation.yawl.worklet.exception
Class CaseMonitor

java.lang.Object
  extended by org.yawlfoundation.yawl.worklet.exception.CaseMonitor

public class CaseMonitor
extends Object

The CaseMonitor class manages a dataset of descriptors for each case started in the engine while the ExceptionService is active. The primary purpose is to minimise calls across the interface. HandlerRunner instances for each exception raised by this case are maintained by this class.

Version:
0.8, 04/07/2006
Author:
Michael Adams

Constructor Summary
CaseMonitor()
           
CaseMonitor(YSpecificationID specID, String caseID, String data)
          The constructor is called when a pre-case constraint check event occurs, marking the start of a new case
 
Method Summary
 void addCaseExternalHandlerRunner(HandlerRunner hr)
           
 void addHandlerRunner(HandlerRunner hr, String itemID)
           
 void addLiveItem(String taskID)
           
 void addPostCaseHandlerRunner(HandlerRunner hr)
           
 void addPreCaseHandlerRunner(HandlerRunner hr)
          A CaseMonitor instance may have several HandlerRunner's active at any one time, each one representing an exception currently being handled by the ExceptionService.
 void addProcessInfo(WorkItemRecord wir)
          Adds the contents of the workitem record to the case data for this case - thus providing information about the workitem to the ruleset
 void addTrigger(String triggerValue)
          Adds an external exception trigger to the case data so that the correct RDR can be found for it
 org.jdom.Element getCaseData()
           
 HandlerRunner getCaseExternalHandlerRunner()
           
 String getCaseID()
           
 HandlerRunner getHandlerRunnerForItem(String itemID)
          retrieves an item-level runner
 List<HandlerRunner> getHandlerRunners()
           
 org.jdom.Element getNetLevelData()
           
 HandlerRunner getPostCaseHandlerRunner()
           
 HandlerRunner getPreCaseHandlerRunner()
           
 HandlerRunner getRunnerForType(RuleType xType, String itemID)
          returns the runner for the specified type (if any)
 YSpecificationID getSpecID()
           
 boolean hasHandlerRunnerForItem(String itemID)
           
 boolean hasLiveHandlerRunners()
           
 boolean hasLiveItems()
           
 void initNonPersistedItems()
          reconstitutes objects persisted as string representations
 boolean isCaseCompleted()
           
 boolean isCaseRunner(HandlerRunner runner)
           
 boolean isDone()
           
 boolean isItemRunner(HandlerRunner runner)
           
 boolean isPreCaseCancelled()
           
 void removeAllRunners()
           
 void removeCaseExternalHandlerRunner()
           
 void removeHandlerRunner(HandlerRunner runner)
           
 void removeHandlerRunnerForItem(String itemID)
           
 void removeLiveItem(String taskID)
           
 void removePostCaseHandlerRunner()
           
 void removePreCaseHandlerRunner()
           
 void removeProcessInfo()
           
 void removeTrigger()
           
 List<HandlerRunner> restoreRunners(Map<String,HandlerRunner> runnerMap)
          'reattaches' HandlerRunners belonging to this CaseMonitor after a restore
 void setCaseCompleted()
           
 void setCaseData(org.jdom.Element data)
           
 void setPreCaseCancellationFlag()
           
 String toString()
           
 void updateData(String sData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CaseMonitor

public CaseMonitor(YSpecificationID specID,
                   String caseID,
                   String data)
The constructor is called when a pre-case constraint check event occurs, marking the start of a new case

Parameters:
specID -
caseID -
data - - a string representation of the case data

CaseMonitor

public CaseMonitor()
Method Detail

getCaseID

public String getCaseID()

getSpecID

public YSpecificationID getSpecID()

getCaseData

public org.jdom.Element getCaseData()

getNetLevelData

public org.jdom.Element getNetLevelData()

setCaseData

public void setCaseData(org.jdom.Element data)

setCaseCompleted

public void setCaseCompleted()

initNonPersistedItems

public void initNonPersistedItems()
reconstitutes objects persisted as string representations


restoreRunners

public List<HandlerRunner> restoreRunners(Map<String,HandlerRunner> runnerMap)
'reattaches' HandlerRunners belonging to this CaseMonitor after a restore

Parameters:
runnerMap - - a set of all the HandlerRunners restored from persistence
Returns:
the list of all runners 'claimed' by this CaseMonitor

updateData

public void updateData(String sData)

addTrigger

public void addTrigger(String triggerValue)
Adds an external exception trigger to the case data so that the correct RDR can be found for it

Parameters:
triggerValue - - the string value of the external trigger

removeTrigger

public void removeTrigger()

addProcessInfo

public void addProcessInfo(WorkItemRecord wir)
Adds the contents of the workitem record to the case data for this case - thus providing information about the workitem to the ruleset

Parameters:
wir - - the wir being tested for an exception

removeProcessInfo

public void removeProcessInfo()

addPreCaseHandlerRunner

public void addPreCaseHandlerRunner(HandlerRunner hr)
A CaseMonitor instance may have several HandlerRunner's active at any one time, each one representing an exception currently being handled by the ExceptionService.


addPostCaseHandlerRunner

public void addPostCaseHandlerRunner(HandlerRunner hr)

addCaseExternalHandlerRunner

public void addCaseExternalHandlerRunner(HandlerRunner hr)

addHandlerRunner

public void addHandlerRunner(HandlerRunner hr,
                             String itemID)

getPreCaseHandlerRunner

public HandlerRunner getPreCaseHandlerRunner()

getPostCaseHandlerRunner

public HandlerRunner getPostCaseHandlerRunner()

getCaseExternalHandlerRunner

public HandlerRunner getCaseExternalHandlerRunner()

getHandlerRunnerForItem

public HandlerRunner getHandlerRunnerForItem(String itemID)
retrieves an item-level runner


getRunnerForType

public HandlerRunner getRunnerForType(RuleType xType,
                                      String itemID)
returns the runner for the specified type (if any)


getHandlerRunners

public List<HandlerRunner> getHandlerRunners()

removePreCaseHandlerRunner

public void removePreCaseHandlerRunner()

removePostCaseHandlerRunner

public void removePostCaseHandlerRunner()

removeCaseExternalHandlerRunner

public void removeCaseExternalHandlerRunner()

removeHandlerRunnerForItem

public void removeHandlerRunnerForItem(String itemID)

removeHandlerRunner

public void removeHandlerRunner(HandlerRunner runner)

removeAllRunners

public void removeAllRunners()

addLiveItem

public void addLiveItem(String taskID)

removeLiveItem

public void removeLiveItem(String taskID)

hasHandlerRunnerForItem

public boolean hasHandlerRunnerForItem(String itemID)

isItemRunner

public boolean isItemRunner(HandlerRunner runner)

isCaseRunner

public boolean isCaseRunner(HandlerRunner runner)

hasLiveHandlerRunners

public boolean hasLiveHandlerRunners()

hasLiveItems

public boolean hasLiveItems()

isDone

public boolean isDone()

isCaseCompleted

public boolean isCaseCompleted()

setPreCaseCancellationFlag

public void setPreCaseCancellationFlag()

isPreCaseCancelled

public boolean isPreCaseCancelled()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2012 The YAWL Foundation.