org.ow2.bonita.pvm.internal.model
Class PVMProcessDefinitionImpl

java.lang.Object
  extended by org.ow2.bonita.pvm.internal.model.ProcessElementImpl
      extended by org.ow2.bonita.pvm.internal.model.ObservableElementImpl
          extended by org.ow2.bonita.pvm.internal.model.CompositeElementImpl
              extended by org.ow2.bonita.pvm.internal.model.PVMProcessDefinitionImpl
All Implemented Interfaces:
java.io.Serializable, ClientProcessDefinition, CompositeElement, ObservableElement, OpenProcessDefinition, ProcessDefinition

public class PVMProcessDefinitionImpl
extends CompositeElementImpl
implements OpenProcessDefinition, ClientProcessDefinition

Author:
Tom Baeyens
See Also:
Serialized Form

Field Summary
protected  java.util.Date deploymentTime
          time this process was deployed
protected  java.lang.String id
          the unique id (e.g.
protected  NodeImpl initial
          the node which is executed when the process starts
protected  java.lang.String key
          user provided short reference for the process definition that has the same scope as the name.
protected  java.lang.String packageName
          optional package name similar to the Java package name.
static int UNASSIGNED_VERSION
           
protected  int version
          the version number of the process definitions with the same name.
 
Fields inherited from class org.ow2.bonita.pvm.internal.model.CompositeElementImpl
hasTimerDefinitions, hasVariableDefinitions, nodes, nodesMap, timerDefinitions, variableDefinitions
 
Fields inherited from class org.ow2.bonita.pvm.internal.model.ObservableElementImpl
description, events, name
 
Fields inherited from class org.ow2.bonita.pvm.internal.model.ProcessElementImpl
dbid, dbversion, exceptionHandlers, processDefinition, properties
 
Constructor Summary
PVMProcessDefinitionImpl()
           
 
Method Summary
 void addAttachment(java.lang.String name, byte[] bytes)
           
 void addAttachment(java.lang.String name, java.io.InputStream inputStream)
           
 ClientProcessInstance beginProcessInstance()
           
 ClientProcessInstance beginProcessInstance(java.lang.String key)
           
 ClientProcessInstance createProcessInstance()
           
 ClientProcessInstance createProcessInstance(java.lang.String key)
           
 ClientProcessInstance createProcessInstance(java.lang.String key, Execution superProcessExecution)
           
 byte[] getAttachmentBytes(java.lang.String name)
           
 java.io.InputStream getAttachmentInputStream(java.lang.String name)
           
 java.util.Date getDeploymentTime()
           
 java.lang.String getId()
          the unique id for this process definition.
 NodeImpl getInitial()
          the initial node of this process definition
 java.lang.String getKey()
          the user defined short representation of the name.
 java.lang.String getPackageName()
          the optional 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  ExecutionImpl newProcessInstance()
           
 void setDeploymentTime(java.util.Date deploymentTime)
           
 void setId(java.lang.String id)
           
 void setInitial(NodeImpl initial)
           
 void setKey(java.lang.String key)
           
 void setPackageName(java.lang.String packageName)
           
 void setVersion(int version)
           
 java.lang.String toString()
           
 
Methods inherited from class org.ow2.bonita.pvm.internal.model.CompositeElementImpl
addNode, createNode, createNode, createTimerDefinition, createVariableDefinition, findNode, getNode, getNodes, getNodesMap, getTimerDefinitions, getVariableDefinitions, hasNode, hasNodes, removeNode
 
Methods inherited from class org.ow2.bonita.pvm.internal.model.ObservableElementImpl
addEvent, createEvent, getDescription, getEvent, getEvents, getName, getParent, hasEvent, setDescription, setEvents, setName
 
Methods inherited from class org.ow2.bonita.pvm.internal.model.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
 

Field Detail

UNASSIGNED_VERSION

public static final int UNASSIGNED_VERSION
See Also:
Constant Field Values

key

protected java.lang.String key
user provided short reference for the process definition that has the same scope as the name. Multiple versions of the same process can have the same key. The key is used to build the globally unique execution ids.


id

protected java.lang.String id
the unique id (e.g. combination of name and versionnumber) for this process definition.


version

protected int version
the version number of the process definitions with the same name.


packageName

protected java.lang.String packageName
optional package name similar to the Java package name.


deploymentTime

protected java.util.Date deploymentTime
time this process was deployed


initial

protected NodeImpl initial
the node which is executed when the process starts

Constructor Detail

PVMProcessDefinitionImpl

public PVMProcessDefinitionImpl()
Method Detail

createProcessInstance

public ClientProcessInstance createProcessInstance()
Specified by:
createProcessInstance in interface ClientProcessDefinition

createProcessInstance

public ClientProcessInstance createProcessInstance(java.lang.String key)
Specified by:
createProcessInstance in interface ClientProcessDefinition

createProcessInstance

public ClientProcessInstance createProcessInstance(java.lang.String key,
                                                   Execution superProcessExecution)

beginProcessInstance

public ClientProcessInstance beginProcessInstance()
Specified by:
beginProcessInstance in interface ClientProcessDefinition

beginProcessInstance

public ClientProcessInstance beginProcessInstance(java.lang.String key)
Specified by:
beginProcessInstance in interface ClientProcessDefinition

newProcessInstance

protected ExecutionImpl newProcessInstance()

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 NodeImpl getInitial()
Description copied from interface: OpenProcessDefinition
the initial node of this process definition

Specified by:
getInitial in interface OpenProcessDefinition

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()

setDeploymentTime

public void setDeploymentTime(java.util.Date deploymentTime)

getPackageName

public java.lang.String getPackageName()
Description copied from interface: ProcessDefinition
the optional package name of this process. This can be used to create hierarchy of process categories for easy lookup. 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)

getKey

public java.lang.String getKey()
Description copied from interface: ProcessDefinition
the user defined short representation of the name. Just like the name, multiple versions of a process definition can have the same key.

Specified by:
getKey in interface ProcessDefinition

setKey

public void setKey(java.lang.String key)

getId

public java.lang.String getId()
Description copied from interface: ProcessDefinition
the unique id for this process definition.

Specified by:
getId in interface ProcessDefinition

setId

public void setId(java.lang.String id)


Copyright © 2009 OW2 Consortium. All Rights Reserved.