com.waveset.object
Class WFCase.Step

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.object.VariableScope
          extended bycom.waveset.object.WFCase.Step
All Implemented Interfaces:
javax.naming.Referenceable, VariableResolver, XmlObject
Enclosing class:
WFCase

public static class WFCase.Step
extends VariableScope

A class used to represent the execution state of an Activity from the process definition.


Nested Class Summary
static class WFCase.Step.State
          An "enumeration" of constants used to indicate the state of the step.
 
Field Summary
 
Fields inherited from class com.waveset.object.VariableScope
code_id
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
WFCase.Step()
          Construct an empty step object.
WFCase.Step(org.w3c.dom.Element e)
          Construct a activity object from its XML representation.
 
Method Summary
 void addAttribute(java.lang.StringBuffer b, java.lang.String name, int[] values)
          Serialize an int array into a blank delimited string and emit it as the value of an XML attribute.
 void addJoin(int index)
          Add a step join.
 WFCase.Result addResult(WFProcess.Action action)
          Allocate a new action result object corresponding to a WFProcess.Action object.
 void addTransition(int index)
          Add a step transition.
 WFProcess.Activity getActivity()
          Get the resolved Activity object.
 int getActivityId()
          Get the process activity id.
 java.lang.String getActivityName()
          Get the name of the associated step activity.
 WFCase getCase()
          Get the owning case.
 java.lang.String getElementName()
          Return the element name.
 long getEndDate()
           
 int[] getFeeds()
          Get the step feeds.
 int getId()
          Get the step id.
 int[] getIntArrayAttribute(org.w3c.dom.Element e, java.lang.String name)
          Parse the attribute representation of an integer array.
 WFCase.Result getItemResult(java.lang.String itemId)
          Locate the Result object that tracks the state of a particular work item.
 int[] getJoins()
          Get the step joins.
 java.lang.String getName()
          Get a string describing this step.
 VariableScope getParentScope()
          Return the parent scope.
 WFCase.Result getResult(int index)
          Get a result object by index.
 int getResultCount()
          Get the number of results in the list.
 WFCase.Result getResultForAction(int actionId)
          Get a Result object given its action id.
 java.util.List getResults()
          Get the action result list.
 long getStartDate()
           
 WFCase.Step.State getState()
          Get the step state.
 java.lang.String getTitle()
          Get the last generated report title.
 int[] getTransitions()
          Get the step transitions.
 boolean isComplete()
           
 boolean isCompletionChecked()
          Test the completion checked flag.
 boolean isExecuting()
           
 boolean isInactive()
           
 boolean isJoinBreak()
          Test the join break flag.
 boolean isReady()
           
 boolean isVariableDefined(java.lang.String name)
          Test to see if the variable is defined in this scope.
 boolean isWaiting()
           
protected  void setActivity(WFProcess.Activity act)
          Set the resolved activity object if we happen to know it.
protected  void setActivityId(int id)
          Set the process activity id.
protected  void setCase(WFCase c)
          Set the owning case.
 void setComplete()
           
 void setCompletionChecked(boolean b)
          Set the completion checked flag.
 void setEndDate()
           
 void setExecuting()
           
 void setFeeds(int[] feeds)
          Set the step feeds.
protected  void setId(int id)
          Set the step id.
 void setInactive()
           
 void setJoinBreak(boolean b)
          Set the join break flag.
 void setJoins(int[] joins)
          Set the step joins.
 void setReady()
           
 void setStartDate()
           
 void setTitle(java.lang.String s)
          Set the report title.
 void setTransitions(int[] trans)
          Set the step transitions.
 void setWaiting()
           
 void toXml(java.lang.StringBuffer b, int indent)
          Emit the XML representation of the step.
 
Methods inherited from class com.waveset.object.VariableScope
assimilateLocalVariables, clearLocalVariables, expandVariables, getLocalVariable, getLocalVariables, getVariable, getVariables, getVariables, pruneGenericObjects, removeLocalVariable, resolveVariable, setLocalVariable, setLocalVariables, setVariable
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WFCase.Step

public WFCase.Step()
Construct an empty step object.


WFCase.Step

public WFCase.Step(org.w3c.dom.Element e)
            throws WavesetException
Construct a activity object from its XML representation.

Method Detail

getParentScope

public VariableScope getParentScope()
Description copied from class: VariableScope
Return the parent scope.

Specified by:
getParentScope in class VariableScope

isVariableDefined

