org.eclipse.stardust.engine.api.query
Class ProcessInstanceQuery

java.lang.Object
  extended by org.eclipse.stardust.engine.api.query.Query
      extended by org.eclipse.stardust.engine.api.query.ProcessInstanceQuery
All Implemented Interfaces:
Serializable

public class ProcessInstanceQuery
extends Query

Query container for building complex queries for process instances.

Valid filter criteria are:

Version:
$Revision$
Author:
rsauer
See Also:
Serialized Form

Nested Class Summary
static class ProcessInstanceQuery.Attribute
          Process instance attribute supporting filter operations.
 
Field Summary
static ProcessInstanceQuery.Attribute BENCHMARK_OID
           
static ProcessInstanceQuery.Attribute BENCHMARK_VALUE
           
static ProcessInstanceQuery.Attribute CURRENT_DOMAIN_OID
          Deprecated. This attribute existed in AuditTrail.
static ProcessInstanceQuery.Attribute OID
           
static ProcessInstanceQuery.Attribute PRIORITY
           
static org.eclipse.stardust.engine.api.query.CustomOrderCriterion PROC_DEF_ID
          Orders the resulting process instances by their process definition id.
static org.eclipse.stardust.engine.api.query.CustomOrderCriterion PROC_DEF_NAME
          Orders the resulting process instances by their process definition name.
static ProcessInstanceQuery.Attribute PROCESS_DEFINITION_OID
           
static org.eclipse.stardust.engine.api.query.RootProcessDefinitionDescriptor ROOT_PROC_DEF_ID
          Orders the resulting process instances by their root process definition id.
static org.eclipse.stardust.engine.api.query.RootProcessDefinitionDescriptor ROOT_PROC_DEF_NAME
          Orders the resulting process instances by their root process definition name.
static ProcessInstanceQuery.Attribute ROOT_PROCESS_INSTANCE_OID
           
static ProcessInstanceQuery.Attribute START_TIME
           
static ProcessInstanceQuery.Attribute STARTING_ACTIVITY_INSTANCE_OID
           
static ProcessInstanceQuery.Attribute STARTING_DOMAIN_OID
          Deprecated. This attribute existed in AuditTrail.
static ProcessInstanceQuery.Attribute STARTING_USER_OID
           
static ProcessInstanceQuery.Attribute STATE
           
static ProcessInstanceQuery.Attribute TERMINATION_TIME
           
static org.eclipse.stardust.engine.api.query.CustomOrderCriterion USER_ACCOUNT
          Orders the resulting process instances by their starting user account.
static org.eclipse.stardust.engine.api.query.CustomOrderCriterion USER_FIRST_NAME
          Orders the resulting process instances by their starting user first name.
static org.eclipse.stardust.engine.api.query.CustomOrderCriterion USER_LAST_NAME
          Orders the resulting process instances by their starting user last name.
 
Constructor Summary
ProcessInstanceQuery()
           
 
Method Summary
static ProcessInstanceQuery findActive()
          Creates a query for finding active process instances.
static ProcessInstanceQuery findAlive()
          Creates a query for finding alive process instances.
static ProcessInstanceQuery findAlive(String processID)
          Creates a query for finding alive instances of the process definition identified by processID.
static ProcessInstanceQuery findAliveHavingData(String processID, String dataID, Serializable dataValue)
          Creates a query for finding alive instances of the process definition identified by processID containing workflow data dataID having a value of dataValue.
static ProcessInstanceQuery findAll()
          Creates a query for finding all process instances currently existing.
static ProcessInstanceQuery findCaseByName(String caseName)
          Creates a query for finding case instances with the specified name.
static ProcessInstanceQuery findCaseMembers(long caseOid)
          Creates a query for finding instances belonging to the case instance with the specified oid.
static ProcessInstanceQuery findCases()
          Creates a query for finding case instances.
static ProcessInstanceQuery findCompleted()
          Creates a query for finding completed process instances.
static ProcessInstanceQuery findCompleted(String processID)
          Creates a query for finding completed instances of the process definition identified by processID.
