org.yawlfoundation.yawl.engine
Class YNetRunner

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.YNetRunner

public class YNetRunner
extends Object

Author:
Lachlan Aldred Date: 16/04/2003 Time: 16:08:01, Michael Adams (for v2)

Nested Class Summary
static class YNetRunner.ExecutionStatus
           
 
Field Summary
protected  YNet _net
           
 
Constructor Summary
protected YNetRunner()
           
  YNetRunner(YPersistenceManager pmgr, YNet netPrototype, org.jdom.Element paramsData, String caseID)
           
  YNetRunner(YPersistenceManager pmgr, YNet netPrototype, YCompositeTask container, YIdentifier caseIDForNet, org.jdom.Element incomingData)
          Constructor called by a composite task (creating a sub-net runner)
 
Method Summary
 void addBusyTask(YTask ext)
           
 void addEnabledTask(YTask ext)
           
 YIdentifier addNewInstance(YPersistenceManager pmgr, String taskID, YIdentifier aSiblingInstance, org.jdom.Element newInstanceData)
           
 List<YIdentifier> attemptToFireAtomicTask(YPersistenceManager pmgr, String taskID)
           
 void cancel(YPersistenceManager pmgr)
           
 void cancelTask(YPersistenceManager pmgr, String taskID)
          cancels the specified task
 boolean completeWorkItemInTask(YPersistenceManager pmgr, YWorkItem workItem, org.jdom.Document outputData)
           
 boolean completeWorkItemInTask(YPersistenceManager pmgr, YWorkItem workItem, YIdentifier caseID, String taskID, org.jdom.Document outputData)
           
 boolean continueIfPossible(YPersistenceManager pmgr)
           
 void dump()
           
 boolean endOfNetReached()
           
 boolean equals(Object other)
           
 boolean evaluateTimerPredicate(String predicate)
           
 String get_caseID()
           
 YIdentifier get_caseIDForNet()
           
 Map<String,String> get_timerStates()
           
protected  Set<YTask> getActiveTasks()
           
 Set<String> getBusyTaskNames()
           
protected  Set<YTask> getBusyTasks()
           
 YIdentifier getCaseID()
           
 String getContainingTaskID()
           
 Set<String> getEnabledTaskNames()
           
protected  Set<YTask> getEnabledTasks()
           
 String getExecutionStatus()
           
 YNet getNet()
           
 YNetData getNetData()
           
 YExternalNetElement getNetElement(String id)
           
 YSpecificationID getSpecificationID()
           
 long getStartTime()
           
 List<String> getTimeOutTaskSet(YWorkItem item)
          returns a list of all workitems executing in parallel to the time-out workitem passed (the list includes the time-out task)
protected  boolean hasActiveTasks()
           
 int hashCode()
           
 boolean hasNormalState()
           
 void initTimerStates()
           
 boolean isAddEnabled(String taskID, YIdentifier childID)
           
 boolean isAlive()
           
 boolean isCompleted()
           
 boolean isEmpty()
           
 boolean isInSuspense()
           
 boolean isResuming()
           
 boolean isSuspended()
           
 boolean isSuspending()
           
 boolean isTimeServiceTask(YWorkItem item)
          returns true if the specified workitem is registered with the Time Service
 void kick(YPersistenceManager pmgr)
          Assumption: this will only get called AFTER a workitem has been progressed? Because if it is called any other time then it will cause the case to stop.
protected  void processEmptyTask(YAtomicTask task, YPersistenceManager pmgr)
           
 Set<YAnnouncement> refreshAnnouncements()
           
 void removeActiveTask(YPersistenceManager pmgr, YTask task)
           
 void removeFromPersistence(YPersistenceManager pmgr)
           
 void restoreObservers()
          restores the IB and IX observers on session startup (via persistence)
 void restoreTimerStates()
           
 boolean rollbackWorkItem(YPersistenceManager pmgr, YIdentifier caseID, String taskID)
           
 void set_caseID(String ID)
           
 void set_caseIDForNet(YIdentifier id)
           
 void set_timerStates(Map<String,String> states)
           
 void setContainingTask(YCompositeTask task)
           
 void setContainingTaskID(String taskid)
           
 void setEngine(YEngine engine)
           
 void setExecutionStatus(String status)
           
 void setNet(YNet net)
           
 void setNetData(YNetData data)
           
 void setObserver(YAWLServiceReference observer)
           
 void setSpecificationID(YSpecificationID id)
           
 void setStartTime(long time)
           
 void setStateNormal()
           
 void setStateResuming()
           
 void setStateSuspended()
           
 void setStateSuspending()
           
 void start(YPersistenceManager pmgr)
           
 void startWorkItemInTask(YPersistenceManager pmgr, YIdentifier caseID, String taskID)
           
 void startWorkItemInTask(YPersistenceManager pmgr, YWorkItem workItem)
           
 String toString()
           
 void updateTimerState(YTask task, YWorkItemTimer.State state)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_net

