org.yawlfoundation.yawl.worklet.exception
Class HandlerRunner

java.lang.Object
  extended by org.yawlfoundation.yawl.worklet.support.WorkletRecord
      extended by org.yawlfoundation.yawl.worklet.exception.HandlerRunner

public class HandlerRunner
extends WorkletRecord

The HandlerRunner class manages an exception handling process. An instance of this class is created for each exception process raised by a case. The CaseMonitor class maintains the current set of HandlerRunners for a case (amongst other things). This class also manages a running worklet instance for a 'parent' case when required. The key data member is the RdrConclusion _rdrConc, which contains the sequential set of exception handling primitives for this particular handler.

Version:
0.8, 04-09/2006
Author:
Michael Adams

Field Summary
 
Fields inherited from class org.yawlfoundation.yawl.worklet.support.WorkletRecord
_datalist, _hasPersisted, _log, _persistID, _reasonType, _runners, _runningCaseIdStr, _runningWorkletStr, _searchPair, _searchPairStr, _wir, _wirStr
 
Constructor Summary
HandlerRunner(CaseMonitor monitor, RdrConclusion rdrConc, RuleType xType)
          This constructor is used when an exception is raised at the case level
HandlerRunner(CaseMonitor monitor, WorkItemRecord wir, RdrConclusion rdrConc, RuleType xType)
          This constructor is used when an exception is raised at the workitem level
 
Method Summary
 int get_id()
           
 int getActionIndex()
           
 String getCaseID()
           
 org.jdom.Element getDatalist()
           
 String getNextAction()
           
 String getNextTarget()
           
 CaseMonitor getOwnerCaseMonitor()
           
 YSpecificationID getSpecID()
           
 List<WorkItemRecord> getSuspendedList()
           
 org.jdom.Element getUpdatedData()
           
 boolean hasNextAction()
           
 int incActionIndex()
           
 void initNonPersistedItems()
          re-converts stringified persisted data back to data members after restore
 boolean isCaseSuspended()
           
 boolean isItemSuspended()
           
 void saveSearchResults()
          writes the node id's for the nodes returned from the rdr search and the data for the current workitem, to a file for later input into the 'add rule' process, if required
 void set_id(int id)
           
 void setCaseSuspended()
          called when an action suspends the case of this HandlerRunner
 void setItemSuspended()
          called when an action suspends the workitem of this HandlerRunner
 void setOwnerCaseMonitor(CaseMonitor monitor)
           
 void setSuspendedList(List<WorkItemRecord> items)
          called when an action suspends the item or parent case of this HandlerRunner
 String toString()
          returns a String representation of current WorkletRecord
 void unsetCaseSuspended()
          called when an action unsuspends the case of this HandlerRunner
 void unsetItemSuspended()
          called when an action unsuspends the workitem of this HandlerRunner
 void unsetSuspendedList()
          called when an action unsuspends the item or parent case of this HandlerRunner
 
Methods inherited from class org.yawlfoundation.yawl.worklet.support.WorkletRecord
addRunner, createFileName, get_reasonType, get_runningCaseIdStr, get_runningWorkletStr, get_searchPairStr, get_wirStr, getCaseMapAsCSVList, getItem, getItemId, getReasonType, getRunningCaseIds, getSearchPair, getWorkletCaseID, getWorkletList, getWorkletName, hasRunningWorklet, ObjectPersisted, persistThis, rebuildSearchPair, removeAllCases, removeRunnerByCaseID, removeRunnerByWorkletName, restoreCaseMap, saveDocument, set_reasonType, set_runningCaseIdStr, set_runningWorkletStr, set_searchPairStr, set_wirStr, setDatalist, setExType, setItem, setSearchPair, toStringSub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HandlerRunner

public HandlerRunner(CaseMonitor monitor,
                     RdrConclusion rdrConc,
                     RuleType xType)
This constructor is used when an exception is raised at the case level

Parameters:
monitor - the CaseMonitor for the case the generated the exception
rdrConc - the RdrConclusion of a rule that represents the handling process

HandlerRunner

public HandlerRunner(CaseMonitor monitor,
                     WorkItemRecord wir,
                     RdrConclusion rdrConc,
                     RuleType xType)
This constructor is used when an exception is raised at the workitem level

Method Detail

getNextAction

public String getNextAction()
Returns:
the action for the current index from the RdrConclusion

getNextTarget

public String getNextTarget()
Returns:
the target for the current index from the RdrConclusion

getActionIndex

public int getActionIndex()
Returns:
the current index in the set of actions

getCaseID

public String getCaseID()
Overrides:
getCaseID in class WorkletRecord
Returns:
the id of the case that raised the exception

getSpecID

public YSpecificationID getSpecID()
Overrides:
getSpecID in class WorkletRecord
Returns:
the id of the spec of the case that raised the exception

getOwnerCaseMonitor

public CaseMonitor getOwnerCaseMonitor()
Returns:
the CaseMonitor that is the container for this HandlerRunner

getSuspendedList

public List<WorkItemRecord> getSuspendedList()
Returns:
the list of currently suspended workitems for this runner

getDatalist

public org.jdom.Element getDatalist()
Overrides:
getDatalist in class WorkletRecord
Returns:
the data params for the parent workitem/case

getUpdatedData

public org.jdom.Element getUpdatedData()

setItemSuspended

public void setItemSuspended()
called when an action suspends the workitem of this HandlerRunner


unsetItemSuspended

public void unsetItemSuspended()
called when an action unsuspends the workitem of this HandlerRunner


setCaseSuspended

public void setCaseSuspended()
called when an action suspends the case of this HandlerRunner


unsetCaseSuspended

public void unsetCaseSuspended()
called when an action unsuspends the case of this HandlerRunner


setOwnerCaseMonitor

public void setOwnerCaseMonitor(CaseMonitor monitor)

setSuspendedList

public void setSuspendedList(List<WorkItemRecord> items)
called when an action suspends the item or parent case of this HandlerRunner


unsetSuspendedList

public void unsetSuspendedList()
called when an action unsuspends the item or parent case of this HandlerRunner


get_id

public int get_id()

set_id

public void set_id(int id)

initNonPersistedItems

public void initNonPersistedItems()
re-converts stringified persisted data back to data members after restore


incActionIndex

public int incActionIndex()

hasNextAction

public boolean hasNextAction()
Returns:
true if there is another action to run in the set

isItemSuspended

public boolean isItemSuspended()

isCaseSuspended

public boolean isCaseSuspended()

toString

public String toString()
Description copied from class: WorkletRecord
returns a String representation of current WorkletRecord

Overrides:
toString in class WorkletRecord

saveSearchResults

public void saveSearchResults()
writes the node id's for the nodes returned from the rdr search and the data for the current workitem, to a file for later input into the 'add rule' process, if required

Overrides:
saveSearchResults in class WorkletRecord


Copyright © 2004-2012 The YAWL Foundation.