static ProcessInstanceQuery findForProcess(String processID)
          Creates a query for finding instances of the process definition identified by processID.
static ProcessInstanceQuery findForProcess(String processID, boolean includingSubprocesses)
          Creates a query for finding instances of the process definition identified by processID.
static ProcessInstanceQuery findHavingDocument(Document document)
          Creates a query for finding process instances which have the given Document as a process attachment, document data or document list data.
static ProcessInstanceQuery findHavingDocument(Document document, String modelId)
          Creates a query for finding process instances which have the given Document as a process attachment, document data or document list data.
static ProcessInstanceQuery findHavingDocument(String documentId)
          Creates a query for finding process instances which have the given Document as a process attachment, document data or document list data.
static ProcessInstanceQuery findInState(ProcessInstanceState state)
          Creates a query for finding process instances currently being in the specified state.
static ProcessInstanceQuery findInState(ProcessInstanceState[] states)
          Creates a query for finding process instances currently being in one of the specified states.
static ProcessInstanceQuery findInState(String processID, ProcessInstanceState state)
          Creates a query for finding instances of the process definition identified by processID currently being in the specified state.
static ProcessInstanceQuery findInState(String processID, ProcessInstanceState[] states)
          Creates a query for finding instances of the process definition identified by processID currently being in one of the specified states.
static ProcessInstanceQuery findInStateHavingData(String processID, String dataID, Serializable dataValue, ProcessInstanceState state)
          Creates a query for finding instances of the process definition identified by processID containing workflow data dataID having a value of dataValue and currently being in the specified state.
static ProcessInstanceQuery findInStateHavingData(String processID, String dataID, Serializable dataValue, ProcessInstanceState[] states)
          Creates a query for finding instances of the process definition identified by processID containing workflow data dataID having a value of dataValue and currently being in one of the specified states.
static ProcessInstanceQuery findInterrupted()
          Creates a query for finding pending process instances.
static ProcessInstanceQuery findLinked(long processInstanceOid, LinkDirection direction, org.eclipse.stardust.engine.api.runtime.PredefinedProcessInstanceLinkTypes... linkType)
          Creates a query for finding process instances the given process instance is linked to via the given link type(s) and direction.
static ProcessInstanceQuery findLinked(long processInstanceOid, LinkDirection direction, String... linkType)
          Creates a query for finding process instances the given process instance is linked to via the given link type(s) and direction.
static ProcessInstanceQuery findStartedByUser(long userOID)
          Creates a query for finding process instances started by the user identified by the given OID.
 String toString()
           
 
Methods inherited from class org.eclipse.stardust.engine.api.query.Query
getFilter, getOrderCriteria, getPolicy, orderBy, orderBy, orderBy, removePolicy, setPolicy, where
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OID

public static final ProcessInstanceQuery.Attribute OID

START_TIME

public static final ProcessInstanceQuery.Attribute START_TIME

TERMINATION_TIME

public static final ProcessInstanceQuery.Attribute TERMINATION_TIME

STATE

public static final ProcessInstanceQuery.Attribute STATE

PROCESS_DEFINITION_OID

public static final ProcessInstanceQuery.Attribute PROCESS_DEFINITION_OID

ROOT_PROCESS_INSTANCE_OID

public static final ProcessInstanceQuery.Attribute ROOT_PROCESS_INSTANCE_OID

STARTING_USER_OID

public static final ProcessInstanceQuery.Attribute STARTING_USER_OID

STARTING_ACTIVITY_INSTANCE_OID

public static final ProcessInstanceQuery.Attribute STARTING_ACTIVITY_INSTANCE_OID

PRIORITY

public static final ProcessInstanceQuery.Attribute PRIORITY

BENCHMARK_OID

public static final ProcessInstanceQuery.Attribute BENCHMARK_OID

BENCHMARK_VALUE

public static final ProcessInstanceQuery.Attribute BENCHMARK_VALUE

STARTING_DOMAIN_OID

public static final ProcessInstanceQuery.Attribute STARTING_DOMAIN_OID
Deprecated. This attribute existed in AuditTrail.

CURRENT_DOMAIN_OID

