com.waveset.object
Class WFProcess.Action

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.object.WorkflowComponent
          extended bycom.waveset.object.WFProcess.Action
All Implemented Interfaces:
com.sun.idm.debugger.common.Locatable, javax.naming.Referenceable, XmlObject
Enclosing class:
WFProcess

public static class WFProcess.Action
extends WorkflowComponent

Actions are descriptions of an operation that is performed within an Activity. This has gotten complex as we've defined several action "types". // * A case could be made for creating a // * class hierarchy here, but its simple enough that I don't think // * the added complexity is justified.

The following are the "types" of actions.

  1. Application: A simple automatic invociation of an application, linked through the WorkflowApplication interface. Application actions can receive arguments and variables, and return variables.
  2. Manual: An action that must be completed with human interaction. We allow a Form to specify the names of variables to be requested of the user, and create a WorkItem in the repository for the owner(s) of the action.
  3. Expression: An automatic action that is defined using an expression in the "Ex" language.
  4. Subprocess: An action performed by recursively invoking another workflow process. We only allow subprocesses defined within the root process.

A recent addition is the concept of "iteration", where an action is repeated some number of times. I'm not entirely happy with the way this is defined or modeled, but the alternatives all feel more complex, and I want a simple declarative iteration statement.


Field Summary
static java.lang.String ATT_APPLICATION
           
static java.lang.String ATT_AUTH_TYPE
           
static java.lang.String ATT_CHECK
           
static java.lang.String ATT_HIDDEN
           
static java.lang.String ATT_ID
           
static java.lang.String ATT_IGNORE_TIMEOUT
           
static java.lang.String ATT_ITEM_TYPE
           
static java.lang.String ATT_NAME
           
static java.lang.String ATT_SUB
           
static java.lang.String ATT_SYNCEXEC
           
static java.lang.String ATT_TIMEOUT
           
static java.lang.String DEP_APPCLASS
           
static java.lang.String DEP_CLASS
           
static java.lang.String EL_COMMENTS
           
static java.lang.String EL_CONDITION
           
static java.lang.String EL_DELEGATOR
           
static java.lang.String EL_DESCRIPTION
           
static java.lang.String EL_EDITABLE_VARIABLES
           
static java.lang.String EL_EXPOSED_VARIABLES
           
static java.lang.String EL_EXTPROC
           
static java.lang.String EL_FORM_RULE
           
static java.lang.String EL_FORMREF
           
static java.lang.String EL_OWNER
           
static java.lang.String EL_REPORT_TITLE
           
static java.lang.String EL_REQUEST
           
static java.lang.String EL_REQUESTER
           
static java.lang.String EL_SCRIPT
           
static java.lang.String EL_SUB_PROCESS
           
static java.lang.String EL_TIMEOUT
           
static java.lang.String EL_VIEWS
           
static java.lang.String EL_WORKITEM_NAME
           
static java.lang.String EL_WORKITEM_TRACKING_ID
           
static java.lang.String ELEMENT
           
static java.lang.String MANUAL_ELEMENT
           
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace, code_id
 
Constructor Summary
WFProcess.Action()
           
