org.ow2.bonita.pvm.model
Interface OpenExecution

All Superinterfaces:
Discussable, Execution, java.io.Serializable
All Known Subinterfaces:
ActivityExecution, ClientExecution, ClientProcessInstance, EventListenerExecution
All Known Implementing Classes:
ExecutionImpl

public interface OpenExecution
extends Execution, Discussable

execution that opens up access to the related objects in the execution and process definition model. This execution exposes the execution hierarchy, variable access and associated timers. This is an execution that can be used backed by an open persistence session. Typically inside of an environment block. Navigation over the related model objects will load the related objects transparantly with lazy loading.

Author:
Tom Baeyens

Field Summary
 
Fields inherited from interface org.ow2.bonita.pvm.Execution
STATE_ACTIVE, STATE_ASYNC, STATE_CANCELLED, STATE_CREATED, STATE_ENDED, STATE_INACTIVE, STATE_SUSPENDED
 
Method Summary
 void createVariable(java.lang.String key, java.lang.Object value)
          create a new variable in this execution scope and determine the type automagically.
 void createVariable(java.lang.String key, java.lang.Object value, java.lang.String typeName)
          create a new variable in this execution scope with the given type name.
 OpenExecution getExecution(java.lang.String name)
          the child execution for the given name or null in case such execution doesn't exist.
 java.util.Collection<OpenExecution> getExecutions()
          the child executions in the execution structure.
 java.util.Map<java.lang.String,OpenExecution> getExecutionsMap()
          maps child execution names to execution objects.
 java.util.Set<Job> getJobs()
          timers for this execution scope
 Node getNode()
          the current node
 OpenExecution getParent()
          the parent execution in the execution structure.
 OpenProcessDefinition getProcessDefinition()
          the process definition for this execution.
 OpenExecution getProcessInstance()
          the main path of execution in the execution structure.
 OpenExecution getSubProcessInstance()
          the related sub process execution.
 java.lang.Object getVariable(java.lang.String key)
          retrieve the value for the given key.
 java.util.Set<java.lang.String> getVariableKeys()
          a non-null set that contains all the keys present in this scope.
 java.util.Map<java.lang.String,java.lang.Object> getVariables()
          a non-null map containing all the key-value pairs in this scope.
 boolean hasExecution(java.lang.String executionName)
          indicates if this execution has a child execution with the given executionName
 boolean hasVariable(java.lang.String key)
          indicates presenve of the given key.
 boolean hasVariables()
          indicates if there are keys in this scope.
 boolean removeVariable(java.lang.String key)
          remove the key-value pair for the given key from this scope.
 void removeVariables()
          removes all variables in this scope
 void setPriority(int priority)
          setter for the priority.
 void setVariable(java.lang.String key, java.lang.Object value)
          updates or creates a variable for the given value.
 void setVariables(java.util.Map<java.lang.String,java.lang.Object> variables)
          sets all given variables.
 
Methods inherited from interface org.ow2.bonita.pvm.Execution
getDbid, getId, getKey, getName, getNodeName, getPriority, getState, isActive, isEnded, isFinished, isLocked, isSuspended
 
Methods inherited from interface org.ow2.bonita.pvm.model.Discussable
createComment, getComments, removeComment
 

Method Detail

getProcessDefinition

OpenProcessDefinition getProcessDefinition()
the process definition for this execution.


getNode

Node getNode()
the current node


getSubProcessInstance

OpenExecution getSubProcessInstance()
the related sub process execution.


getVariable

java.lang.Object getVariable(java.lang.String key)
retrieve the value for the given key. The value can be null. If there is no value for the given key, the returned value will also be null. The value for key null will always be null as null keys are not allowed.


setVariable

void setVariable(java.lang.String key,
                 java.lang.Object value)
updates or creates a variable for the given value. Values are allowed to be null.

Throws:
PvmException - if key is null.

setVariables

void setVariables(java.util.Map<java.lang.String,java.lang.Object> variables)
sets all given variables. Existing key-value pairs for which there is no key in the provided variables will not be removed.

Throws:
PvmException - is variables is not null and if null is present as a key in the provided variables map.

hasVariable

boolean hasVariable(java.lang.String key)
indicates presenve of the given key. No exception will be thrown if key is null.

Returns:
true if the key is present and false if the key doesn't exist or if key is null.

removeVariable

boolean removeVariable(java.lang.String key)
remove the key-value pair for the given key from this scope. No exception will be thrown when the variable is not present.


removeVariables

void removeVariables()
removes all variables in this scope


hasVariables

boolean hasVariables()
indicates if there are keys in this scope.


getVariableKeys

java.util.Set<java.lang.String> getVariableKeys()
a non-null set that contains all the keys present in this scope. Even if there are no variable keys, an empty, non-null set will be returned.


getVariables

java.util.Map<java.lang.String,java.lang.Object> getVariables()
a non-null map containing all the key-value pairs in this scope. Even if there are no variable keys, an empty, non-null map will be returned.


createVariable

void createVariable(java.lang.String key,
                    java.lang.Object value)
create a new variable in this execution scope and determine the type automagically.


createVariable

void createVariable(java.lang.String key,
                    java.lang.Object value,
                    java.lang.String typeName)
create a new variable in this execution scope with the given type name.


getProcessInstance

OpenExecution getProcessInstance()
the main path of execution in the execution structure. Null will be returned in case this execution itself is the main execution path.


getParent

OpenExecution getParent()
the parent execution in the execution structure. Null will be returned in case this execution itself is the main execution path.


getExecutions

java.util.Collection<OpenExecution> getExecutions()
the child executions in the execution structure. Can be null and can be an empty collection.


getExecutionsMap

java.util.Map<java.lang.String,OpenExecution> getExecutionsMap()
maps child execution names to execution objects. In case multiple executions have the same name, the first one is taken. Can be null or can be an empty map. The first execution without a name is also included with null as the key.


getExecution

OpenExecution getExecution(java.lang.String name)
the child execution for the given name or null in case such execution doesn't exist.


hasExecution

boolean hasExecution(java.lang.String executionName)
indicates if this execution has a child execution with the given executionName


getJobs

java.util.Set<Job> getJobs()
timers for this execution scope


setPriority

void setPriority(int priority)
setter for the priority. The default priority is 0, which means NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1), LOW (-1) and LOWEST (-2). For the rest, the user can set any other priority integer value, but then, the UI will have to display it as an integer and not the named value.



Copyright © 2009 OW2 Consortium. All Rights Reserved.