public static final ProcessInstanceQuery.Attribute CURRENT_DOMAIN_OID
Deprecated. This attribute existed in AuditTrail.

PROC_DEF_ID

public static final org.eclipse.stardust.engine.api.query.CustomOrderCriterion PROC_DEF_ID
Orders the resulting process instances by their process definition id.

For internal use only!


PROC_DEF_NAME

public static final org.eclipse.stardust.engine.api.query.CustomOrderCriterion PROC_DEF_NAME
Orders the resulting process instances by their process definition name.

For internal use only!


USER_ACCOUNT

public static final org.eclipse.stardust.engine.api.query.CustomOrderCriterion USER_ACCOUNT
Orders the resulting process instances by their starting user account.

For internal use only!


USER_FIRST_NAME

public static final org.eclipse.stardust.engine.api.query.CustomOrderCriterion USER_FIRST_NAME
Orders the resulting process instances by their starting user first name.

For internal use only!


USER_LAST_NAME

public static final org.eclipse.stardust.engine.api.query.CustomOrderCriterion USER_LAST_NAME
Orders the resulting process instances by their starting user last name.

For internal use only!


ROOT_PROC_DEF_ID

public static final org.eclipse.stardust.engine.api.query.RootProcessDefinitionDescriptor ROOT_PROC_DEF_ID
Orders the resulting process instances by their root process definition id.

For internal use only!


ROOT_PROC_DEF_NAME

public static final org.eclipse.stardust.engine.api.query.RootProcessDefinitionDescriptor ROOT_PROC_DEF_NAME
Orders the resulting process instances by their root process definition name.

For internal use only!

Constructor Detail

ProcessInstanceQuery

public ProcessInstanceQuery()
Method Detail

findAll

public static ProcessInstanceQuery findAll()
Creates a query for finding all process instances currently existing.

Returns:
The readily configured query.

findForProcess

public static ProcessInstanceQuery findForProcess(String processID)
Creates a query for finding instances of the process definition identified by processID. Also retrieves instances of subprocesses.

Parameters:
processID - The ID of the process definition the activity should belong to.
Returns:
The readily configured query.
See Also:
findForProcess(String, boolean), ProcessDefinitionFilter.ProcessDefinitionFilter(String), findInState(String, ProcessInstanceState), findAlive(String)

findForProcess

public static ProcessInstanceQuery findForProcess(String processID,
                                                  boolean includingSubprocesses)
Creates a query for finding instances of the process definition identified by processID. Optionally retrieves subprocesses.

Parameters:
processID - The ID of the process definition the activity should belong to.
includingSubprocesses - Flag indicating if subprocesses should be retrieved, too.
Returns:
The readily configured query.
See Also:
findForProcess(String), ProcessDefinitionFilter.ProcessDefinitionFilter(String, boolean)

findCases

public static ProcessInstanceQuery findCases()
Creates a query for finding case instances.

Returns:
The configured query.

findCaseByName

public static ProcessInstanceQuery findCaseByName(String caseName)
Creates a query for finding case instances with the specified name.

Parameters:
caseName - The name of the case instance to search for.
Returns:
The configured query.

findCaseMembers

public static ProcessInstanceQuery findCaseMembers(long caseOid)
Creates a query for finding instances belonging to the case instance with the specified oid.

Parameters:
caseOid - The oid of the case instance to search members for.
Returns:
The configured query.

findInState

public static ProcessInstanceQuery findInState(ProcessInstanceState state)
Creates a query for finding process instances currently being in the specified state.

Parameters:
state - The state the process instance should be in.
Returns:
The readily configured query.
See Also:
findInState(String, ProcessInstanceState), findAlive(), ProcessStateFilter

findInState

public static ProcessInstanceQuery findInState(ProcessInstanceState[] states)
Creates a query for finding process instances currently being in one of the specified states.

Parameters:
states - The list of states the process instance should be in one of.
Returns:
The readily configured query.
See Also:
findInState(String, ProcessInstanceState[]), findAlive(), ProcessStateFilter

findInState