public boolean isVariableDefined(java.lang.String name)
                          throws WavesetException
Description copied from class: VariableScope
Test to see if the variable is defined in this scope.

Specified by:
isVariableDefined in class VariableScope
Throws:
WavesetException

getElementName

public java.lang.String getElementName()
Description copied from class: AbstractXmlObject
Return the element name.

Specified by:
getElementName in interface XmlObject
Specified by:
getElementName in class AbstractXmlObject

getName

public java.lang.String getName()
Get a string describing this step. No formal specification yet, used for trace messages. Consider calculating these and leaving them behind...


getCase

public WFCase getCase()
Get the owning case.


setCase

protected void setCase(WFCase c)
Set the owning case.


getId

public int getId()
Get the step id.


setId

protected void setId(int id)
Set the step id. This should only be called by the WFCase.addActivityInstance as it populates the activities list.


getActivityId

public int getActivityId()
Get the process activity id. This may be used as an argument to the WFProcess.getActivity method.


setActivityId

protected void setActivityId(int id)
Set the process activity id. Not sure if this needs to be public, it may only be required by WFCase.addStep.


getActivity

public WFProcess.Activity getActivity()
                               throws WavesetException
Get the resolved Activity object.

Throws:
WavesetException

getActivityName

public java.lang.String getActivityName()
Get the name of the associated step activity. This is provided mostly for convenience in trace messages.


setActivity

protected void setActivity(WFProcess.Activity act)
Set the resolved activity object if we happen to know it.


getState

public WFCase.Step.State getState()
Get the step state.


getFeeds

public int[] getFeeds()
Get the step feeds.


setFeeds

public void setFeeds(int[] feeds)
Set the step feeds.


getJoins

public int[] getJoins()
Get the step joins.


setJoins

public void setJoins(int[] joins)
Set the step joins.


addJoin

public void addJoin(int index)
Add a step join. These come in incrementally unlike feeds which can be calculated all at once.


getTransitions

public int[] getTransitions()
Get the step transitions.


setTransitions

public void setTransitions(int[] trans)
Set the step transitions.


addTransition

public void addTransition(int index)
Add a step transition. Its more convenient to add these incrementally.


isCompletionChecked

public boolean isCompletionChecked()
Test the completion checked flag.


setCompletionChecked

public void setCompletionChecked(boolean b)
Set the completion checked flag.


getTitle

public java.lang.String getTitle()
Get the last generated report title.


setTitle

public void setTitle(java.lang.String s)
Set the report title.


isJoinBreak

public boolean isJoinBreak()
Test the join break flag.


setJoinBreak

public void setJoinBreak(boolean b)
Set the join break flag.


getResults

public java.util.List getResults()
Get the action result list. The list should not be modified.


getResultCount

public int getResultCount()
Get the number of results in the list. A convenience method for iterating over the result list.


getResult

public WFCase.Result getResult(int index)
Get a result object by index.


getResultForAction

public WFCase.Result getResultForAction(int actionId)
Get a Result object given its action id. We can assume these are array indexes at the moment.


addResult

public WFCase.Result addResult(WFProcess.Action action)
                        throws WavesetException
Allocate a new action result object corresponding to a WFProcess.Action object. There will be a fixed number of these, corresponding to each Action defined in the Activity, so we don't have to give them their own id number.

Throws:
WavesetException

getItemResult

public WFCase.Result getItemResult(java.lang.String itemId)
Locate the Result object that tracks the state of a particular work item.


isReady

public boolean isReady()

setReady

public void setReady()

isExecuting

public boolean isExecuting()

setExecuting

public void setExecuting()

isWaiting

public boolean isWaiting()

setWaiting

public void setWaiting()

isComplete

public boolean isComplete()

setComplete

public void setComplete()

isInactive

public boolean isInactive()

setInactive

public void setInactive()

setStartDate

public void setStartDate()

getStartDate

public long getStartDate()

setEndDate

public void setEndDate()

getEndDate

public long getEndDate()

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Emit the XML representation of the step.

Specified by:
toXml in interface XmlObject
Specified by:
toXml in class AbstractXmlObject

addAttribute

public void addAttribute(java.lang.StringBuffer b,
                         java.lang.String name,
                         int[] values)
Serialize an int array into a blank delimited string and emit it as the value of an XML attribute.


getIntArrayAttribute

public int[] getIntArrayAttribute(org.w3c.dom.Element e,
                                  java.lang.String name)
Parse the attribute representation of an integer array.