org.eclipse.stardust.engine.api.runtime
Interface ProcessInstance

All Superinterfaces:
IDescriptorProvider, RuntimeObject, Serializable
All Known Implementing Classes:
ProcessInstanceDetails

public interface ProcessInstance
extends RuntimeObject, IDescriptorProvider

The ProcessInstance represents a snapshot of the execution state of an process instance.

The corresponding runtime object is stored in the process_instance table of the audit trail database.

Version:
$Revision$
Author:
ubirkemeyer

Field Summary
static long UNKNOWN_OID
          This will be returned if the OID is not known.
 
Fields inherited from interface org.eclipse.stardust.engine.api.runtime.IDescriptorProvider
PRP_DESCRIPTOR_IDS, PRP_PROPVIDE_DESCRIPTORS
 
Method Summary
 ProcessInstanceAttributes getAttributes()
          Retrieves extended attributes.
 long getBenchmark()
           
 org.eclipse.stardust.engine.core.benchmark.BenchmarkResult getBenchmarkResult()
           
 String getBusinessCalendarId()
          Gets the identifier of the Business Calendar associated with this process instance.
 ProcessInstanceDetailsLevel getDetailsLevel()
          Retrieves the level of details for process instance.
 EnumSet<ProcessInstanceDetailsOptions> getDetailsOptions()
          Retrieves the options used for details creation for process instance.
 List<HistoricalEvent> getHistoricalEvents()
          Gets a list of requested additional data like notes, delegations, state changes and exceptions.
 List<org.eclipse.stardust.engine.api.runtime.ProcessInstanceLink> getLinkedProcessInstances()
          Returns process instance links which have this process instance as source or target.
 long getParentProcessInstanceOid()
          Gets the oid of the parent process instance.
 PermissionState getPermission(String permissionId)
          Returns the permission state of the given permission id for the current user.
 int getPriority()
          Gets the priority of the process instance.
 String getProcessID()
          Gets ID of this process instance's definition.
 String getProcessName()
          Gets name of this process instance's definition.
 String getRootProcessInstanceName()
          Gets the name of the ultimate root process instance.
 long getRootProcessInstanceOID()
          Gets the OID of the ultimate root process instance.
 Map<String,Object> getRuntimeAttributes()
           
 ProcessInstance getScopeProcessInstance()
          Gets the the scope process instance the data values of this process instance are bound to.
 long getScopeProcessInstanceOID()
          Gets the OID of the scope process instance the data values of this process instance are bound to.
 User getStartingUser()
          Gets the User object of the user that have started the process instance.
 Date getStartTime()
          Gets the time when this process instance was created.
 ProcessInstanceState getState()
          Gets the current state of the process instance.
 Date getTerminationTime()
          Gets the time when this process instance was terminated.
 boolean isCaseProcessInstance()
          Allows to check if the process instance is a case process instance which is used to group other process instances.
 
Methods inherited from interface org.eclipse.stardust.engine.api.runtime.RuntimeObject
getModelElementID, getModelElementOID, getModelOID, getOID
 
Methods inherited from interface org.eclipse.stardust.engine.api.runtime.IDescriptorProvider
getDescriptorDefinitions, getDescriptorValue
 

Field Detail

UNKNOWN_OID

static final long UNKNOWN_OID
This will be returned if the OID is not known.

See Also:
Constant Field Values
Method Detail

getProcessID

String getProcessID()
Gets ID of this process instance's definition. Same as RuntimeObject.getModelElementID().

Returns:
The process ID.

getProcessName

String getProcessName()
Gets name of this process instance's definition.

Returns:
The process name.
See Also:
getProcessName()

getRootProcessInstanceOID

long getRootProcessInstanceOID()
Gets the OID of the ultimate root process instance. Same as RuntimeObject.getOID() for top-level processes.

Returns:
The OID of the ultimate root process instance of this process instance.

getRootProcessInstanceName

String getRootProcessInstanceName()
Gets the name of the ultimate root process instance. Same as getProcessName() for top-level processes.

Returns:
The name of the ultimate root process instance of this process instance.

getScopeProcessInstanceOID