public static ProcessInstanceQuery findInState(String processID,
                                               ProcessInstanceState state)
Creates a query for finding instances of the process definition identified by processID currently being in the specified state. Also retrieves instances of subprocesses.

Parameters:
processID - The ID of the process definition the activity should belong to.
state - The state the process instance should be in.
Returns:
The readily configured query.
See Also:
findInState(String, ProcessInstanceState[]), findAlive(String), ProcessDefinitionFilter, ProcessStateFilter

findInState

public static ProcessInstanceQuery findInState(String processID,
                                               ProcessInstanceState[] states)
Creates a query for finding instances of the process definition identified by processID currently being in one of the specified states. Also retrieves instances of subprocesses.

Parameters:
processID - The ID of the process definition the activity should belong to.
states - The list of states the process instance should be in one of.
Returns:
The readily configured query.
See Also:
findInState(String, ProcessInstanceState), findAlive(String), ProcessDefinitionFilter, ProcessStateFilter

findAlive

public static ProcessInstanceQuery findAlive()
Creates a query for finding alive process instances.

Alive means not being in states ProcessInstanceState.ABORTED or ProcessInstanceState.Completed

Returns:
The readily configured query.
See Also:
findAlive(String), findInState(ProcessInstanceState[]), ProcessStateFilter, ProcessStateFilter.ALIVE

findActive

public static ProcessInstanceQuery findActive()
Creates a query for finding active process instances.

Returns:
The readily configured query.
See Also:
findInterrupted(), findCompleted(), findAlive(), findInState(ProcessInstanceState), ProcessStateFilter, ProcessStateFilter.ALIVE

findInterrupted

public static ProcessInstanceQuery findInterrupted()
Creates a query for finding pending process instances.

Returns:
The readily configured query.
See Also:
findActive(), findCompleted(), findAlive(), findInState(ProcessInstanceState), ProcessStateFilter, ProcessStateFilter.ALIVE

findCompleted

public static ProcessInstanceQuery findCompleted()
Creates a query for finding completed process instances.

Completed means being in state ProcessInstanceState.Completed

Returns:
The readily configured query.
See Also:
findCompleted(String), findAlive(), findInState(ProcessInstanceState), ProcessStateFilter, ProcessStateFilter.COMPLETED

findAlive

public static ProcessInstanceQuery findAlive(String processID)
Creates a query for finding alive instances of the process definition identified by processID. Also retrieves instances of subprocesses.

Alive means not being in states ProcessInstanceState.ABORTED or ProcessInstanceState.Completed

Parameters:
processID - The ID of the process definition the activity should belong to.
Returns:
The readily configured query.
See Also:
findInState(String, ProcessInstanceState), ProcessDefinitionFilter, ProcessStateFilter, ProcessStateFilter.ALIVE

findCompleted

public static ProcessInstanceQuery findCompleted(String processID)
Creates a query for finding completed instances of the process definition identified by processID. Also retrieves instances of subprocesses.

Completed means being in state ProcessInstanceState.Completed

Parameters:
processID - The ID of the process definition the activity should belong to.
Returns:
The readily configured query.
See Also:
findCompleted(), findAlive(String), findInState(String, ProcessInstanceState), ProcessDefinitionFilter, ProcessStateFilter, ProcessStateFilter.COMPLETED

findInStateHavingData

public static ProcessInstanceQuery findInStateHavingData(String processID,
                                                         String dataID,
                                                         Serializable dataValue,
                                                         ProcessInstanceState state)
Creates a query for finding instances of the process definition identified by processID containing workflow data dataID having a value of dataValue and currently being in the specified state. Also retrieves instances of subprocesses.

Parameters:
processID - The ID of the process definition the activity should belong to.
dataID - The ID of the workflow data to match with.
dataValue - The value to match the workflow data with.
state - The state the process instance should be in.
Returns:
The readily configured query.
See Also:
findInStateHavingData(String, String, Serializable, ProcessInstanceState[]), findAliveHavingData(java.lang.String, java.lang.String, java.io.Serializable), findInState(String, ProcessInstanceState), findAlive(String), ProcessDefinitionFilter, DataFilter, ProcessStateFilter