WFProcess.Action(org.w3c.dom.Element e)
           
 
Method Summary
 void addExpression(ExNode node)
          When writing XML by hand, it is a very common error to forget the around multi statement expressions.
 void addNameList(java.lang.StringBuffer b, int indent, java.lang.String wrapper, java.util.List names)
          Store a list of names with a wrapper element.
 WFProcess.Activity getActivity()
           
 java.lang.String getApplication()
           
 WFProcess.Argument getArgument(java.lang.String name)
          Lookup an argument definition by name.
 WFProcess.Argument[] getArguments()
           
 java.lang.String getAuthType()
           
 java.lang.String getComments()
           
 ExNode getCondition()
           
 ExNode getDelegatorExpression()
           
 ExNode getDescriptionExpression()
           
 ExNode getEditableVariables()
           
 java.lang.String getElementName()
          Return the element name.
 ExNode getExposedVariables()
           
 ExNode getExpression()
           
 ObjectRef getFormRef()
           
 ExNode getFormRule()
           
 int getId()
           
 java.lang.String getItemType()
           
 WFProcess.Iteration getIteration()
           
 Form getLocalForm()
           
 WFProcess getLocalProcess(java.lang.String name)
          Attempt to resolve a reference to a local process definition.
 ExNode getNameExpression()
           
 java.util.List getNameList(org.w3c.dom.Element wrapper)
          Given a wrapper element expected to contain one or more elements, return a list of strings.
 java.lang.String getOwner()
           
 ExNode getOwnerExpression()
           
 ExNode getRequesterExpression()
           
 ExNode getRequestExpression()
           
 WFProcess.ActionResult[] getResults()
           
 WFProcess.Return[] getReturns()
           
 java.lang.String getSubProcess()
           
 ExNode getSubProcessExpression()
           
 int getTimeout()
           
 ExNode getTimeoutExpression()
           
 ExNode getTitleExpression()
           
 ExNode getTrackingIdExpression()
           
 Variable getVariable(java.lang.String name)
          Get the declaration of a variable by name.
 Variable[] getVariables()
           
 java.util.List getViews()
           
 boolean isCheckError()
           
 boolean isHidden()
           
 boolean isIgnoreTimeout()
           
 boolean isManual()
           
 boolean isSubProcess()
           
 boolean isSyncExec()
           
 void parseXml(org.w3c.dom.Element e)
          Parse the XML for an action element.
 void setActivity(WFProcess.Activity a)
           
 void setApplication(java.lang.String s)
           
 void setArguments(WFProcess.Argument[] args)
           
 void setAuthType(java.lang.String s)
           
 void setCheckError(boolean b)
           
 void setComments(java.lang.String s)
           
 void setCondition(ExNode node)
           
 void setDelegatorExpression(ExNode node)
           
 void setDescriptionExpression(ExNode node)
           
 void setEditableVariables(ExNode expression)
           
 void setExposedVariables(ExNode expression)
           
 void setExpression(ExNode node)
           
 void setFormRef(ObjectRef ref)
           
 void setFormRule(ExNode node)
           
 void setHidden(boolean b)
           
protected  void setId(int i)
           
 void setIgnoreTimeout(boolean b)
           
 void setItemType(java.lang.String s)
           
 void setIteration(WFProcess.Iteration it)
           
 void setLocalForm(Form f)
           
 void setManual(boolean b)
           
 void setNameExpression(ExNode node)
           
 void setOwner(java.lang.String s)
           
 void setOwnerExpression(ExNode node)
           
 void setRequesterExpression(ExNode node)
           
 void setRequestExpression(ExNode node)
           
 void setResults(WFProcess.ActionResult[] results)
           
 void setReturns(WFProcess.Return[] rets)
           
 void setSubProcess(java.lang.String s)
           
 void setSubProcessExpression(ExNode node)
           
 void setSyncExec(boolean b)
           
 void setTimeout(int i)
           
 void setTimeoutExpression(ExNode node)
           
 void setTitleExpression(ExNode node)
           
 void setTrackingIdExpression(ExNode node)
           
 void setVariables(Variable[] vars)
           
 void setViews(java.util.List views)
           
 void toXml(java.lang.StringBuffer b, int indent)
          Emit the XML for an action.
 
Methods inherited from class com.waveset.object.WorkflowComponent
addCommonAttributes, getLocation, getName, getParentComponent, parseCommonAttributes, setLocation, setName, setParentComponent
 
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
 

Field Detail

ELEMENT

public static final java.lang.String ELEMENT
See Also:
Constant Field Values

ATT_ID

public static final java.lang.String ATT_ID
See Also:
Constant Field Values

ATT_NAME

public static final java.lang.String ATT_NAME
See Also:
Constant Field Values

ATT_APPLICATION

public static final java.lang.String ATT_APPLICATION
See Also:
Constant Field Values

ATT_SUB

public static final java.lang.String ATT_SUB
See Also:
Constant Field Values

ATT_TIMEOUT

public static final java.lang.String ATT_TIMEOUT
See Also:
Constant Field Values

ATT_HIDDEN

public static final java.lang.String ATT_HIDDEN
See Also:
Constant Field Values

ATT_SYNCEXEC

public static final java.lang.String ATT_SYNCEXEC
See Also:
Constant Field Values

ATT_CHECK

public static final java.lang.String ATT_CHECK
See Also:
Constant Field Values

ATT_IGNORE_TIMEOUT