long getScopeProcessInstanceOID()
Gets the OID of the scope process instance the data values of this process instance are bound to.

Returns:
The OID of the data scope process instance of this process instance. Might be ProcessInstance.UNKNOWN_OID.

getScopeProcessInstance

ProcessInstance getScopeProcessInstance()
Gets the the scope process instance the data values of this process instance are bound to.

Returns:
The scope process instance of this process instance. Might be NULL.

getPriority

int getPriority()
Gets the priority of the process instance.

Returns:
The priority of the process instance or -1 if no priority set.

getStartTime

Date getStartTime()
Gets the time when this process instance was created.

Returns:
the creation time.

getTerminationTime

Date getTerminationTime()
Gets the time when this process instance was terminated.

Returns:
the time when the process was completed or aborted, or null if the process is still active.

getStartingUser

User getStartingUser()
Gets the User object of the user that have started the process instance.

Returns:
the User object of the user.

getState

ProcessInstanceState getState()
Gets the current state of the process instance.

Returns:
the state of the process instance.

getDetailsLevel

ProcessInstanceDetailsLevel getDetailsLevel()
Retrieves the level of details for process instance.

Returns:
the process instance details level.

getDetailsOptions

EnumSet<ProcessInstanceDetailsOptions> getDetailsOptions()
Retrieves the options used for details creation for process instance.

Returns:
the process instance details level.

getAttributes

ProcessInstanceAttributes getAttributes()
Retrieves extended attributes. Can return null when details level is not appropriate.

Returns:
Attributes of the process instance

getRuntimeAttributes

Map<String,Object> getRuntimeAttributes()
Returns:
custom runtime attributes not necessarily reflected in the database

getHistoricalEvents

List<HistoricalEvent> getHistoricalEvents()
Gets a list of requested additional data like notes, delegations, state changes and exceptions. This list is sorted in ascending order (oldest first).
The list will be populated depending on HistoricalEventPolicy applied to ProcessInstanceQuery. By default this list will be empty as retrieval might degrade query performance.

Returns:
list of all historical events
See Also:
HistoricalEvent, HistoricalEventPolicy

getPermission

PermissionState getPermission(String permissionId)
Returns the permission state of the given permission id for the current user.

Parameters:
permissionId -
Returns:
Granted if the the permission was granted to the user, Denied if the permission was denied to the user or Unknown if the permission is invalid for this process instance.

getParentProcessInstanceOid

long getParentProcessInstanceOid()
Gets the oid of the parent process instance. This will only be fetched if option ProcessInstanceDetailsOptions.WITH_HIERARCHY_INFO has been set at ProcessInstanceDetailsPolicy.

Returns:
oid of parent process instance, might be 0 if this process instance has not been started as synchronous subprocess.
UNKNOWN_OID will be returned if an error occurred or details option has not been set.

getLinkedProcessInstances

List<org.eclipse.stardust.engine.api.runtime.ProcessInstanceLink> getLinkedProcessInstances()
Returns process instance links which have this process instance as source or target. This will only be fetched if option ProcessInstanceDetailsOptions.WITH_LINK_INFO has been set at ProcessInstanceDetailsPolicy.

Returns:
the process instances links. Returns an empty list if the details policy was not set on the query or no links exist.

isCaseProcessInstance

boolean isCaseProcessInstance()
Allows to check if the process instance is a case process instance which is used to group other process instances.

Returns:
true - if the process instance is a case process instance.
false - if the process instance is not a case process instance.
See Also:
WorkflowService.createCase(String, String, long[]), WorkflowService.joinCase(long, long[]), WorkflowService.leaveCase(long, long[]), WorkflowService.mergeCases(long, long[], String)

getBenchmarkResult

org.eclipse.stardust.engine.core.benchmark.BenchmarkResult getBenchmarkResult()
Returns:
the Benchmark Result

getBenchmark

long getBenchmark()
Returns:
OID of the Benchmark

getBusinessCalendarId

String getBusinessCalendarId()
Gets the identifier of the Business Calendar associated with this process instance.

Returns:
the id or path of the Business Calendar or null if the process instance doesn't have a calendar.


Copyright © 2017 Eclipse Stardust. All Rights Reserved.