protected YNet _net
Constructor Detail

YNetRunner

protected YNetRunner()

YNetRunner

public YNetRunner(YPersistenceManager pmgr,
                  YNet netPrototype,
                  org.jdom.Element paramsData,
                  String caseID)
           throws YDataStateException,
                  YPersistenceException
Throws:
YDataStateException
YPersistenceException

YNetRunner

public YNetRunner(YPersistenceManager pmgr,
                  YNet netPrototype,
                  YCompositeTask container,
                  YIdentifier caseIDForNet,
                  org.jdom.Element incomingData)
           throws YDataStateException,
                  YPersistenceException
Constructor called by a composite task (creating a sub-net runner)

Parameters:
pmgr -
netPrototype -
container -
caseIDForNet -
incomingData -
Throws:
YDataStateException
YPersistenceException
Method Detail

refreshAnnouncements

public Set<YAnnouncement> refreshAnnouncements()

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

setContainingTask

public void setContainingTask(YCompositeTask task)

getContainingTaskID

public String getContainingTaskID()

setContainingTaskID

public void setContainingTaskID(String taskid)

setNet

public void setNet(YNet net)

getNet

public YNet getNet()

setEngine

public void setEngine(YEngine engine)

getSpecificationID

public YSpecificationID getSpecificationID()

setSpecificationID

public void setSpecificationID(YSpecificationID id)

getNetData

public YNetData getNetData()

setNetData

public void setNetData(YNetData data)

get_caseIDForNet

public YIdentifier get_caseIDForNet()

set_caseIDForNet

public void set_caseIDForNet(YIdentifier id)

addBusyTask

public void addBusyTask(YTask ext)

addEnabledTask

public void addEnabledTask(YTask ext)

removeActiveTask

public void removeActiveTask(YPersistenceManager pmgr,
                             YTask task)
                      throws YPersistenceException
Throws:
YPersistenceException

get_caseID

public String get_caseID()

set_caseID

public void set_caseID(String ID)

getEnabledTaskNames

public Set<String> getEnabledTaskNames()

getBusyTaskNames

public Set<String> getBusyTaskNames()

getStartTime

public long getStartTime()

setStartTime

public void setStartTime(long time)

start

public void start(YPersistenceManager pmgr)
           throws YPersistenceException,
                  YDataStateException,
                  YQueryException,
                  YStateException
Throws:
YPersistenceException
YDataStateException
YQueryException
YStateException

isAlive

public boolean isAlive()

kick

public void kick(YPersistenceManager pmgr)
          throws YPersistenceException,
                 YDataStateException,
                 YQueryException,
                 YStateException
Assumption: this will only get called AFTER a workitem has been progressed? Because if it is called any other time then it will cause the case to stop.

Parameters:
pmgr -
Throws:
YPersistenceException
YDataStateException
YQueryException
YStateException

attemptToFireAtomicTask

public List<YIdentifier> attemptToFireAtomicTask(YPersistenceManager pmgr,
                                                 String taskID)
                                          throws YDataStateException,
                                                 YStateException,
                                                 YQueryException,
                                                 YPersistenceException
Throws:
YDataStateException
YStateException
YQueryException
YPersistenceException

addNewInstance

public YIdentifier addNewInstance(YPersistenceManager pmgr,
                                  String taskID,
                                  YIdentifier aSiblingInstance,
                                  org.jdom.Element newInstanceData)
                           throws YDataStateException,
                                  YStateException,
                                  YQueryException,
                                  YPersistenceException
Throws:
YDataStateException
YStateException
YQueryException
YPersistenceException

startWorkItemInTask

public void startWorkItemInTask(YPersistenceManager pmgr,
                                YWorkItem workItem)
                         throws YDataStateException,
                                YPersistenceException,
                                YQueryException,
                                YStateException
Throws:
YDataStateException
YPersistenceException
YQueryException
YStateException

startWorkItemInTask

public void startWorkItemInTask(YPersistenceManager pmgr,
                                YIdentifier caseID,
                                String taskID)
                         throws YDataStateException,
                                YPersistenceException,
                                YQueryException,
                                YStateException
Throws:
YDataStateException
YPersistenceException
YQueryException
YStateException

completeWorkItemInTask

public boolean completeWorkItemInTask(YPersistenceManager pmgr,
                                      YWorkItem workItem,
                                      org.jdom.Document outputData)
                               throws YDataStateException,
                                      YStateException,
                                      YQueryException,
                                      YPersistenceException
Throws:
YDataStateException
YStateException
YQueryException
YPersistenceException

completeWorkItemInTask

public boolean completeWorkItemInTask(YPersistenceManager pmgr,
                                      YWorkItem workItem,
                                      YIdentifier caseID,
                                      String taskID,
                                      org.jdom.Document outputData)
                               throws YDataStateException,
                                      YStateException,
                                      YQueryException,
                                      YPersistenceException
Throws:
YDataStateException
YStateException
YQueryException
YPersistenceException

continueIfPossible

public boolean continueIfPossible(YPersistenceManager pmgr)
                           throws YDataStateException,
                                  YStateException,
                                  YQueryException,
                                  YPersistenceException
Throws:
YDataStateException
YStateException
YQueryException
YPersistenceException

processEmptyTask

protected void processEmptyTask(YAtomicTask task,
                                YPersistenceManager pmgr)
                         throws YDataStateException,
                                YStateException,
                                YQueryException,
                                YPersistenceException
Throws:
YDataStateException
YStateException
YQueryException
YPersistenceException

cancel

public void cancel(YPersistenceManager pmgr)
            throws YPersistenceException
Throws:
YPersistenceException

removeFromPersistence

public void removeFromPersistence(YPersistenceManager pmgr)
                           throws YPersistenceException
Throws:
YPersistenceException

rollbackWorkItem

public boolean rollbackWorkItem(YPersistenceManager pmgr,
                                YIdentifier caseID,
                                String taskID)
                         throws YPersistenceException
Throws:
YPersistenceException

getNetElement

public YExternalNetElement getNetElement(String id)

getCaseID

public YIdentifier getCaseID()

isCompleted

public boolean isCompleted()

endOfNetReached

public boolean endOfNetReached()

isEmpty

public boolean isEmpty()

getBusyTasks

protected Set<YTask> getBusyTasks()

getEnabledTasks

protected Set<YTask> getEnabledTasks()

getActiveTasks

protected Set<YTask> getActiveTasks()

hasActiveTasks

protected boolean hasActiveTasks()

isAddEnabled

public boolean isAddEnabled(String taskID,
                            YIdentifier childID)

setObserver

public void setObserver(YAWLServiceReference observer)

toString

public String toString()
Overrides:
toString in class Object

dump

public void dump()

restoreObservers

public void restoreObservers()
restores the IB and IX observers on session startup (via persistence)


cancelTask

public void cancelTask(YPersistenceManager pmgr,
                       String taskID)
cancels the specified task


isTimeServiceTask

public boolean isTimeServiceTask(YWorkItem item)
returns true if the specified workitem is registered with the Time Service


getTimeOutTaskSet

public List<String> getTimeOutTaskSet(YWorkItem item)
returns a list of all workitems executing in parallel to the time-out workitem passed (the list includes the time-out task)


initTimerStates

public void initTimerStates()

restoreTimerStates

public void restoreTimerStates()

updateTimerState

public void updateTimerState(YTask task,
                             YWorkItemTimer.State state)

get_timerStates

public Map<String,String> get_timerStates()

set_timerStates

public void set_timerStates(Map<String,String> states)

evaluateTimerPredicate

public boolean evaluateTimerPredicate(String predicate)
                               throws YQueryException
Throws:
YQueryException

isSuspending

public boolean isSuspending()

isSuspended

public boolean isSuspended()

isResuming

public boolean isResuming()

isInSuspense

public boolean isInSuspense()

hasNormalState

public boolean hasNormalState()

setStateSuspending

public void setStateSuspending()

setStateSuspended

public void setStateSuspended()

setStateResuming

public void setStateResuming()

setStateNormal

public void setStateNormal()

setExecutionStatus

public void setExecutionStatus(String status)

getExecutionStatus

public String getExecutionStatus()


Copyright © 2004-2012 The YAWL Foundation.