public static final java.lang.String ATT_IGNORE_TIMEOUT
See Also:
Constant Field Values

ATT_ITEM_TYPE

public static final java.lang.String ATT_ITEM_TYPE
See Also:
Constant Field Values

ATT_AUTH_TYPE

public static final java.lang.String ATT_AUTH_TYPE
See Also:
Constant Field Values

DEP_CLASS

public static final java.lang.String DEP_CLASS
See Also:
Constant Field Values

DEP_APPCLASS

public static final java.lang.String DEP_APPCLASS
See Also:
Constant Field Values

MANUAL_ELEMENT

public static final java.lang.String MANUAL_ELEMENT
See Also:
Constant Field Values

EL_OWNER

public static final java.lang.String EL_OWNER
See Also:
Constant Field Values

EL_WORKITEM_NAME

public static final java.lang.String EL_WORKITEM_NAME
See Also:
Constant Field Values

EL_WORKITEM_TRACKING_ID

public static final java.lang.String EL_WORKITEM_TRACKING_ID
See Also:
Constant Field Values

EL_FORMREF

public static final java.lang.String EL_FORMREF
See Also:
Constant Field Values

EL_FORM_RULE

public static final java.lang.String EL_FORM_RULE
See Also:
Constant Field Values

EL_REPORT_TITLE

public static final java.lang.String EL_REPORT_TITLE
See Also:
Constant Field Values

EL_TIMEOUT

public static final java.lang.String EL_TIMEOUT
See Also:
Constant Field Values

EL_SCRIPT

public static final java.lang.String EL_SCRIPT
See Also:
Constant Field Values

EL_CONDITION

public static final java.lang.String EL_CONDITION
See Also:
Constant Field Values

EL_COMMENTS

public static final java.lang.String EL_COMMENTS
See Also:
Constant Field Values

EL_SUB_PROCESS

public static final java.lang.String EL_SUB_PROCESS
See Also:
Constant Field Values

EL_EXTPROC

public static final java.lang.String EL_EXTPROC
See Also:
Constant Field Values

EL_REQUEST

public static final java.lang.String EL_REQUEST
See Also:
Constant Field Values

EL_REQUESTER

public static final java.lang.String EL_REQUESTER
See Also:
Constant Field Values

EL_DESCRIPTION

public static final java.lang.String EL_DESCRIPTION
See Also:
Constant Field Values

EL_DELEGATOR

public static final java.lang.String EL_DELEGATOR
See Also:
Constant Field Values

EL_EXPOSED_VARIABLES

public static final java.lang.String EL_EXPOSED_VARIABLES
See Also:
Constant Field Values

EL_EDITABLE_VARIABLES

public static final java.lang.String EL_EDITABLE_VARIABLES
See Also:
Constant Field Values

EL_VIEWS

public static final java.lang.String EL_VIEWS
See Also:
Constant Field Values
Constructor Detail

WFProcess.Action

public WFProcess.Action()

WFProcess.Action

public WFProcess.Action(org.w3c.dom.Element e)
                 throws WavesetException
Method Detail

getActivity

public WFProcess.Activity getActivity()

setActivity

public void setActivity(WFProcess.Activity a)

getId

public int getId()

setId

protected void setId(int i)

isManual

public boolean isManual()

setManual

public void setManual(boolean b)

getExpression

public ExNode getExpression()

setExpression

public void setExpression(ExNode node)

addExpression

public void addExpression(ExNode node)
When writing XML by hand, it is a very common error to forget the around multi statement expressions. We'll generate one automatically.


getSubProcess

public java.lang.String getSubProcess()

setSubProcess

public void setSubProcess(java.lang.String s)

getSubProcessExpression

public ExNode getSubProcessExpression()

setSubProcessExpression

public void setSubProcessExpression(ExNode node)

isSubProcess

public boolean isSubProcess()

getApplication

public java.lang.String getApplication()

setApplication

public void setApplication(java.lang.String s)

getOwner

public java.lang.String getOwner()

setOwner

public void setOwner(java.lang.String s)

getOwnerExpression

public ExNode getOwnerExpression()

setOwnerExpression

public void setOwnerExpression(ExNode node)

getDelegatorExpression

public ExNode getDelegatorExpression()

setDelegatorExpression

public void setDelegatorExpression(ExNode node)