findInStateHavingData

public static ProcessInstanceQuery findInStateHavingData(String processID,
                                                         String dataID,
                                                         Serializable dataValue,
                                                         ProcessInstanceState[] states)
Creates a query for finding instances of the process definition identified by processID containing workflow data dataID having a value of dataValue and currently being in one of the specified states. Also retrieves instances of subprocesses.

Parameters:
processID - The ID of the process definition the activity should belong to.
dataID - The ID of the workflow data to match with.
dataValue - The value to match the workflow data with.
states - The list of states the process instance should be in one of.
Returns:
The readily configured query.
See Also:
findInStateHavingData(String, String, Serializable, ProcessInstanceState), findAliveHavingData(java.lang.String, java.lang.String, java.io.Serializable), findInState(ProcessInstanceState[]), findAlive(String), ProcessDefinitionFilter, DataFilter, ProcessStateFilter

findAliveHavingData

public static ProcessInstanceQuery findAliveHavingData(String processID,
                                                       String dataID,
                                                       Serializable dataValue)
Creates a query for finding alive instances of the process definition identified by processID containing workflow data dataID having a value of dataValue. Also retrieves instances of subprocesses.

Alive means not being in states ProcessInstanceState.ABORTED or ProcessInstanceState.Completed

Parameters:
processID - The ID of the process definition the activity should belong to.
dataID - The ID of the workflow data to match with.
dataValue - The value to match the workflow data with.
Returns:
The readily configured query.
See Also:
findInStateHavingData(String, String, Serializable, ProcessInstanceState[]), findInState(String, ProcessInstanceState[]), findAlive(String), ProcessDefinitionFilter, DataFilter, ProcessStateFilter, ProcessStateFilter.ALIVE

findStartedByUser

public static ProcessInstanceQuery findStartedByUser(long userOID)
Creates a query for finding process instances started by the user identified by the given OID.

Parameters:
userOID - The OID of the user having started the process instances to find.
Returns:
The readily configured query.
See Also:
StartingUserFilter, StartingUserFilter.CURRENT_USER

findLinked

public static ProcessInstanceQuery findLinked(long processInstanceOid,
                                              LinkDirection direction,
                                              String... linkType)
Creates a query for finding process instances the given process instance is linked to via the given link type(s) and direction.

Parameters:
processInstanceOid - The OID of the process instance the query should be executed for
direction - The direction of the links that should be taken into account when determining the linked process instances
linkType - The link types that should be taken into account when determining the linked process instances
Returns:
The readily configured query.

findLinked

public static ProcessInstanceQuery findLinked(long processInstanceOid,
                                              LinkDirection direction,
                                              org.eclipse.stardust.engine.api.runtime.PredefinedProcessInstanceLinkTypes... linkType)
Creates a query for finding process instances the given process instance is linked to via the given link type(s) and direction.

Parameters:
processInstanceOid - The OID of the process instance the query should be executed for
direction - The direction of the links that should be taken into account when determining the linked process instances
linkType - The link types that should be taken into account when determining the linked process instances
Returns:
The readily configured query.

findHavingDocument

public static ProcessInstanceQuery findHavingDocument(Document document,
                                                      String modelId)
Creates a query for finding process instances which have the given Document as a process attachment, document data or document list data.

Parameters:
document - The Document to find process instances having a reference to.
modelId - The model id (null searches all models).
Returns:
The readily configured query.

findHavingDocument

public static ProcessInstanceQuery findHavingDocument(Document document)
Creates a query for finding process instances which have the given Document as a process attachment, document data or document list data.

Parameters:
document - The Document to find process instances having a reference to.
Returns:
The readily configured query.

findHavingDocument

public static ProcessInstanceQuery findHavingDocument(String documentId)
Creates a query for finding process instances which have the given Document as a process attachment, document data or document list data.

Parameters:
documentId - The id of the Document to find process instances having a reference to.
Returns:
The readily configured query.

toString

public String toString()
Overrides:
toString in class Query


Copyright © 2017 Eclipse Stardust. All Rights Reserved.