org.eclipse.stardust.engine.api.dto
Class ProcessInstanceDetails

java.lang.Object
  extended by org.eclipse.stardust.engine.api.dto.RuntimeObjectDetails
      extended by org.eclipse.stardust.engine.api.dto.ProcessInstanceDetails
All Implemented Interfaces:
Serializable, IDescriptorProvider, ProcessInstance, RuntimeObject

public class ProcessInstanceDetails
extends org.eclipse.stardust.engine.api.dto.RuntimeObjectDetails
implements ProcessInstance

Many methods of the CARNOT EJBs return detail objects. Detail objects are serializable helper objects passed by value to the client. They can, for instance, pass the necessary information from the audit trail to the embedding application in a dynamic way to guarantee an optimum of performance.

Instances of the class ProcessInstanceDetails are always referring to runtime objects - process instances - and contain data of these runtime objects (e.g. their OID, ID or start timestamp).

Version:
$Revision$
See Also:
Serialized Form

Field Summary
static String PRP_PI_DETAILS_OPTIONS
           
 
Fields inherited from interface org.eclipse.stardust.engine.api.runtime.ProcessInstance
UNKNOWN_OID
 
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.
 List<DataPath> getDescriptorDefinitions()
          Retrieves definitions for available descriptors.
 Map<String,Object> getDescriptors()
           
 Object getDescriptorValue(String id)
          Gets the current value of a descriptor with the specified ID.
 ProcessInstanceDetailsLevel getDetailsLevel()
          Retrieves the level of details for process instance.
 EnumSet<ProcessInstanceDetailsOptions> getDetailsOptions()
          Retrieves the options used for details creation for process instance.
 List<org.eclipse.stardust.engine.api.dto.HistoricalData> getHistoricalData()
           
 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.
 long getStartingActivityInstanceOID()
           
 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.
static void initDescriptors(org.eclipse.stardust.engine.core.runtime.beans.IProcessInstance processInstance, List<DataPath> descriptorDefinitions, Map<String,Object> descriptors)
           
static User initStartingUser(org.eclipse.stardust.engine.core.runtime.beans.IProcessInstance processInstance, org.eclipse.stardust.common.config.Parameters parameters, UserDetailsLevel userDetailsLevel)
           
 boolean isCaseProcessInstance()
          Allows to check if the process instance is a case process instance which is used to group other process instances.
 String toString()
          A human readable representation of basic aspects of this activity instance.
 
Methods inherited from class org.eclipse.stardust.engine.api.dto.RuntimeObjectDetails
equals, getModelElementID, getModelElementOID, getModelOID, getOID, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.stardust.engine.api.runtime.RuntimeObject
getModelElementID, getModelElementOID, getModelOID, getOID
 

Field Detail

PRP_PI_DETAILS_OPTIONS

public static final String PRP_PI_DETAILS_OPTIONS
See Also:
Constant Field Values
Method Detail

getProcessID

public String getProcessID()
Description copied from interface: ProcessInstance
Gets ID of this process instance's definition. Same as RuntimeObject.getModelElementID().

Specified by:
getProcessID in interface ProcessInstance
Returns:
The process ID.

getProcessName

public String getProcessName()
Description copied from interface: ProcessInstance
Gets name of this process instance's definition.

Specified by:
getProcessName in interface ProcessInstance
Returns:
The process name.
See Also:
ProcessInstance.getProcessName()

getRootProcessInstanceOID

public long getRootProcessInstanceOID()
Description copied from interface: ProcessInstance
Gets the OID of the ultimate root process instance. Same as RuntimeObject.getOID() for top-level processes.

Specified by:
getRootProcessInstanceOID in interface ProcessInstance
Returns:
The OID of the ultimate root process instance of this process instance.

getScopeProcessInstanceOID

public long getScopeProcessInstanceOID()
Description copied from interface: ProcessInstance
Gets the OID of the scope process instance the data values of this process instance are bound to.

Specified by:
getScopeProcessInstanceOID in interface ProcessInstance
Returns:
The OID of the data scope process instance of this process instance. Might be ProcessInstance.UNKNOWN_OID.

getScopeProcessInstance

public ProcessInstance getScopeProcessInstance()
Description copied from interface: ProcessInstance
Gets the the scope process instance the data values of this process instance are bound to.

Specified by:
getScopeProcessInstance in interface ProcessInstance
Returns:
The scope process instance of this process instance. Might be NULL.

getPriority

public int getPriority()
Description copied from interface: ProcessInstance
Gets the priority of the process instance.

Specified by:
getPriority in interface ProcessInstance
Returns:
The priority of the process instance or -1 if no priority set.

getStartTime

public Date getStartTime()
Description copied from interface: ProcessInstance
Gets the time when this process instance was created.

Specified by:
getStartTime in interface ProcessInstance
Returns:
the creation time.

getTerminationTime

public Date getTerminationTime()
Description copied from interface: ProcessInstance
Gets the time when this process instance was terminated.

Specified by:
getTerminationTime in interface ProcessInstance
Returns:
the time when the process was completed or aborted, or null if the process is still active.

getStartingUser

