|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Process
A Process is the description of a task within a workflow. The task may be atomic or composed by several subtasks. It may also be abstract or concrete, depending on whether it only contains semantic information about the task requirements, or it also contains a binding to a specific service (or set of services).
By design, processes must be storable in a persistent medium. By making
this root interface extend Serializable
, plain/XML java
serialisation, and several ORM systems are supported.
Process instances must be thread-safe.
Method Summary | |
---|---|
void |
addListener(POMListener listener)
Adds a listener to this process. |
Process |
copy()
Makes a deep copy of this instance. |
void |
discover(ProcessEnvironment env)
Discovers service implementations for this process. |
ProcessController |
enact(ProcessEnvironment env)
Prepares the process for being enacted. |
void |
evaluate(ProcessEnvironment env)
Evaluates this process. |
Process |
findProcessById(java.net.URI id)
Searches through the entire workflow a Process instance with the given identifier. |
Process |
findRoot()
Finds the workflow root process. |
java.lang.String |
getAttribute(javax.xml.namespace.QName name)
Gets an attribute by its qualified name. |
java.lang.String |
getAttribute(java.lang.String name)
Gets an attribute by its name. |
java.lang.String |
getAttribute(java.lang.String ns,
java.lang.String local)
Gets an attribute by its name. |
java.util.Map<javax.xml.namespace.QName,java.lang.String> |
getAttributes()
Gets a map of attributes attached to this process instance. |
java.lang.String |
getDescription()
Gets a short description for this process. |
java.net.URI |
getId()
Gets the process identifier. |
Reference<?> |
getInput(java.lang.String name)
Gets an input reference by name. |
java.util.Map<java.lang.String,Reference<?>> |
getInputs()
Gets the map of references to input parameters. |
java.lang.Class<?> |
getInputType(java.lang.String name)
Gets the data type for the specified input parameter. |
java.lang.String |
getName()
Gets the process name. |
Reference<?> |
getOutput(java.lang.String name)
Gets an output reference by name. |
java.util.Map<java.lang.String,Reference<?>> |
getOutputs()
Gets the map of references to output parameters. |
java.lang.Class<?> |
getOutputType(java.lang.String name)
Gets the data type for the specified output parameter. |
Process |
getParent()
Gets the parent of this process. |
java.lang.String[] |
getUsedInputNames()
Gets the list of inputs directly used by this process. |
java.lang.String[] |
getUsedOutputNames()
Gets the list of outputs directly used by this process. |
void |
invalidate()
Marks this process as not validated. |
boolean |
isEvaluated()
Gets the evaluation state of this process. |
boolean |
isLazy()
Gets the value of the "lazy" attribute. |
boolean |
isValidated()
Gets the validation state of this process. |
void |
prioritise(ProcessEnvironment env,
java.util.PriorityQueue<Process> queue)
Determines the evaluation order of this process children. |
void |
putInput(java.lang.String key,
Reference<?> input)
Puts a reference into the map of input parameters for this process. |
void |
putOutput(java.lang.String key,
Reference<?> output)
Puts a reference into the map of output parameters for this process. |
void |
removeInput(java.lang.String key)
Removes a reference from the input map. |
void |
removeListener(POMListener listener)
Removes a listener from this process. |
void |
removeOutput(java.lang.String key)
Removes a reference from the output map. |
void |
reset()
Performs a clean up of the internal state of this process, and any children processes if they exist. |
void |
setAttribute(javax.xml.namespace.QName name,
java.lang.String value)
Sets an attribute value. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets an attribute value. |
void |
setDescription(java.lang.String description)
Sets a short description for this process. |
void |
setId(java.net.URI id)
Sets the process identifier. |
void |
setLazy(boolean lazy)
Sets the value of the "lazy" attribute. |
void |
setName(java.lang.String name)
Sets the process name. |
void |
setParent(Process parent)
Sets the parent of this process. |
void |
unuseInput(java.lang.String... names)
Removes the passed names from the list of needed inputs. |
void |
unuseOutput(java.lang.String... names)
Removes the passed names from the list of needed outputs. |
void |
useInput(java.lang.String name,
java.lang.Class<?> type)
Declares that this process requires an input parameter with the specified name and type. |
void |
useOutput(java.lang.String name,
java.lang.Class<?> type)
Declares that this process uses the set of outputs specified by the passed list. |
void |
validate()
Validates this process. |
Method Detail |
---|
java.net.URI getId()
void setId(java.net.URI id)
id
- The process identifierjava.lang.String getName()
The name is just for the user convenience, and it is not restricted in any way (or maybe just in its max length).
void setName(java.lang.String name)
The name is just for the user convenience, and it is not restricted in any way (or maybe just in its max length).
name
- The process namejava.lang.String getDescription()
void setDescription(java.lang.String description)
description
- A short descriptionjava.util.Map<javax.xml.namespace.QName,java.lang.String> getAttributes()
The content of these attributes is arbitrary, and may be used for different purposes like semantic description, QoS specification,
java.lang.String getAttribute(javax.xml.namespace.QName name)
name
- The attribute name
java.lang.String getAttribute(java.lang.String name)
This is equivalent to the following call:
getAttribute(new QName("", name));
name
- The local part of a QName with empty name-space
java.lang.String getAttribute(java.lang.String ns, java.lang.String local)
This is equivalent to the following call:
getAttribute(new QName(ns, local));
ns
- The name-spacelocal
- The local part
void setAttribute(javax.xml.namespace.QName name, java.lang.String value)
name
- The attribute qualified namevalue
- The attribute valuevoid setAttribute(java.lang.String name, java.lang.String value)
name
- The local part of a qualified name with empty name-spacevalue
- The attribute valueProcess copy()
Process getParent()
void setParent(Process parent)
The parent process can only be a ControlProcess or AbstractProcess instance.
parent
- The parent
java.lang.IllegalArgumentException
- If the passed parent process cannot
have childrenProcess findRoot()
Process findProcessById(java.net.URI id)
id
- A process Id
java.util.Map<java.lang.String,Reference<?>> getInputs()
java.util.Map<java.lang.String,Reference<?>> getOutputs()
Reference<?> getInput(java.lang.String name)
name
- The input name
Reference<?> getOutput(java.lang.String name)
name
- The output name
void putInput(java.lang.String key, Reference<?> input)
key
- The parameter nameinput
- The parametervoid putOutput(java.lang.String key, Reference<?> output)
key
- The parameter nameoutput
- The parametervoid removeInput(java.lang.String key)
key
- The name of the reference to removevoid removeOutput(java.lang.String key)
key
- The name of the reference to removevoid useInput(java.lang.String name, java.lang.Class<?> type)
name
- A name for the input parametertype
- A typevoid useOutput(java.lang.String name, java.lang.Class<?> type)
name
- A name for the input parametertype
- A typevoid unuseInput(java.lang.String... names)
names
- The names to removevoid unuseOutput(java.lang.String... names)
names
- The names to removejava.lang.String[] getUsedInputNames()
java.lang.String[] getUsedOutputNames()
java.lang.Class<?> getInputType(java.lang.String name)
name
- The input name
java.lang.Class<?> getOutputType(java.lang.String name)
name
- The output name
boolean isLazy()
This attribute determines the behaviour during the evaluation phase. If it is set to false, the process will be evaluated during the phase. If set to true, its evaluation will be delayed until the process is actually enacted, or its evaluation is "forced".
void setLazy(boolean lazy)
lazy
- The new valuevoid validate() throws ProcessException
ProcessException
- If the validation failsvoid invalidate()
An invalidation in a process must be propagated to its parent process.
boolean isValidated()
boolean isEvaluated()
ProcessController enact(ProcessEnvironment env) throws ProcessException
The actual enaction is started through ProcessController.start()
.
env
- The enaction context
ProcessException
- If an error occursvoid evaluate(ProcessEnvironment env) throws ProcessException
Evaluation means the action of translating an abstract workflow into a concrete one.
env
- The enaction context
ProcessException
- If an error occursvoid discover(ProcessEnvironment env) throws ProcessException
env
- The enaction context
ProcessException
- If a discovery failure occursvoid prioritise(ProcessEnvironment env, java.util.PriorityQueue<Process> queue) throws ProcessException
This method populates the specified set with all the abstract processes found in this workflow, sorted by priority. This set is later used for evaluating them in the correct order.
The set will include all abstract processes, except those already evaluated and those with the attribute "lazy" set to true.
env
- The enaction contextqueue
- A set of processes to be evaluated, sorted by their priority
ProcessException
- If the prioritisation failsvoid reset()
This method leaves the process in a "ready" state for enaction.
void addListener(POMListener listener)
Different listeners will be associated to different events. It is up to the implementation class to classify registered listeners appropriately for efficient notification.
listener
- The listener instancevoid removeListener(POMListener listener)
listener
- The listener instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |