org.jbpm.db
Class GraphSession

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

public class GraphSession
extends Object

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
 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)
          assigns a version number to the given process definition and then makes it persistent.
 List findActiveNodesByProcessInstance(ProcessInstance processInstance)
           
 List findAllProcessDefinitions()
          queries the database for all process definitions, ordered by name (ascending), then by version (descending).
 List findAllProcessDefinitionVersions(String name)
          queries the database for all versions of process definitions with the given name, ordered by version (descending).
 ProcessDefinition findLatestProcessDefinition(String name)
          queries the database for the latest version of a process definition with the given name.
 List findLatestProcessDefinitions()
          queries the database for the latest version of each process definition.
 ProcessDefinition findProcessDefinition(String name, int version)
          finds the process definition with the given name and version.
 List findProcessDefinitions(Collection processDefinitionIds)
           
 List findProcessInstances(long processDefinitionId)
          finds all instances of the given process definition.
 ProcessDefinition getProcessDefinition(long processDefinitionId)
          returns the persistent process definition with the given identifier.
 ProcessInstance getProcessInstance(long processInstanceId)
          returns the persistent process instance with the given identifier.
 ProcessInstance getProcessInstance(ProcessDefinition processDefinition, String key)
          returns the instance of the given process definition with the specified business key.
 Token getToken(long tokenId)
          returns the persistent token with the given identifier.
 ProcessDefinition loadProcessDefinition(long processDefinitionId)
          returns the persistent process definition with the given identifier, assuming the definition exists.
 ProcessInstance loadProcessInstance(long processInstanceId)
          returns the persistent process instance with the given identifier, assuming the instance exists.
 ProcessInstance loadProcessInstance(ProcessDefinition processDefinition, String key)
          returns the instance of the given process definition with the specified business key, assuming the instance exists.
 Token loadToken(long tokenId)
          returns the persistent token with the given identifier, assuming the token exists.
 void lockProcessInstance(long processInstanceId)
          obtains a pessimistic lock on the process instance with the given identifier.
 void lockProcessInstance(ProcessInstance processInstance)
          obtains a pessimistic lock on the given process instance.
 void saveProcessDefinition(ProcessDefinition processDefinition)
          saves the process definition.
 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)
assigns a version number to the given process definition and then makes it persistent.


saveProcessDefinition

public void saveProcessDefinition(ProcessDefinition processDefinition)
saves the process definition. this method does not assign a version number.

See Also:
deployProcessDefinition(ProcessDefinition)

loadProcessDefinition

public ProcessDefinition loadProcessDefinition(long processDefinitionId)
returns the persistent process definition with the given identifier, assuming the definition exists. if the requested process definition does not exist in the database, ObjectNotFoundException is thrown when the definition state is first accessed.


getProcessDefinition

public ProcessDefinition getProcessDefinition(long processDefinitionId)
returns the persistent process definition with the given identifier.

Returns:
the referenced process definition, or null if there is no such definition.

findProcessDefinition

public ProcessDefinition findProcessDefinition(String name,
                                               int version)
finds the process definition with the given name and version.


findLatestProcessDefinition

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


findLatestProcessDefinitions

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


findProcessDefinitions

public List findProcessDefinitions(Collection processDefinitionIds)

findAllProcessDefinitions

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


findAllProcessDefinitionVersions

public List findAllProcessDefinitionVersions(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.


loadProcessInstance

public ProcessInstance loadProcessInstance(long processInstanceId)
returns the persistent process instance with the given identifier, assuming the instance exists. if the requested process instance does not exist in the database, ObjectNotFoundException is thrown when the instance state is first accessed.


getProcessInstance

public ProcessInstance getProcessInstance(long processInstanceId)
returns the persistent process instance with the given identifier.

Returns:
the referenced process instance, or null if there is no such instance

loadToken

public Token loadToken(long tokenId)
returns the persistent token with the given identifier, assuming the token exists. if the requested token does not exist in the database, ObjectNotFoundException is thrown when the token state is first accessed.


getToken

public Token getToken(long tokenId)
returns the persistent token with the given identifier.

Returns:
the referenced token, or null if there is no such token.

lockProcessInstance

public void lockProcessInstance(long processInstanceId)
obtains a pessimistic lock on the process instance with the given identifier.


lockProcessInstance

public void lockProcessInstance(ProcessInstance processInstance)
obtains a pessimistic lock on the given process instance.


findProcessInstances

public List findProcessInstances(long processDefinitionId)
finds all instances of the given process definition.

Returns:
a list of process instances ordered by start date, earliest 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 List calculateAverageTimeByNode(long processDefinitionId,
                                       long minumumDurationMillis)

findActiveNodesByProcessInstance

public List findActiveNodesByProcessInstance(ProcessInstance processInstance)

getProcessInstance

public ProcessInstance getProcessInstance(ProcessDefinition processDefinition,
                                          String key)
returns the instance of the given process definition with the specified business key.

Returns:
the referenced instance, or null if there is no such instance

loadProcessInstance

public ProcessInstance loadProcessInstance(ProcessDefinition processDefinition,
                                           String key)
returns the instance of the given process definition with the specified business key, assuming the instance exists.

Throws:
JbpmPersistenceException - if the referenced process instance does not exist


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