org.jbpm.pvm.impl
Class ProcessDefinitionImpl

java.lang.Object
  extended by org.jbpm.pvm.impl.ProcessElementImpl
      extended by org.jbpm.pvm.impl.ObservableElementImpl
          extended by org.jbpm.pvm.impl.CompositeElementImpl
              extended by org.jbpm.pvm.impl.ProcessDefinitionImpl
All Implemented Interfaces:
java.io.Serializable, CompositeElement, ObservableElement, ProcessDefinition, ProcessElement

public class ProcessDefinitionImpl
extends CompositeElementImpl
implements ProcessDefinition

Author:
Tom Baeyens
See Also:
Serialized Form

Field Summary
protected  java.util.Date deploymentTime
           
protected  NodeImpl initial
           
protected  java.lang.String packageName
           
protected  int version
           
 
Fields inherited from class org.jbpm.pvm.impl.CompositeElementImpl
hasVariableDefinitions, nodes, nodesMap, variableDefinitions
 
Fields inherited from class org.jbpm.pvm.impl.ObservableElementImpl
description, events, name
 
Fields inherited from class org.jbpm.pvm.impl.ProcessElementImpl
dbid, dbversion, exceptionHandlers, processDefinition, properties
 
Fields inherited from interface org.jbpm.pvm.ProcessDefinition
EVENT_PROCESS_END, EVENT_PROCESS_START
 
Constructor Summary
ProcessDefinitionImpl()
           
 
Method Summary
 void addAttachment(java.lang.String name, byte[] bytes)
           
 void addAttachment(java.lang.String name, java.io.InputStream inputStream)
           
 byte[] getAttachmentBytes(java.lang.String name)
           
 java.io.InputStream getAttachmentInputStream(java.lang.String name)
           
 java.util.Date getDeploymentTime()
          time this process definition got deployed.
 Node getInitial()
          the initial node that will be executed when a new process starts.
 java.lang.String getPackageName()
          the package name of this process.
 int getVersion()
          automatically assigned during deployment of a process that represents the sequence number for process definitions with the same name.
protected  void initializeVariables(ExecutionImpl processInstance, java.util.Map<java.lang.String,java.lang.Object> variables)
           
protected  ExecutionImpl newProcessInstance()
           
 void setDeploymentTime(java.util.Date deploymentTime)
           
 void setInitial(NodeImpl initial)
           
 void setPackageName(java.lang.String packageName)
           
 void setVersion(int version)
           
 Execution startExecution()
          start a new main path of execution for this process definition
 Execution startExecution(java.util.Map<java.lang.String,java.lang.Object> variables)
          start a new main path of execution for this process definition.
 Execution startExecution(java.lang.String key)
          start a new main path of execution for this process definition.
 Execution startExecution(java.lang.String key, java.util.Map<java.lang.String,java.lang.Object> variables)
          start a new main path of execution for this process definition.
 java.lang.String toString()
           
 
Methods inherited from class org.jbpm.pvm.impl.CompositeElementImpl
addNode, createNode, createNode, findNode, getNode, getNodes, getNodesMap, getVariableDefinitions, hasNode, hasNodes, removeNode, setVariableDefinitions
 
Methods inherited from class org.jbpm.pvm.impl.ObservableElementImpl
addEvent, createEvent, getDescription, getEvent, getEvents, getName, getParent, hasEvent, setDescription, setEvents, setName
 
Methods inherited from class org.jbpm.pvm.impl.ProcessElementImpl
addExceptionHandler, addProperty, createExceptionHandler, getDbid, getExceptionHandlers, getProcessDefinition, getProperties, getProperty, getPropertyKeys, setExceptionHandlers, setProcessDefinition, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jbpm.pvm.ProcessDefinition
getVariableDefinitions
 
Methods inherited from interface org.jbpm.pvm.CompositeElement
findNode, getNode, getNodes, getNodesMap, hasNode, hasNodes
 
Methods inherited from interface org.jbpm.pvm.ObservableElement
getDescription, getEvent, getEvents, getName, getParent, hasEvent
 
Methods inherited from interface org.jbpm.pvm.ProcessElement
getDbid, getExceptionHandlers, getProcessDefinition, getProperty, getPropertyKeys
 

Field Detail

packageName

protected java.lang.String packageName

version

protected int version

deploymentTime

protected java.util.Date deploymentTime

initial

protected NodeImpl initial
Constructor Detail

ProcessDefinitionImpl

public ProcessDefinitionImpl()
Method Detail

startExecution

public Execution startExecution()
Description copied from interface: ProcessDefinition
start a new main path of execution for this process definition

Specified by:
startExecution in interface ProcessDefinition

startExecution

public Execution startExecution(java.util.Map<java.lang.String,java.lang.Object> variables)
Description copied from interface: ProcessDefinition
start a new main path of execution for this process definition.

Specified by:
startExecution in interface ProcessDefinition
Parameters:
variables - is a set of variables that is set as process variables before the process actually starts executing.

startExecution

public Execution startExecution(java.lang.String key)
Description copied from interface: ProcessDefinition
start a new main path of execution for this process definition.

Specified by:
startExecution in interface ProcessDefinition
Parameters:
key - is a user defined identifier for this new execution which has to be unique within the scope of this process definition.

startExecution

public Execution startExecution(java.lang.String key,
                                java.util.Map<java.lang.String,java.lang.Object> variables)
Description copied from interface: ProcessDefinition
start a new main path of execution for this process definition.

Specified by:
startExecution in interface ProcessDefinition
Parameters:
key - is a user defined identifier for this new execution which has to be unique within the scope of this process definition.
variables - is a set of variables that is set as process variables before the process actually starts executing.

newProcessInstance

protected ExecutionImpl newProcessInstance()

initializeVariables

protected void initializeVariables(ExecutionImpl processInstance,
                                   java.util.Map<java.lang.String,java.lang.Object> variables)

addAttachment

public void addAttachment(java.lang.String name,
                          java.io.InputStream inputStream)

addAttachment

public void addAttachment(java.lang.String name,
                          byte[] bytes)

getAttachmentBytes

public byte[] getAttachmentBytes(java.lang.String name)

getAttachmentInputStream

public java.io.InputStream getAttachmentInputStream(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getInitial

public Node getInitial()
Description copied from interface: ProcessDefinition
the initial node that will be executed when a new process starts.

Specified by:
getInitial in interface ProcessDefinition

setInitial

public void setInitial(NodeImpl initial)

getVersion

public int getVersion()
Description copied from interface: ProcessDefinition
automatically assigned during deployment of a process that represents the sequence number for process definitions with the same name.

Specified by:
getVersion in interface ProcessDefinition

setVersion

public void setVersion(int version)

getDeploymentTime

public java.util.Date getDeploymentTime()
Description copied from interface: ProcessDefinition
time this process definition got deployed.

Specified by:
getDeploymentTime in interface ProcessDefinition

setDeploymentTime

public void setDeploymentTime(java.util.Date deploymentTime)

getPackageName

public java.lang.String getPackageName()
Description copied from interface: ProcessDefinition
the package name of this process. This is a similar way of grouping and creating a structure as in Java. We recommend the same conventions as with Java package names.

Specified by:
getPackageName in interface ProcessDefinition

setPackageName

public void setPackageName(java.lang.String packageName)