public User getStartingUser()
Description copied from interface: ProcessInstance
Gets the User object of the user that have started the process instance.

Specified by:
getStartingUser in interface ProcessInstance
Returns:
the User object of the user.

getState

public ProcessInstanceState getState()
Description copied from interface: ProcessInstance
Gets the current state of the process instance.

Specified by:
getState in interface ProcessInstance
Returns:
the state of the process instance.

getStartingActivityInstanceOID

public long getStartingActivityInstanceOID()

getParentProcessInstanceOid

public long getParentProcessInstanceOid()
Description copied from interface: ProcessInstance
Gets the oid of the parent process instance. This will only be fetched if option ProcessInstanceDetailsOptions.WITH_HIERARCHY_INFO has been set at ProcessInstanceDetailsPolicy.

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

getDescriptors

public Map<String,Object> getDescriptors()

getDescriptorValue

public Object getDescriptorValue(String id)
Description copied from interface: IDescriptorProvider
Gets the current value of a descriptor with the specified ID.

Specified by:
getDescriptorValue in interface IDescriptorProvider
Parameters:
id - the id of the descriptor.
Returns:
the value of the descriptor.

getDescriptorDefinitions

public List<DataPath> getDescriptorDefinitions()
Description copied from interface: IDescriptorProvider
Retrieves definitions for available descriptors.

Specified by:
getDescriptorDefinitions in interface IDescriptorProvider
Returns:
the descriptor definitions that are available.

initDescriptors

public static void initDescriptors(org.eclipse.stardust.engine.core.runtime.beans.IProcessInstance processInstance,
                                   List<DataPath> descriptorDefinitions,
                                   Map<String,Object> descriptors)

initStartingUser

public static User initStartingUser(org.eclipse.stardust.engine.core.runtime.beans.IProcessInstance processInstance,
                                    org.eclipse.stardust.common.config.Parameters parameters,
                                    UserDetailsLevel userDetailsLevel)

toString

public String toString()
A human readable representation of basic aspects of this activity instance.

It contains:

e.g. Support Case Management: Create Case (02/09/20 10:10:10)

Overrides:
toString in class Object
Returns:
The stringified representation of this activity instance

getDetailsLevel

public ProcessInstanceDetailsLevel getDetailsLevel()
Description copied from interface: ProcessInstance
Retrieves the level of details for process instance.

Specified by:
getDetailsLevel in interface ProcessInstance
Returns:
the process instance details level.

getDetailsOptions

public EnumSet<ProcessInstanceDetailsOptions> getDetailsOptions()
Description copied from interface: ProcessInstance
Retrieves the options used for details creation for process instance.

Specified by:
getDetailsOptions in interface ProcessInstance
Returns:
the process instance details level.

getAttributes

public ProcessInstanceAttributes getAttributes()
Description copied from interface: ProcessInstance
Retrieves extended attributes. Can return null when details level is not appropriate.

Specified by:
getAttributes in interface ProcessInstance
Returns:
Attributes of the process instance

getRuntimeAttributes

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

getHistoricalEvents

public List<HistoricalEvent> getHistoricalEvents()
Description copied from interface: ProcessInstance
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.

Specified by:
getHistoricalEvents in interface ProcessInstance
Returns:
list of all historical events
See Also:
HistoricalEvent, HistoricalEventPolicy

getLinkedProcessInstances

public List<org.eclipse.stardust.engine.api.runtime.ProcessInstanceLink> getLinkedProcessInstances()
Description copied from interface: ProcessInstance
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.

Specified by:
getLinkedProcessInstances in interface ProcessInstance
Returns:
the process instances links. Returns an empty list if the details policy was not set on the query or no links exist.

isCaseProcessInstance

public boolean isCaseProcessInstance()
Description copied from interface: ProcessInstance
Allows to check if the process instance is a case process instance which is used to group other process instances.

Specified by:
isCaseProcessInstance in interface ProcessInstance
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)

getPermission

public PermissionState getPermission(String permissionId)
Description copied from interface: ProcessInstance
Returns the permission state of the given permission id for the current user.

Specified by:
getPermission in interface ProcessInstance
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.

getBenchmark

public long getBenchmark()
Specified by:
getBenchmark in interface ProcessInstance
Returns:
OID of the Benchmark

getBenchmarkResult

public org.eclipse.stardust.engine.core.benchmark.BenchmarkResult getBenchmarkResult()
Specified by:
getBenchmarkResult in interface ProcessInstance
Returns:
the Benchmark Result

getRootProcessInstanceName

public String getRootProcessInstanceName()
Description copied from interface: ProcessInstance
Gets the name of the ultimate root process instance. Same as ProcessInstance.getProcessName() for top-level processes.

Specified by:
getRootProcessInstanceName in interface ProcessInstance
Returns:
The name of the ultimate root process instance of this process instance.

getHistoricalData

public List<org.eclipse.stardust.engine.api.dto.HistoricalData> getHistoricalData()

getBusinessCalendarId

public String getBusinessCalendarId()
Description copied from interface: ProcessInstance
Gets the identifier of the Business Calendar associated with this process instance.

Specified by:
getBusinessCalendarId in interface ProcessInstance
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.