org.jbpm.db
Class GraphSession

java.lang.Object
  extended by org.jbpm.db.GraphSession

public class GraphSession
extends java.lang.Object

are the graph related database operations.


Nested Class Summary
static class GraphSession.AverageNodeTimeEntry
           
 
Constructor Summary
GraphSession(JbpmSession jbpmSession)
          Deprecated. use GraphSession(Session) instead
GraphSession(org.hibernate.Session session)
           
 
Method Summary
 java.util.List calculateAverageTimeByNode(long processDefinitionId, long minumumDurationMillis)
           
 void deleteProcessDefinition(long processDefinitionId)
           
 void deleteProcessDefinition(ProcessDefinition processDefinition)
           
 void deleteProcessInstance(long processInstanceId)
           
 void deleteProcessInstance(ProcessInstance processInstance)
           
 void deleteProcessInstance(ProcessInstance processInstance, boolean includeTasks, boolean includeJobs)
           
 void deployProcessDefinition(ProcessDefinition processDefinition)
           
 java.util.List findActiveNodesByProcessInstance(ProcessInstance processInstance)
           
 java.util.List findAllProcessDefinitions()
          queries the database for all process definitions, ordered by name (ascending), then by version (descending).
 java.util.List findAllProcessDefinitionVersions(java.lang.String name)
          queries the database for all versions of process definitions with the given name, ordered by version (descending).
 ProcessDefinition findLatestProcessDefinition(java.lang.String name)
          queries the database for the latest version of a process definition with the given name.
 java.util.List findLatestProcessDefinitions()
          queries the database for the latest version of each process definition.
 ProcessDefinition findProcessDefinition(java.lang.String name, int version)
          queries the database for a process definition with the given name and version.
 java.util.List findProcessDefinitions(java.util.Collection processDefinitionIds)
           
 java.util.List findProcessInstances(long processDefinitionId)
          fetches all processInstances for the given process definition from the database.
 ProcessDefinition getProcessDefinition(long processDefinitionId)
          gets a process definition from the database by the identifier.
 ProcessInstance getProcessInstance(long processInstanceId)
          gets a process instance from the database by the identifier.
 ProcessInstance getProcessInstance(ProcessDefinition processDefinition, java.lang.String key)
           
 Token getToken(long tokenId)
          gets a token from the database by the identifier.
 ProcessDefinition loadProcessDefinition(long processDefinitionId)
          loads a process definition from the database by the identifier.
 ProcessInstance loadProcessInstance(long processInstanceId)
          loads a process instance from the database by the identifier.
 ProcessInstance loadProcessInstance(ProcessDefinition processDefinition, java.lang.String key)
           
 Token loadToken(long tokenId)
          loads a token from the database by the identifier.
 void lockProcessInstance(long processInstanceId)
          locks a process instance in the database.
 void lockProcessInstance(ProcessInstance processInstance)
          locks a process instance in the database.
 void saveProcessDefinition(ProcessDefinition processDefinition)
          saves the process definitions. this method does not assign a version number. that is the responsibility of the deployProcessDefinition method.
 void saveProcessInstance(ProcessInstance processInstance)
          Deprecated. use JbpmContext.save(ProcessInstance) instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphSession

public GraphSession(JbpmSession jbpmSession)
Deprecated. use GraphSession(Session) instead


GraphSession

public GraphSession(org.hibernate.Session session)
Method Detail

deployProcessDefinition

public void deployProcessDefinition(ProcessDefinition processDefinition)

saveProcessDefinition

public void saveProcessDefinition(ProcessDefinition processDefinition)
saves the process definitions. this method does not assign a version number. that is the responsibility of the deployProcessDefinition method.


loadProcessDefinition

public ProcessDefinition loadProcessDefinition(long processDefinitionId)
loads a process definition from the database by the identifier.

Throws:
JbpmPersistenceException - in case the referenced process definition doesn't exist.

getProcessDefinition

public ProcessDefinition getProcessDefinition(long processDefinitionId)
gets a process definition from the database by the identifier.

Returns:
the referenced process definition or null in case it doesn't exist.

findProcessDefinition

public ProcessDefinition findProcessDefinition(java.lang.String name,
                                               int version)
queries the database for a process definition with the given name and version.


findLatestProcessDefinition

public ProcessDefinition findLatestProcessDefinition(java.lang.String name)
queries the database for the latest version of a process definition with the given name.


findLatestProcessDefinitions

public java.util.List findLatestProcessDefinitions()
queries the database for the latest version of each process definition. Process definitions are distinct by name.


findProcessDefinitions

public java.util.List findProcessDefinitions(java.util.Collection processDefinitionIds)

findAllProcessDefinitions

public java.util.List findAllProcessDefinitions()
queries the database for all process definitions, ordered by name (ascending), then by version (descending).


findAllProcessDefinitionVersions

public java.util.List findAllProcessDefinitionVersions(java.lang.String name)
queries the database for all versions of process definitions with the given name, ordered by version (descending).


deleteProcessDefinition

public void deleteProcessDefinition(long processDefinitionId)

deleteProcessDefinition

public void deleteProcessDefinition(ProcessDefinition processDefinition)

saveProcessInstance

public void saveProcessInstance(ProcessInstance processInstance)
Deprecated. use JbpmContext.save(ProcessInstance) instead.

Throws:
java.lang.UnsupportedOperationException - to prevent invocation

loadProcessInstance

public ProcessInstance loadProcessInstance(long processInstanceId)
loads a process instance from the database by the identifier. This throws an exception in case the process instance does not exist.

Throws:
JbpmPersistenceException - in case the process instance doesn't exist.
See Also:
getProcessInstance(long)

getProcessInstance

public ProcessInstance getProcessInstance(long processInstanceId)
gets a process instance from the database by the identifier. This method returns null in case the given process instance does not exist.


loadToken

public Token loadToken(long tokenId)
loads a token from the database by the identifier.

Returns:
the token.
Throws:
JbpmPersistenceException - in case the referenced token doesn't exist.

getToken

public Token getToken(long tokenId)
gets a token from the database by the identifier.

Returns:
the token or null in case the token doesn't exist.

lockProcessInstance

public void lockProcessInstance(long processInstanceId)
locks a process instance in the database.


lockProcessInstance

public void lockProcessInstance(ProcessInstance processInstance)
locks a process instance in the database.


findProcessInstances

public java.util.List findProcessInstances(long processDefinitionId)
fetches all processInstances for the given process definition from the database. The returned list of process instances is sorted start date, youngest first.


deleteProcessInstance

public void deleteProcessInstance(long processInstanceId)

deleteProcessInstance

public void deleteProcessInstance(ProcessInstance processInstance)

deleteProcessInstance

public void deleteProcessInstance(ProcessInstance processInstance,
                                  boolean includeTasks,
                                  boolean includeJobs)

calculateAverageTimeByNode

public java.util.List calculateAverageTimeByNode(long processDefinitionId,
                                                 long minumumDurationMillis)

findActiveNodesByProcessInstance

public java.util.List findActiveNodesByProcessInstance(ProcessInstance processInstance)

getProcessInstance

public ProcessInstance getProcessInstance(ProcessDefinition processDefinition,
                                          java.lang.String key)

loadProcessInstance

public ProcessInstance loadProcessInstance(ProcessDefinition processDefinition,
                                           java.lang.String key)


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.