getNameExpression

public ExNode getNameExpression()

setNameExpression

public void setNameExpression(ExNode node)

getTrackingIdExpression

public ExNode getTrackingIdExpression()

setTrackingIdExpression

public void setTrackingIdExpression(ExNode node)

getArguments

public WFProcess.Argument[] getArguments()

setArguments

public void setArguments(WFProcess.Argument[] args)

getVariables

public Variable[] getVariables()

setVariables

public void setVariables(Variable[] vars)

getReturns

public WFProcess.Return[] getReturns()

setReturns

public void setReturns(WFProcess.Return[] rets)

getResults

public WFProcess.ActionResult[] getResults()

setResults

public void setResults(WFProcess.ActionResult[] results)

getIteration

public WFProcess.Iteration getIteration()

setIteration

public void setIteration(WFProcess.Iteration it)

getArgument

public WFProcess.Argument getArgument(java.lang.String name)
Lookup an argument definition by name. Is this necessary?


getVariable

public Variable getVariable(java.lang.String name)
Get the declaration of a variable by name. Used by VariableScope implementations over in the Case object, to see who defines the variable.

We're not expecting to have many of these, so we'll just do a linear search.


getFormRef

public ObjectRef getFormRef()

setFormRef

public void setFormRef(ObjectRef ref)

getLocalForm

public Form getLocalForm()

setLocalForm

public void setLocalForm(Form f)

getFormRule

public ExNode getFormRule()

setFormRule

public void setFormRule(ExNode node)

getTitleExpression

public ExNode getTitleExpression()

setTitleExpression

public void setTitleExpression(ExNode node)

getRequestExpression

public ExNode getRequestExpression()

setRequestExpression

public void setRequestExpression(ExNode node)

getRequesterExpression

public ExNode getRequesterExpression()

setRequesterExpression

public void setRequesterExpression(ExNode node)

getDescriptionExpression

public ExNode getDescriptionExpression()

setDescriptionExpression

public void setDescriptionExpression(ExNode node)

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int i)

getTimeoutExpression

public ExNode getTimeoutExpression()

setTimeoutExpression

public void setTimeoutExpression(ExNode node)

isHidden

public boolean isHidden()

setHidden

public void setHidden(boolean b)

getCondition

public ExNode getCondition()

setCondition

public void setCondition(ExNode node)

setComments

public void setComments(java.lang.String s)

getComments

public java.lang.String getComments()

setSyncExec

public void setSyncExec(boolean b)

isSyncExec

public boolean isSyncExec()

setCheckError

public void setCheckError(boolean b)

isCheckError

public boolean isCheckError()

getExposedVariables

public ExNode getExposedVariables()

setExposedVariables

public void setExposedVariables(ExNode expression)

getEditableVariables

public ExNode getEditableVariables()

setEditableVariables

public void setEditableVariables(ExNode expression)

setViews

public void setViews(java.util.List views)

getViews

public java.util.List getViews()

setIgnoreTimeout

public void setIgnoreTimeout(boolean b)

isIgnoreTimeout

public boolean isIgnoreTimeout()

getLocalProcess

public WFProcess getLocalProcess(java.lang.String name)
                          throws WavesetException
Attempt to resolve a reference to a local process definition. Note that subprocess definitions can be nested but are usually all gathered at the top level. There is only one namespace for subprocesses, though I suppose we could support scoping of these. Its not a big deal since we're favoring external processes these days.

Throws:
WavesetException

setItemType

public void setItemType(java.lang.String s)

getItemType

public java.lang.String getItemType()

setAuthType

public void setAuthType(java.lang.String s)

getAuthType

public java.lang.String getAuthType()

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

parseXml

public void parseXml(org.w3c.dom.Element e)
              throws WavesetException
Parse the XML for an action element.

Throws:
WavesetException

getNameList

public java.util.List getNameList(org.w3c.dom.Element wrapper)
                           throws WavesetException
Given a wrapper element expected to contain one or more elements, return a list of strings.

Throws:
WavesetException

addNameList

public void addNameList(java.lang.StringBuffer b,
                        int indent,
                        java.lang.String wrapper,
                        java.util.List names)
Store a list of names with a wrapper element. Could just serialize the List, but that adds an extra wrapper which is unnecessary.


toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Emit the XML for an action.

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