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

All Superinterfaces:
org.eclipse.stardust.engine.api.runtime.Service

public interface WorkflowService
extends org.eclipse.stardust.engine.api.runtime.Service

The WorkflowService provides all functionality for workflow operations in a CARNOT runtime environment.

This includes:

Version:
$Revision$
Author:
ubirkemeyer

Field Summary
static String ACTIVATE_NEXT_ACTIVITY_INSTANCE_RETRIES
          retry n times until receiving an activity instance defined by the query default is 5 times
static int FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE
          If a synchronous interactive successor activity instance exists and can be activated by the calling user, it will be immediately activated an returned.
 
Method Summary
 ActivityInstance abortActivityInstance(long activityInstanceOID)
          Aborts the specified activity instance, effectively aborting the whole process instance hierarchy this activity instance belongs to.
 ActivityInstance abortActivityInstance(long activityInstanceOid, AbortScope abortScope)
          Aborts the specified activity instance, effectively aborting the whole process instance hierarchy this activity instance belongs to.
 ProcessInstance abortProcessInstance(long processInstanceOid, AbortScope abortScope)
          Aborts the specified process instance.
 ActivityInstance activate(long activityInstanceOID)
          Activates the interactive activity instance identified by the activityInstanceOID.
 ActivityInstance activateAndComplete(long activityInstanceOID, String context, Map<String,?> outData)
          Activates and completes the interactive activity instance identified by the activityInstanceOID on the behalf of the currently logged-in user.
 ActivityCompletionLog activateAndComplete(long activityInstanceOID, String context, Map<String,?> outData, int flags)
          Activates and completes the interactive activity instance identified by the activityInstanceOID on the behalf of the currently logged-in user.
 ActivityInstance activateNextActivityInstance(long activityInstanceOID)
          Activates the next activity instance after the specified one in the same process instance.
 ActivityInstance activateNextActivityInstance(WorklistQuery query)
          Activates the next activity instance from the given worklist query if any.
 ActivityInstance activateNextActivityInstanceForProcessInstance(long processInstanceOID)
          Activates the next activity instance for the specified process instance.
 ActivityInstance bindActivityEventHandler(long activityInstanceOID, EventHandlerBinding eventHandler)
          Binds an event handler to the specified activity instance.
 ActivityInstance bindActivityEventHandler(long activityInstanceOID, String handler)
          Binds an event handler to the specified activity instance.
 ProcessInstance bindProcessEventHandler(long processInstanceOID, EventHandlerBinding eventHandler)
          Binds an event handler to the specified process instance.
 ProcessInstance bindProcessEventHandler(long processInstanceOID, String handler)
          Binds an event handler to the specified process instance.
 ActivityInstance complete(long activityInstanceOID, String context, Map<String,?> outData)
          Completes the interactive activity instance identified by the activityInstanceOID on the behalf of the currently logged-in user.
 ActivityCompletionLog complete(long activityInstanceOID, String context, Map<String,?> outData, int flags)
          Completes the interactive activity instance identified by the activityInstanceOID on the behalf of the currently logged-in user.
 org.eclipse.stardust.engine.api.runtime.BusinessObject createBusinessObjectInstance(String qualifiedBusinessObjectId, Object initialValue)
          Creates a new business object instance if it does not exist.
 ProcessInstance createCase(String name, String description, long[] memberOids)
          Creates a case process instance which groups the specified members as subprocesses.
 ProcessInstance delegateCase(long caseOid, ParticipantInfo participant)
          Delegates the case process instance to the specified participant.
 ActivityInstance delegateToDefaultPerformer(long activityInstanceOID)
          Delegates the specified activitiy instance to the default worklist of the corresponding activity.
 ActivityInstance delegateToParticipant(long activityInstanceOID, ParticipantInfo participant)
          Delegates the activity instance to the specified participant as follows: if the participant is null, then delegates the activity to the default performer.
 ActivityInstance delegateToParticipant(long activityInstanceOID, String performer)
          Delegates the specified activity instance to a specific performer.
 ActivityInstance delegateToUser(long activityInstanceOID, long userOID)
          Delegates the specified activity instance to a specific performer.
 void deleteBusinessObjectInstance(String qualifiedBusinessObjectId, Object primaryKey)
          Deletes a business object instance.
 Serializable execute(ServiceCommand serviceCmd)
          Executes a ServiceCommand in a single engine transaction.
 ActivityInstance getActivityInstance(long activityInstanceOID)
          Retrieves the specified ActivityInstance.
 EventHandlerBinding getActivityInstanceEventHandler(long activityInstanceOID, String handler)
          Gets the binding state of an event handler for the specified activity instance.
 List<TransitionTarget> getAdHocTransitionTargets(long activityInstanceOid, TransitionOptions options, ScanDirection direction)
          Retrieves the possible targets for forward transitions starting from the specified activity instance.
 Object getInDataPath(long processInstanceOID, String id)
          Retrieves an IN data path on a process instance as specified in the corresponding process definition.
 Map<String,Serializable> getInDataPaths(long processInstanceOID, Set<String> ids)
          Retrieves multiple IN data paths from a process instance as specified in the corresponding process definition.
 Serializable getInDataValue(long activityInstanceOID, String context, String id)
          Retrieves all evaluated IN data mappings that match the provided application context for the specified activity.
 Map<String,Serializable> getInDataValues(long activityInstanceOID, String context, Set<String> ids)
          Retrieves all evaluated IN data mappings that match the provided application context for the specified activity.
 DeployedModel getModel()
          Deprecated. Retrieves the active model.
 List<Permission> getPermissions()
          Retrieves all permissions the current user has on this service.
 ProcessInstance getProcessInstance(long processInstanceOID)
          Retrieves the specified process instance.
 EventHandlerBinding getProcessInstanceEventHandler(long processInstanceOID, String handler)
          Gets the binding state of an event handler for the specified process instance.
 Map<String,Serializable> getProcessResults(long processInstanceOID)
          Process instances can declare or implement process interfaces.
 List<ProcessDefinition> getStartableProcessDefinitions()
          Retrieves the list of process definitions that can be started by the current user.
 User getUser()
          Retrieves information on the current user.
 Worklist getWorklist(WorklistQuery query)
          Retrieves (parts of) the worklist of the currently logged-in user.
 ActivityInstance hibernate(long activityInstanceOID)
          Change the state of the specified activity instance to HIBERNATED.
 ProcessInstance joinCase(long caseOid, long[] memberOids)
          Adds the process instances referenced by the specified memberOids to the specified case process instance.
 ProcessInstance joinProcessInstance(long processInstanceOid, long targetProcessInstanceOid, String comment)
          Aborts the specified process instance and joins the data into the specified target process instance.
 ProcessInstance leaveCase(long caseOid, long[] memberOids)
          Removes the process instances referenced by the specified memberOids from the specified case process instance.
 ProcessInstance mergeCases(long targetCaseOid, long[] sourceCaseOids, String comment)
          Merges the specified source case process instances into the target case process instance by adding all case members of the source case process instances as members of the target case process instance.
 ActivityInstance performAdHocTransition(long activityInstanceOid, TransitionTarget target, boolean complete)
          Deprecated. replaced with performAdHocTransition(TransitionTarget, boolean)
 TransitionReport performAdHocTransition(TransitionTarget target, boolean complete)
          Performs the transition from the specified activity instance to the specified target.
 void setActivityInstanceAttributes(ActivityInstanceAttributes attributes)
          Sets attributes for an activity instance
 void setOutDataPath(long processInstanceOID, String id, Object object)
          Sets an OUT data path on a process instance as specified in the corresponding process definition.
 void setOutDataPaths(long processInstanceOID, Map<String,?> values)
          Sets multiple OUT data paths on a process instance as specified in the corresponding process definition.
 void setProcessInstanceAttributes(ProcessInstanceAttributes attributes)
          Sets specific attributes of a process instance.
 ProcessInstance spawnPeerProcessInstance(long processInstanceOid, String spawnProcessID, boolean copyData, Map<String,? extends Serializable> data, boolean abortProcessInstance, String comment)
          Deprecated. use spawnPeerProcessInstance(long, String, SpawnOptions)
 ProcessInstance spawnPeerProcessInstance(long processInstanceOid, String spawnProcessID, SpawnOptions options)
          Spawns a new root process and creates a link of type PredefinedProcessInstanceLinkTypes.SWITCH to the specified process instance.
 ProcessInstance spawnSubprocessInstance(long parentProcessInstanceOid, String spawnProcessID, boolean copyData, Map<String,?> data)
          Spawns a process as subprocess of the specified process instance.
 List<ProcessInstance> spawnSubprocessInstances(long parentProcessInstanceOid, List<SubprocessSpawnInfo> subprocessSpawnInfo)
          Spawns multiple processes as subprocesses of the specified process instance.
 ProcessInstance startProcess(String id, Map<String,?> data, boolean synchronously)
          Starts the process specified by the given ID using the provided data and returns the OID of the newly created process instance.
 ProcessInstance startProcess(String id, org.eclipse.stardust.engine.api.runtime.StartOptions options)
           
 ActivityInstance suspend(long activityInstanceOID, ContextData outData)
          Suspends the specified activity instance.
 ActivityInstance suspendToDefaultPerformer(long activityInstanceOID)
          Suspends the specified activity instance.
 ActivityInstance suspendToDefaultPerformer(long activityInstanceOID, String context, Map<String,?> outData)
          Suspends the specified activity instance.
 ActivityInstance suspendToParticipant(long activityInstanceOID, ParticipantInfo participant, ContextData outData)
          Suspends the activity instance and, if the participant is not null, delegates it to the specified participant.
 ActivityInstance suspendToParticipant(long activityInstanceOID, String participant)
          Suspends the specified activity instance.
 ActivityInstance suspendToParticipant(long activityInstanceOID, String participant, String context, Map<String,?> outData)
          Suspends the specified activity instance.
 ActivityInstance suspendToUser(long activityInstanceOID)
          Suspends the specified activity instance.
 ActivityInstance suspendToUser(long activityInstanceOID, long userOID)
          Suspends the specified activity instance.
 ActivityInstance suspendToUser(long activityInstanceOID, long userOID, String context, Map<String,?> outData)
          Suspends the specified activity instance.
 ActivityInstance suspendToUser(long activityInstanceOID, String context, Map<String,?> outData)
          Suspends the specified activity instance.
 ActivityInstance unbindActivityEventHandler(long activityInstanceOID, String handler)
          Unbinds an event handler from the specified activity instance.
 ProcessInstance unbindProcessEventHandler(long processInstanceOID, String handler)
          Unbinds an event handler from the specified process instance.
 org.eclipse.stardust.engine.api.runtime.BusinessObject updateBusinessObjectInstance(String qualifiedBusinessObjectId, Object newValue)
          Updates the value of a business object instance.
 void writeLogEntry(LogType logType, ContextKind contextType, long contextOid, String message, Throwable throwable)
          Logs an audit trail event of type LogCode.EXTERNAL.
 

Field Detail

ACTIVATE_NEXT_ACTIVITY_INSTANCE_RETRIES

static final String ACTIVATE_NEXT_ACTIVITY_INSTANCE_RETRIES
retry n times until receiving an activity instance defined by the query default is 5 times

See Also:
activateNextActivityInstance(WorklistQuery query), Constant Field Values

FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE

static final int FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE
If a synchronous interactive successor activity instance exists and can be activated by the calling user, it will be immediately activated an returned.

See Also:
activateNextActivityInstance(long), Constant Field Values
Method Detail

activate

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance activate(long activityInstanceOID)
                          throws org.eclipse.stardust.common.error.ConcurrencyException,
                                 org.eclipse.stardust.common.error.ObjectNotFoundException,
                                 org.eclipse.stardust.common.error.AccessForbiddenException
Activates the interactive activity instance identified by the activityInstanceOID.

Activating means:

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be activated.
Returns:
the ActivityInstance that was activated.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not valid or is not granted to execute the activity instance. Also thrown if the activity instance is already terminated.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the current user is the one who worked on the previous workflow instance.
See Also:
activateAndComplete(long, java.lang.String, java.util.Map)

complete

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance complete(long activityInstanceOID,
                                                                                                                        String context,
                                                                                                                        Map<String,?> outData)
                          throws org.eclipse.stardust.common.error.ConcurrencyException,
                                 IllegalStateChangeException,
                                 org.eclipse.stardust.common.error.ObjectNotFoundException,
                                 org.eclipse.stardust.common.error.InvalidValueException,
                                 org.eclipse.stardust.common.error.AccessForbiddenException,
                                 org.eclipse.stardust.common.error.InvalidArgumentException
Completes the interactive activity instance identified by the activityInstanceOID on the behalf of the currently logged-in user.

State Changes:

Parameters:
activityInstanceOID - the OID of the activity to be completed.
context - the ID of the context on which the data mapping will be performed.
outData - a map with the values of the out access points.
Returns:
the ActivityInstance that was completed.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the activity instance is exclusively locked by another thread.
IllegalStateChangeException - if that state change is not permitted, i.e. the activity is not active.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.InvalidValueException - if one of the outData values to be written is invalid, most probably as of a type conflict in case of statically typed data.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not allowed to complete the activity.
IllegalOperationException - if the specified activity instance is a quality assurance instance and no ActivityInstanceAttributes has been set before.
org.eclipse.stardust.common.error.InvalidArgumentException
See Also:
activateAndComplete(long, String, java.util.Map), complete(long, String, java.util.Map, int), setActivityInstanceAttributes(org.eclipse.stardust.engine.api.dto.ActivityInstanceAttributes)

complete

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityCompletionLog complete(long activityInstanceOID,
                                                                                                                             String context,
                                                                                                                             Map<String,?> outData,
                                                                                                                             int flags)
                               throws org.eclipse.stardust.common.error.ConcurrencyException,
                                      IllegalStateChangeException,
                                      org.eclipse.stardust.common.error.ObjectNotFoundException,
                                      org.eclipse.stardust.common.error.InvalidValueException,
                                      org.eclipse.stardust.common.error.AccessForbiddenException,
                                      org.eclipse.stardust.common.error.InvalidArgumentException
Completes the interactive activity instance identified by the activityInstanceOID on the behalf of the currently logged-in user.

State Changes:

Parameters:
activityInstanceOID - the OID of the activity to be completed.
context - the ID of the context on which the data mapping will be performed.
outData - a map with the values of the out access points.
flags - Optional adjustment to some details of operation. Supported values are WorkflowService.FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE.
Returns:
A log describing the result of the invocation. Depends on the flags parameter.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
IllegalStateChangeException - if that state change is not permitted, i.e. the activity is not active.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.InvalidValueException - if one of the outData values to be written is invalid, most probably as of a type conflict in case of statically typed data.
org.eclipse.stardust.common.error.AccessForbiddenException - if the activity instance is already terminated.
IllegalOperationException - if the specified activity instance is a quality assurance instance and no ActivityInstanceAttributes has been set before.
org.eclipse.stardust.common.error.InvalidArgumentException
See Also:
complete(long, String, java.util.Map), activateAndComplete(long, String, java.util.Map), setActivityInstanceAttributes(org.eclipse.stardust.engine.api.dto.ActivityInstanceAttributes)

activateAndComplete

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance activateAndComplete(long activityInstanceOID,
                                                                                                                                   String context,
                                                                                                                                   Map<String,?> outData)
                                     throws org.eclipse.stardust.common.error.ConcurrencyException,
                                            org.eclipse.stardust.common.error.ObjectNotFoundException,
                                            org.eclipse.stardust.common.error.InvalidValueException,
                                            org.eclipse.stardust.common.error.AccessForbiddenException
Activates and completes the interactive activity instance identified by the activityInstanceOID on the behalf of the currently logged-in user. If the activity is activated to be immediately completed, this method is more efficient than invoking activate(...) and complete(...) separately.

Parameters:
activityInstanceOID - the OID of the activity to be completed.
context - the ID of the context on which the data mapping will be performed. The value null will be interpreted as the default context.
outData - a map with the values of the out access points.
Returns:
the ActivityInstance that was completed.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.InvalidValueException - if one of the outData values to be written is invalid, most probably as of a type conflict in case of statically typed data.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not valid or is not granted to execute the activity instance. Also thrown if the activity instance is already terminated.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the current user is the one who worked on the previous workflow instance
IllegalOperationException - if the specified activity instance is a quality assurance instance and no ActivityInstanceAttributes has been set before.
See Also:
activate(long), complete(long, String, java.util.Map), activateAndComplete(long, String, java.util.Map, int), setActivityInstanceAttributes(org.eclipse.stardust.engine.api.dto.ActivityInstanceAttributes)

activateAndComplete

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityCompletionLog activateAndComplete(long activityInstanceOID,
                                                                                                                                        String context,
                                                                                                                                        Map<String,?> outData,
                                                                                                                                        int flags)
                                          throws org.eclipse.stardust.common.error.ConcurrencyException,
                                                 org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                 org.eclipse.stardust.common.error.InvalidValueException,
                                                 org.eclipse.stardust.common.error.AccessForbiddenException
Activates and completes the interactive activity instance identified by the activityInstanceOID on the behalf of the currently logged-in user. If the activity is activated to be immediately completed, this method is more efficient than invoking activate(...) and complete(...) separately.

Parameters:
activityInstanceOID - the OID of the activity to be completed.
context - the ID of the context on which the data mapping will be performed. The value null will be interpreted as the default context.
outData - a map with the values of the out access points.
flags - Optional adjustment to some details of operation. Supported values are WorkflowService.FLAG_ACTIVATE_NEXT_ACTIVITY_INSTANCE.
Returns:
A log describing the result of the invocation. Depends on the flags parameter.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.InvalidValueException - if one of the outData values to be written is invalid, most probably as of a type conflict in case of statically typed data.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the current user is the one who worked on the previous workflow instance
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not valid or is not granted to execute the activity instance. Also thrown if the activity instance is already terminated.
IllegalOperationException - if the specified activity instance is a quality assurance instance and no ActivityInstanceAttributes has been set before.
See Also:
activateAndComplete(long, String, java.util.Map), activate(long), complete(long, String, java.util.Map), setActivityInstanceAttributes(org.eclipse.stardust.engine.api.dto.ActivityInstanceAttributes)

getInDataValue

@ExecutionPermission(id=readActivityInstanceData,
                     scope=activity,
                     defaults=ALL,
                     fixed=OWNER)
Serializable getInDataValue(long activityInstanceOID,
                                                                                                            String context,
                                                                                                            String id)
                            throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves all evaluated IN data mappings that match the provided application context for the specified activity.

Parameters:
activityInstanceOID - the OID of the activity for which the data mappings are to be retrieved.
context - the application context for which the mappings are retrieved. The value null will be interpreted as the default context.
id - The ID of the data mapping to be retrieved.
Returns:
The retrieved value.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID or there is no mapping with the given ID under the given context.
Since:
3.1.2
See Also:
getInDataValues(long, String, java.util.Set)

getInDataValues

@ExecutionPermission(id=readActivityInstanceData,
                     scope=activity,
                     defaults=ALL,
                     fixed=OWNER)
Map<String,Serializable> getInDataValues(long activityInstanceOID,
                                                                                                                         String context,
                                                                                                                         Set<String> ids)
                                         throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves all evaluated IN data mappings that match the provided application context for the specified activity.

Parameters:
activityInstanceOID - the OID of the activity for which the data mappings are to be retrieved.
context - the application context for which the mappings are retrieved. The value null will be interpreted as the default context.
ids - the set of data mapping IDs designating the values to be retrieved. If null is passed, all IN data mappings for the context are retrieved.
Returns:
A Map with corresponding (data mapping ID, data value)-pairs. Data values are Serializable.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID or not all mapping IDs can be resolved in the given context.
Since:
3.1.2
See Also:
getInDataValue(long, String, String)

suspend

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance suspend(long activityInstanceOID,
                                                                                                                       ContextData outData)
                         throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                org.eclipse.stardust.common.error.AccessForbiddenException,
                                org.eclipse.stardust.common.error.InvalidArgumentException
Suspends the specified activity instance. It will be added to the same worklist in which it was prior to activation, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
outData - the context data containing values of out access points to be stored.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.AccessForbiddenException - if the activity instance is already terminated or is currently processed by another user or the current user does not have the required permission.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.InvalidArgumentException
See Also:
suspendToDefaultPerformer(long, String, java.util.Map)

suspendToDefaultPerformer

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance suspendToDefaultPerformer(long activityInstanceOID)
                                           throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                  org.eclipse.stardust.common.error.ConcurrencyException,
                                                  org.eclipse.stardust.common.error.AccessForbiddenException
Suspends the specified activity instance. It will be added to the worklist of the default performer declared for the corresponding activity, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the activity instance is already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
See Also:
suspendToDefaultPerformer(long, String, java.util.Map)

suspendToDefaultPerformer

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance suspendToDefaultPerformer(long activityInstanceOID,
                                                                                                                                         String context,
                                                                                                                                         Map<String,?> outData)
                                           throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                  org.eclipse.stardust.common.error.ConcurrencyException,
                                                  org.eclipse.stardust.common.error.AccessForbiddenException,
                                                  org.eclipse.stardust.common.error.InvalidArgumentException
Suspends the specified activity instance. It will be added to the worklist of the default performer declared for the corresponding activity, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
context - the ID of the context on which the data mapping will be performed.
outData - a map with values of out access points to be stored.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the activity instance is already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.InvalidArgumentException
See Also:
suspendToDefaultPerformer(long)

suspendToUser

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance suspendToUser(long activityInstanceOID)
                               throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                      org.eclipse.stardust.common.error.ConcurrencyException,
                                      org.eclipse.stardust.common.error.AccessForbiddenException
Suspends the specified activity instance. It will be added to the worklist of the current user, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
See Also:
suspendToUser(long, String, java.util.Map)

suspendToUser

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance suspendToUser(long activityInstanceOID,
                                                                                                                             String context,
                                                                                                                             Map<String,?> outData)
                               throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                      org.eclipse.stardust.common.error.ConcurrencyException,
                                      org.eclipse.stardust.common.error.AccessForbiddenException,
                                      org.eclipse.stardust.common.error.InvalidArgumentException
Suspends the specified activity instance. It will be added to the worklist of the current user, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
context - the ID of the context on which the data mapping will be performed.
outData - a map with values of out access points to be stored.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.InvalidArgumentException
See Also:
suspendToUser(long)

suspendToUser

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false,
                     implied={delegateToOther,delegateToDepartment})
ActivityInstance suspendToUser(long activityInstanceOID,
                                                                                                                                                                       long userOID)
                               throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                      org.eclipse.stardust.common.error.ConcurrencyException,
                                      org.eclipse.stardust.common.error.AccessForbiddenException,
                                      org.eclipse.stardust.common.error.InvalidArgumentException
Suspends the specified activity instance. It will be added to the worklist of the provided user, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
userOID - the OID of the user.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the specified user is the one who worked on the previous workflow instance
org.eclipse.stardust.common.error.InvalidArgumentException
See Also:
suspendToUser(long, long, String, java.util.Map)

suspendToUser

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false,
                     implied={delegateToOther,delegateToDepartment})
ActivityInstance suspendToUser(long activityInstanceOID,
                                                                                                                                                                       long userOID,
                                                                                                                                                                       String context,
                                                                                                                                                                       Map<String,?> outData)
                               throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                      org.eclipse.stardust.common.error.ConcurrencyException,
                                      org.eclipse.stardust.common.error.AccessForbiddenException,
                                      org.eclipse.stardust.common.error.InvalidArgumentException
Suspends the specified activity instance. It will be added to the worklist of the provided user, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
userOID - the OID of the user.
context - the ID of the context on which the data mapping will be performed.
outData - a map with values of out access points to be stored.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the specified user is the one who worked on the previous workflow instance
org.eclipse.stardust.common.error.InvalidArgumentException
See Also:
suspendToUser(long, long)

suspendToParticipant

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false,
                     implied={delegateToOther,delegateToDepartment})
ActivityInstance suspendToParticipant(long activityInstanceOID,
                                                                                                                                                                              String participant)
                                      throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                             org.eclipse.stardust.common.error.ConcurrencyException,
                                             org.eclipse.stardust.common.error.AccessForbiddenException
Suspends the specified activity instance. It will be added to the worklist of the provided performer, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
participant - the ID of the performer.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
See Also:
suspendToParticipant(long, String, String, java.util.Map)

suspendToParticipant

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false,
                     implied={delegateToOther,delegateToDepartment})
ActivityInstance suspendToParticipant(long activityInstanceOID,
                                                                                                                                                                              String participant,
                                                                                                                                                                              String context,
                                                                                                                                                                              Map<String,?> outData)
                                      throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                             org.eclipse.stardust.common.error.ConcurrencyException,
                                             org.eclipse.stardust.common.error.AccessForbiddenException,
                                             org.eclipse.stardust.common.error.InvalidArgumentException
Suspends the specified activity instance. It will be added to the worklist of the provided performer, and the specified activity instance will be set to SUSPENDED state.

State changes:

Parameters:
activityInstanceOID - the OID of the activity to be suspended.
participant - the ID of the performer.
context - the ID of the context on which the data mapping will be performed.
outData - a map with values of out access points to be stored.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.InvalidArgumentException
See Also:
suspendToParticipant(long, String)

suspendToParticipant

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false,
                     implied={delegateToOther,delegateToDepartment})
ActivityInstance suspendToParticipant(long activityInstanceOID,
                                                                                                                                                                              ParticipantInfo participant,
                                                                                                                                                                              ContextData outData)
                                      throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                             org.eclipse.stardust.common.error.AccessForbiddenException,
                                             org.eclipse.stardust.common.error.InvalidArgumentException
Suspends the activity instance and, if the participant is not null, delegates it to the specified participant.

State changes:

Parameters:
activityInstanceOID - the OID of the activity instance.
participant - the participant (model participant, user or user group) to which the activity instance will be delegated.
outData - the context data containing values of out access points to be stored.
Returns:
the ActivityInstance that was suspended.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID or if the participant is not null and could not be resolved to an actual user user group or model participant.
org.eclipse.stardust.common.error.AccessForbiddenException - if the activity instance is already terminated or is currently processed by another user or the current user does not have the required permission or if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the passed participant is a user who worked on the previous workflow instance
org.eclipse.stardust.common.error.InvalidArgumentException

hibernate

@ExecutionPermission(id=delegateToOther,
                     scope=activity,
                     defaults=ALL)
ActivityInstance hibernate(long activityInstanceOID)
                           throws IllegalStateChangeException,
                                  org.eclipse.stardust.common.error.ObjectNotFoundException
Change the state of the specified activity instance to HIBERNATED.

Parameters:
activityInstanceOID - the OID of the activity to be hibernated.
Returns:
the ActivityInstance that was hibernated.
Throws:
IllegalStateChangeException - if that state change is not permitted, i.e. the activity is already completed or aborted.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.

startProcess

@ExecutionPermission(id=startProcesses,
                     scope=processDefinition,
                     defaults=ALL)
ProcessInstance startProcess(String id,
                                                                                                  Map<String,?> data,
                                                                                                  boolean synchronously)
                             throws org.eclipse.stardust.common.error.ObjectNotFoundException
Starts the process specified by the given ID using the provided data and returns the OID of the newly created process instance.

State changes:

Parameters:
id - The ID of the process to be started. If multiple models with different IDs are deployed then the process definition id needs to be qualified with model id, e.g. "{modelId}processDefinitionId"
data - Contains data IDs as keyset and corresponding data values to be set as values.
synchronously - Determines whether the process will be started synchronously or asynchronously.
Returns:
the ProcessInstance that was started.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process with the specified ID in the active model or an invalid data id was specified.

startProcess

@ExecutionPermission(id=startProcesses,
                     scope=processDefinition,
                     defaults=ALL)
ProcessInstance startProcess(String id,
                                                                                                  org.eclipse.stardust.engine.api.runtime.StartOptions options)

spawnSubprocessInstance

@ExecutionPermission(id=spawnSubProcessInstance,
                     defaults=ALL)
ProcessInstance spawnSubprocessInstance(long parentProcessInstanceOid,
                                                                                                String spawnProcessID,
                                                                                                boolean copyData,
                                                                                                Map<String,?> data)
                                        throws IllegalOperationException,
                                               org.eclipse.stardust.common.error.ObjectNotFoundException,
                                               org.eclipse.stardust.common.error.ConcurrencyException
Spawns a process as subprocess of the specified process instance. The spawned process executes asynchronously but has to be completed before the parent process is able to complete.

Parameters:
parentProcessInstanceOid - The oid of the process to spawn from.
spawnProcessID - The id of the process definition to spawn as a subprocess.
copyData - Defines if data of the parent process definition should be copied to the spawned process.
data - Contains data IDs as keyset and corresponding data values to be set as values.
Returns:
the ProcessInstance that was spawned.
Throws:
IllegalOperationException - if the process instance is not a case process instance, is not active or if the process definition is from a different model.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified oid or if there is no process definition with the specified id.
org.eclipse.stardust.common.error.ConcurrencyException - if a lock on transitions or process instances cannot be obtained. This can happen while the process hierarchy is currently locked because of case operations or subprocess creation.

spawnSubprocessInstances

@ExecutionPermission(id=spawnSubProcessInstance,
                     defaults=ALL)
List<ProcessInstance> spawnSubprocessInstances(long parentProcessInstanceOid,
                                                                                                       List<SubprocessSpawnInfo> subprocessSpawnInfo)
                                               throws IllegalOperationException,
                                                      org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                      org.eclipse.stardust.common.error.ConcurrencyException
Spawns multiple processes as subprocesses of the specified process instance. The spawned processes execute asynchronously but have to be completed before the parent process is able to complete.

Parameters:
parentProcessInstanceOid - The oid of the process to spawn from.
subprocessSpawnInfo - A List of SubprocessSpawnInfo holding information about the subprocesses to be spawned.
Returns:
A list of ProcessInstance that were spawned.
Throws:
IllegalOperationException - if the process instance is not a case process instance, is not active or if the process definition is from a different model.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified oid or if there is no process definition with the specified id.
org.eclipse.stardust.common.error.ConcurrencyException - if a lock on transitions or process instances cannot be obtained. This can happen while the process hierarchy is currently locked because of case operations or subprocess creation.

spawnPeerProcessInstance

@ExecutionPermission(id=spawnPeerProcessInstance,
                     defaults=ALL)
@Deprecated
ProcessInstance spawnPeerProcessInstance(long processInstanceOid,
                                                                                                             String spawnProcessID,
                                                                                                             boolean copyData,
                                                                                                             Map<String,? extends Serializable> data,
                                                                                                             boolean abortProcessInstance,
                                                                                                             String comment)
                                         throws IllegalOperationException,
                                                org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                org.eclipse.stardust.common.error.InvalidArgumentException,
                                                org.eclipse.stardust.common.error.ConcurrencyException
Deprecated. use spawnPeerProcessInstance(long, String, SpawnOptions)

Spawns a new root process and creates a link of type PredefinedProcessInstanceLinkTypes.SWITCH to the specified process instance.
Optionally existing data from the specified process instance can be copied to the newly spawned process.

Please note that currently the specified process instance has to be aborted by setting abortProcessInstance to true.

Parameters:
processInstanceOid - The oid of the process to spawn from.
spawnProcessID - The id of the process definition to spawn as a new root process.
copyData - Defines if data of the parent process definition should be copied to the spawned process.
data - Contains data IDs as keyset and corresponding data values to be set as values.
abortProcessInstance - whether the originating process instance should be aborted. Currently has to be true.
comment - Allows to specify a comment for the link that is created.
Returns:
The ProcessInstance that was spawned.
Throws:
IllegalOperationException - if the process instance is terminated or not a root process instance. if the process instance and the process definition are from different models. if the process instances process definition is the same as the specified process definition.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the process instance for the specified oid or the process definition for the specified process id is not found.
org.eclipse.stardust.common.error.InvalidArgumentException - if abortProcessInstance is false (currently not implemented).
org.eclipse.stardust.common.error.ConcurrencyException - if a lock on process instances cannot be obtained.

spawnPeerProcessInstance

@ExecutionPermission(id=spawnPeerProcessInstance,
                     defaults=ALL)
ProcessInstance spawnPeerProcessInstance(long processInstanceOid,
                                                                                                  String spawnProcessID,
                                                                                                  SpawnOptions options)
                                         throws IllegalOperationException,
                                                org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                org.eclipse.stardust.common.error.InvalidArgumentException,
                                                org.eclipse.stardust.common.error.ConcurrencyException
Spawns a new root process and creates a link of type PredefinedProcessInstanceLinkTypes.SWITCH to the specified process instance.
Optionally existing data from the specified process instance can be copied to the newly spawned process.

Please note that currently the specified process instance has to be aborted by setting abortProcessInstance to true.

Parameters:
processInstanceOid - The oid of the process to spawn from.
spawnProcessID - The id of the process definition to spawn as a new root process.
options - Options that controls how the spawning operation has to be performed.
Returns:
The ProcessInstance that was spawned.
Throws:
IllegalOperationException - if the process instance is terminated or not a root process instance. if the process instance and the process definition are from different models. if the process instances process definition is the same as the specified process definition.
org.eclipse.stardust.common.error.ObjectNotFoundException - if the process instance for the specified oid or the process definition for the specified process id is not found.
org.eclipse.stardust.common.error.InvalidArgumentException - if abortProcessInstance is false (currently not implemented).
org.eclipse.stardust.common.error.ConcurrencyException - if a lock on process instances cannot be obtained.

createCase

@ExecutionPermission(id=createCase,
                     defaults=ALL)
ProcessInstance createCase(String name,
                                                                      String description,
                                                                      long[] memberOids)
                           throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                  IllegalOperationException,
                                  org.eclipse.stardust.common.error.InvalidArgumentException,
                                  org.eclipse.stardust.common.error.ConcurrencyException
Creates a case process instance which groups the specified members as subprocesses.

Parameters:
name - The name of the case.
description - A description for the case.
memberOids - The oids of the process instances which should become members of the case.
Returns:
The case process instance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if one of the process instances referenced by memberOids is not found.
IllegalOperationException - if memberOids contains a process instance which is not a root process.
org.eclipse.stardust.common.error.InvalidArgumentException - if memberOids is empty or null.
org.eclipse.stardust.common.error.ConcurrencyException - if a lock on transitions or process instances cannot be obtained. This can happen while the process hierarchy is currently locked because of case operations or subprocess creation.
See Also:
ProcessInstance.isCaseProcessInstance()

joinCase

@ExecutionPermission(id=modifyCase,
                     scope=processDefinition,
                     defaults=OWNER,
                     changeable=false)
ProcessInstance joinCase(long caseOid,
                                                                                                      long[] memberOids)
                         throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                IllegalOperationException,
                                org.eclipse.stardust.common.error.AccessForbiddenException,
                                org.eclipse.stardust.common.error.ConcurrencyException
Adds the process instances referenced by the specified memberOids to the specified case process instance.

Parameters:
caseOid - The oid of the case process instance.
memberOids - The oids of the process instances which should become members of the case.
Returns:
The case process instance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if one of the process instances referenced by memberOids is not found.
IllegalOperationException - if memberOids contains a process instance which is not a root process or is already a member of the case.
org.eclipse.stardust.common.error.AccessForbiddenException - if the user is not the owner of the case.
org.eclipse.stardust.common.error.ConcurrencyException - if a lock on transitions or process instances cannot be obtained. This can happen while the process hierarchy is currently locked because of case operations or subprocess creation.

leaveCase

@ExecutionPermission(id=modifyCase,
                     scope=processDefinition,
                     defaults=OWNER,
                     changeable=false)
ProcessInstance leaveCase(long caseOid,
                                                                                                       long[] memberOids)
                          throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                 IllegalOperationException,
                                 org.eclipse.stardust.common.error.AccessForbiddenException,
                                 org.eclipse.stardust.common.error.ConcurrencyException
Removes the process instances referenced by the specified memberOids from the specified case process instance.

Parameters:
caseOid - The oid of the case process instance.
memberOids - The oids of the process instances which should be removed from the case.
Returns:
The case process instance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if one of the process instances referenced by memberOids is not found.
IllegalOperationException - if memberOids contains a process instance which is not a root process or is not a member of the case.
org.eclipse.stardust.common.error.AccessForbiddenException - if the user is not the owner of the case.
org.eclipse.stardust.common.error.ConcurrencyException - if a lock on transitions or process instances cannot be obtained. This can happen while the process hierarchy is currently locked because of case operations or subprocess creation.

mergeCases

@ExecutionPermission(id=modifyCase,
                     scope=processDefinition,
                     defaults=OWNER,
                     changeable=false)
ProcessInstance mergeCases(long targetCaseOid,
                                                                                                        long[] sourceCaseOids,
                                                                                                        String comment)
                           throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                  IllegalOperationException,
                                  org.eclipse.stardust.common.error.AccessForbiddenException,
                                  org.eclipse.stardust.common.error.ConcurrencyException
Merges the specified source case process instances into the target case process instance by adding all case members of the source case process instances as members of the target case process instance.

Parameters:
targetCaseOid - The target case process instance
sourceCaseOids - The source case process instances.
comment - Allows to specify a comment
Returns:
The case process instance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if one of the process instances referenced by sourceCaseOids is not found.
IllegalOperationException - if sourceCaseOids contains a process instance which is not a case process instance. if sourceCaseOids contains a process instance which is not active. if sourceCaseOids contains a process instance which equals the targetCaseOid. if targetCaseOid is not a case process instance.
org.eclipse.stardust.common.error.AccessForbiddenException - if the user is not the owner of the case.
org.eclipse.stardust.common.error.ConcurrencyException - if a lock on transitions or process instances cannot be obtained. This can happen while the process hierarchy is currently locked because of case operations or subprocess creation.

delegateCase

@ExecutionPermission(id=delegateToOther,
                     scope=processDefinition,
                     defaults=OWNER,
                     changeable=false,
                     implied=delegateToDepartment)
ProcessInstance delegateCase(long caseOid,
                                                                                                                                          ParticipantInfo participant)
                             throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                    IllegalOperationException,
                                    org.eclipse.stardust.common.error.AccessForbiddenException
Delegates the case process instance to the specified participant.

Parameters:
caseOid - The case process instance to delegate.
participant - The targetParticipant.
Returns:
The case process instance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if one of the process instances referenced by caseOid is not found.
IllegalOperationException - if caseOid is not a case process instance.
org.eclipse.stardust.common.error.AccessForbiddenException - if the user is not the owner of the case.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the specified user is the one who worked on the previous workflow instance

joinProcessInstance

@ExecutionPermission(id=joinProcessInstance,
                     defaults=ALL)
ProcessInstance joinProcessInstance(long processInstanceOid,
                                                                                        long targetProcessInstanceOid,
                                                                                        String comment)
                                    throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                           IllegalOperationException
Aborts the specified process instance and joins the data into the specified target process instance. Existing data values of the target process instance are not overwritten. Process attachments are merged.

Parameters:
processInstanceOid - The oid of the process instance which should be aborted and joined into the target process instance.
targetProcessInstanceOid - The oid of the process instance that should be the target of the join.
comment - Allows specifying a comment.
Returns:
The target process instance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if the process instance referenced by processInstanceOid or targetProcessInstanceOid do not exist.
IllegalOperationException - if the source and target are identical.
if the source or target are not active.
if the join target is a subprocess of the source process instance.
if the source or target is a case process instance.

abortActivityInstance

@ExecutionPermission(id=abortActivityInstances,
                     scope=activity,
                     defaults=OWNER)
ActivityInstance abortActivityInstance(long activityInstanceOID)
                                       throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                              org.eclipse.stardust.common.error.ConcurrencyException,
                                              org.eclipse.stardust.common.error.AccessForbiddenException
Aborts the specified activity instance, effectively aborting the whole process instance hierarchy this activity instance belongs to.

Aborting an activity instance is only allowed if the activity was modeled to be abortable (see @link org.eclipse.stardust.engine.api.model.Activity#isAbortable() Activity.isAbortable()}). Additionally it is required that the aborting user is a valid performing participant for this activity.

Behavior is equivalent to abortActivityInstance(long, AbortScope) using AbortScope.RootHierarchy .

Note: Abort is performed asynchronously.

State changes

Parameters:
activityInstanceOID - The OID of the activity instance to be aborted.
Returns:
The ActivityInstance that was aborted.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID in the audit trail.
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not valid or is not granted access to the activity instance. Also thrown if the activity instance is already terminated or if the activity is not allowed to be aborted.
See Also:
AdministrationService.abortProcessInstance(long), abortActivityInstance(long, org.eclipse.stardust.engine.core.runtime.beans.AbortScope)

abortActivityInstance

@ExecutionPermission(id=abortActivityInstances,
                     scope=activity,
                     defaults=OWNER)
ActivityInstance abortActivityInstance(long activityInstanceOid,
                                                                                                             AbortScope abortScope)
                                       throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                              org.eclipse.stardust.common.error.ConcurrencyException,
                                              org.eclipse.stardust.common.error.AccessForbiddenException
Aborts the specified activity instance, effectively aborting the whole process instance hierarchy this activity instance belongs to.

Aborting an activity instance is only allowed if the activity was modeled to be abortable (see Activity.isAbortable()). Additionally it is required that the aborting user is a valid performing participant for this activity.

Note: Abort is performed asynchronously.

State changes

Parameters:
activityInstanceOid - The OID of the activity instance to be aborted.
abortScope - The scope of abortion. You can either choose the current activity or the entire process hierarchy.
If you have chosen AbortScope.SubHierarchy then the specified activity instance is set to state ActivityInstanceState.Aborting. The abort itself is performed asynchronously. If activity instance is a subprocess then the complete subprocess hierarchy will be aborted.
If you have chosen AbortScope.RootHierarchy abortion is done starting at the root process instance for specified activity instance. The specified activity instance will be returned unchanged. The state of the root process instance will be set to ProcessInstanceState.Aborting. Abort itself will be performed asynchronously.
Returns:
The ActivityInstance that was aborted.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID in the audit trail.
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not valid or is not granted access to the activity instance. Also thrown if the activity instance is already terminated or if the activity is not allowed to be aborted.
See Also:
AdministrationService.abortProcessInstance(long), abortActivityInstance(long)

abortProcessInstance

@ExecutionPermission(id=abortProcessInstances,
                     scope=processDefinition)
ProcessInstance abortProcessInstance(long processInstanceOid,
                                                                                                      AbortScope abortScope)
                                     throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                            org.eclipse.stardust.common.error.AccessForbiddenException
Aborts the specified process instance. Depending on the scope, it will abort either this process instance only (including eventual subprocesses) or the whole process hierarchy starting with the root process.

State changes:

Parameters:
processInstanceOid - The OID of the process instance to be aborted.
abortScope - The scope of abortion. You can abort either the spawned process instance or the entire process hierarchy.
Returns:
The ProcessInstance that was aborted.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID in the audit trail.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not valid or is not granted access to abort the process instance.

getModel

@ExecutionPermission(id=readModelData,
                     defaults=ALL)
DeployedModel getModel()
                       throws org.eclipse.stardust.common.error.ObjectNotFoundException
Deprecated. Retrieves the active model.

Returns:
the active model.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no active model.

getWorklist

@TransientState
@ExecutionPermission(id=readActivityInstanceData,
                     scope=workitem,
                     defer=true,
                     defaults=ALL,
                     fixed=OWNER,
                     changeable=false,
                     administratorOverride=false)
Worklist getWorklist(WorklistQuery query)
Retrieves (parts of) the worklist of the currently logged-in user.

Parameters:
query - An instance of class WorklistQuery describing the requested view on the worklist.
Returns:
An instance of Worklist making up the requested view on the current user's worklist.

activateNextActivityInstance

@ExecutionPermission(id=performActivity,
                     scope=workitem,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance activateNextActivityInstance(WorklistQuery query)
Activates the next activity instance from the given worklist query if any.

Parameters:
query - worklist query.
Returns:
the ActivityInstance that was activated.
Throws:
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the current user is the one who worked on the previous workflow instance

activateNextActivityInstance

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defer=true,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance activateNextActivityInstance(long activityInstanceOID)
                                              throws org.eclipse.stardust.common.error.ObjectNotFoundException
Activates the next activity instance after the specified one in the same process instance. The activation is based on a given time frame between the completion of the current and the instantiation of the next activity. There might occur scenarios where this method will not be able to retrieve the next activity due to the runtime situation

Parameters:
activityInstanceOID - the OID of the last completed activity instance.
Returns:
the ActivityInstance that was activated.
Throws:
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the current user is the one who worked on the previous workflow instance
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.

activateNextActivityInstanceForProcessInstance

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defer=true,
                     defaults=OWNER,
                     changeable=false,
                     administratorOverride=false)
ActivityInstance activateNextActivityInstanceForProcessInstance(long processInstanceOID)
                                                                throws org.eclipse.stardust.common.error.ObjectNotFoundException
Activates the next activity instance for the specified process instance. The activation is based on a given time frame between the completion of the current and the instantiation of the next activity. There might occur scenarios where this method will not be able to retrieve the next activity due to the runtime situation

Parameters:
processInstanceOID - the OID of the process instance.
Returns:
the ActivityInstance that was activated.
Throws:
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the current user is the one who worked on the previous workflow instance
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID.

setOutDataPath

@ExecutionPermission(id=readProcessInstanceData,
                     scope=processDefinition,
                     defaults=ALL)
void setOutDataPath(long processInstanceOID,
                                                                                                  String id,
                                                                                                  Object object)
                    throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                           org.eclipse.stardust.common.error.InvalidValueException
Sets an OUT data path on a process instance as specified in the corresponding process definition.

Parameters:
processInstanceOID - the OID of the process instance.
id - the ID of the data path as defined in the model.
object - the value to set on the data path.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID, if there is no data path with the specified id or if the underlying data is not found.
org.eclipse.stardust.common.error.InvalidValueException - if the object to be written represents an invalid value, most probably as of a type conflict in case of statically typed data.
See Also:
setOutDataPaths(long, java.util.Map)

setOutDataPaths

@ExecutionPermission(id=readProcessInstanceData,
                     scope=processDefinition,
                     defaults=ALL)
void setOutDataPaths(long processInstanceOID,
                                                                                                   Map<String,?> values)
                     throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                            org.eclipse.stardust.common.error.InvalidValueException
Sets multiple OUT data paths on a process instance as specified in the corresponding process definition.

Parameters:
processInstanceOID - the OID of the process instance.
values - A map of (id, value) pairs to be set, where every ID has to designate a valid data path as defined in the model.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID, if there is no data path with the specified id or if the underlying data is not found.
org.eclipse.stardust.common.error.InvalidValueException - if one of the values to be written represents is invalid, most probably as of a type conflict in case of statically typed data.
See Also:
setOutDataPath(long, String, Object)

getInDataPath

@ExecutionPermission(id=readProcessInstanceData,
                     scope=processDefinition,
                     defaults=ALL)
Object getInDataPath(long processInstanceOID,
                                                                                                   String id)
                     throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves an IN data path on a process instance as specified in the corresponding process definition.

Parameters:
processInstanceOID - the OID of the process instance.
id - the ID of the data path as defined in the model.
Returns:
the value of the data path applied to the process instance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID, if there is no data path with the specified id or if the underlying data is not found.
See Also:
getInDataPaths(long, java.util.Set)

getInDataPaths

@ExecutionPermission(id=readProcessInstanceData,
                     scope=processDefinition,
                     defaults=ALL)
Map<String,Serializable> getInDataPaths(long processInstanceOID,
                                                                                                                      Set<String> ids)
                                        throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves multiple IN data paths from a process instance as specified in the corresponding process definition.

Parameters:
processInstanceOID - the OID of the process instance.
ids - the set of data path IDs designating the values to be retrieved. If null is passed, all IN data paths for the process instance are retrieved.
Returns:
the values of the data paths applied to the process instance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID, if there is no data path with the specified id or if the underlying data is not found.
See Also:
getInDataPath(long, String)

delegateToDefaultPerformer

@ExecutionPermission(id=delegateToOther,
                     scope=activity,
                     defaults=ALL,
                     implied=delegateToDepartment)
ActivityInstance delegateToDefaultPerformer(long activityInstanceOID)
                                            throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                   org.eclipse.stardust.common.error.ConcurrencyException,
                                                   org.eclipse.stardust.common.error.AccessForbiddenException
Delegates the specified activitiy instance to the default worklist of the corresponding activity.

Parameters:
activityInstanceOID - the OID of the activity instance.
Returns:
the ActivityInstance that was delegated.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.AccessForbiddenException - if the activity instance is already terminated.

delegateToUser

@ExecutionPermission(id=delegateToOther,
                     scope=activity,
                     defaults=ALL,
                     implied=delegateToDepartment)
ActivityInstance delegateToUser(long activityInstanceOID,
                                                                                                                        long userOID)
                                throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                       org.eclipse.stardust.common.error.ConcurrencyException,
                                       org.eclipse.stardust.common.error.AccessForbiddenException,
                                       org.eclipse.stardust.common.error.InvalidArgumentException
Delegates the specified activity instance to a specific performer.

Parameters:
activityInstanceOID - the OID of the activity instance.
userOID - the OID of the user to which the activity instance will be delegated.
Returns:
the ActivityInstance that was delegated.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance or user with the specified OIDs.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the specified user is the one who worked on the previous workflow instance
org.eclipse.stardust.common.error.InvalidArgumentException

delegateToParticipant

@ExecutionPermission(id=delegateToOther,
                     scope=activity,
                     defaults=ALL,
                     implied=delegateToDepartment)
ActivityInstance delegateToParticipant(long activityInstanceOID,
                                                                                                                               String performer)
                                       throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                              org.eclipse.stardust.common.error.ConcurrencyException,
                                              org.eclipse.stardust.common.error.AccessForbiddenException
Delegates the specified activity instance to a specific performer.

Parameters:
activityInstanceOID - the OID of the activity instance.
performer - the ID of the performer to which the activity instance will be delegated.
Returns:
the ActivityInstance that was delegated.
Throws:
org.eclipse.stardust.common.error.ConcurrencyException - if the same activity instance is being processed by another user.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
org.eclipse.stardust.common.error.AccessForbiddenException - if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.

delegateToParticipant

@ExecutionPermission(id=delegateToOther,
                     scope=activity,
                     defaults=ALL,
                     implied=delegateToDepartment)
ActivityInstance delegateToParticipant(long activityInstanceOID,
                                                                                                                               ParticipantInfo participant)
                                       throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                              org.eclipse.stardust.common.error.AccessForbiddenException,
                                              org.eclipse.stardust.common.error.InvalidArgumentException
Delegates the activity instance to the specified participant as follows:

Parameters:
activityInstanceOID - the OID of the activity instance.
participant - the participant (model participant, user or user group) to which the activity instance will be delegated.
Returns:
the ActivityInstance that was delegated.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID or if the participant is not null and could not be resolved to an actual user user group or model participant.
org.eclipse.stardust.common.error.AccessForbiddenException - if the activity instance is already terminated or is currently processed by another user or the current user does not have the required permission or if the delegation target is not granted to execute the activity instance or if the activity instance is already terminated.
IllegalOperationException - if the specified activity instance is a quality assurance instance QualityAssuranceState.IS_QUALITY_ASSURANCE and the specified user is the one who worked on the previous workflow instance
org.eclipse.stardust.common.error.InvalidArgumentException

getActivityInstance

@ExecutionPermission(id=readActivityInstanceData,
                     scope=activity,
                     defaults=ALL,
                     fixed=OWNER)
ActivityInstance getActivityInstance(long activityInstanceOID)
                                     throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves the specified ActivityInstance.

Parameters:
activityInstanceOID - the OID of the activity instance.
Returns:
the ActivityInstance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.

getProcessInstance

@ExecutionPermission(id=readProcessInstanceData,
                     scope=processDefinition,
                     defaults=ALL)
ProcessInstance getProcessInstance(long processInstanceOID)
                                   throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves the specified process instance.

Parameters:
processInstanceOID - the OID of the process instance.
Returns:
the ProcessInstance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID.

getProcessResults

@ExecutionPermission(id=readProcessInstanceData,
                     scope=processDefinition,
                     defaults=ALL)
Map<String,Serializable> getProcessResults(long processInstanceOID)
                                           throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                  org.eclipse.stardust.common.error.AccessForbiddenException
Process instances can declare or implement process interfaces. These process interfaces have "input" and "output". "input" is represented by IN and INOUT parameters, "output" by OUT and INOUT parameters. This method allows to retrieve all "output" values for a specific process instance. This process instance needs to be a terminated scope process instance which implements a process interface.

Parameters:
processInstanceOID - the OID of the process instance.
Returns:
map containing all "output" parameters defined in process interface of process instance. If the process instance does not implement any process interface the map will be empty.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID.
org.eclipse.stardust.common.error.AccessForbiddenException - if the process instance is not completed, is no scope process instance or the user does not have the permission to access this process.

bindActivityEventHandler

@ExecutionPermission(id=manageEventHandlers,
                     scope=activity,
                     defaults=ALL)
ActivityInstance bindActivityEventHandler(long activityInstanceOID,
                                                                                                           EventHandlerBinding eventHandler)
                                          throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                 BindingException,
                                                 org.eclipse.stardust.common.error.InvalidArgumentException
Binds an event handler to the specified activity instance.

Parameters:
activityInstanceOID - the OID of the activity instance.
eventHandler - the specialized form of the event handler to bind.
Returns:
the ActivityInstance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
BindingException - in case of semantic binding errors.
org.eclipse.stardust.common.error.InvalidArgumentException - in case eventHandler is null.
See Also:
getActivityInstanceEventHandler(long, java.lang.String)

bindProcessEventHandler

@ExecutionPermission(id=manageEventHandlers,
                     scope=processDefinition,
                     defaults=ALL)
ProcessInstance bindProcessEventHandler(long processInstanceOID,
                                                                                                                  EventHandlerBinding eventHandler)
                                        throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                               BindingException
Binds an event handler to the specified process instance.

Parameters:
processInstanceOID - the OID of the process instance.
eventHandler - the specialized form of the event handler to bind.
Returns:
the ProcessInstance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID.
BindingException - in case of semantic binding errors.
See Also:
getProcessInstanceEventHandler(long, java.lang.String)

bindActivityEventHandler

@ExecutionPermission(id=manageEventHandlers,
                     scope=activity,
                     defaults=ALL)
ActivityInstance bindActivityEventHandler(long activityInstanceOID,
                                                                                                           String handler)
                                          throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                 BindingException
Binds an event handler to the specified activity instance.

Parameters:
activityInstanceOID - the OID of the activity instance.
handler - the ID of the event handler to bind.
Returns:
the ActivityInstance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
BindingException - in case of semantic binding errors.

bindProcessEventHandler

@ExecutionPermission(id=manageEventHandlers,
                     scope=processDefinition,
                     defaults=ALL)
ProcessInstance bindProcessEventHandler(long processInstanceOID,
                                                                                                                  String handler)
                                        throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                               BindingException
Binds an event handler to the specified process instance.

Parameters:
processInstanceOID - the OID of the process instance.
handler - the ID of the event handler to bind.
Returns:
the ProcessInstance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID.
BindingException - in case of semantic binding errors.

unbindActivityEventHandler

@ExecutionPermission(id=manageEventHandlers,
                     scope=activity,
                     defaults=ALL)
ActivityInstance unbindActivityEventHandler(long activityInstanceOID,
                                                                                                             String handler)
                                            throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                   BindingException
Unbinds an event handler from the specified activity instance.

Parameters:
activityInstanceOID - the OID of the activity instance.
handler - the ID of the event handler to unbind.
Returns:
the ActivityInstance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.
BindingException - in case of semantic binding errors.

unbindProcessEventHandler

@ExecutionPermission(id=manageEventHandlers,
                     scope=processDefinition,
                     defaults=ALL)
ProcessInstance unbindProcessEventHandler(long processInstanceOID,
                                                                                                                    String handler)
                                          throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                                 BindingException
Unbinds an event handler from the specified process instance.

Parameters:
processInstanceOID - the OID of the process instance.
handler - the ID of the event handler to unbind.
Returns:
the ProcessInstance.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID.
BindingException - in case of semantic binding errors.

getActivityInstanceEventHandler

@ExecutionPermission(id=manageEventHandlers,
                     scope=activity,
                     defaults=ALL)
EventHandlerBinding getActivityInstanceEventHandler(long activityInstanceOID,
                                                                                                                     String handler)
                                                    throws org.eclipse.stardust.common.error.ObjectNotFoundException
Gets the binding state of an event handler for the specified activity instance.

Parameters:
activityInstanceOID - the OID of the activity instance.
handler - the ID of the event handler.
Returns:
the EventHandlerBinding.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified OID.

getProcessInstanceEventHandler

@ExecutionPermission(id=manageEventHandlers,
                     scope=processDefinition,
                     defaults=ALL)
EventHandlerBinding getProcessInstanceEventHandler(long processInstanceOID,
                                                                                                                             String handler)
                                                   throws org.eclipse.stardust.common.error.ObjectNotFoundException
Gets the binding state of an event handler for the specified process instance.

Parameters:
processInstanceOID - the OID of the process instance.
handler - the ID of the event handler.
Returns:
the EventHandlerBinding.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID.

getAdHocTransitionTargets

@ExecutionPermission(id=readModelData,
                     scope=activity,
                     defer=true,
                     defaults=ALL)
List<TransitionTarget> getAdHocTransitionTargets(long activityInstanceOid,
                                                                                                                 TransitionOptions options,
                                                                                                                 ScanDirection direction)
                                                 throws org.eclipse.stardust.common.error.ObjectNotFoundException
Retrieves the possible targets for forward transitions starting from the specified activity instance.

Parameters:
activityInstanceOid - the oid of the activity instance from where the transition will be performed.
options - search options, if null then TransitionOptions.DEFAULT will be used.
direction - TODO
Returns:
A list of possible transition targets.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified oid.

performAdHocTransition

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER)
ActivityInstance performAdHocTransition(long activityInstanceOid,
                                                                                                       TransitionTarget target,
                                                                                                       boolean complete)
                                        throws IllegalOperationException,
                                               org.eclipse.stardust.common.error.ObjectNotFoundException,
                                               org.eclipse.stardust.common.error.AccessForbiddenException
Deprecated. replaced with performAdHocTransition(TransitionTarget, boolean)

Performs the transition from the specified activity instance to the specified target.

Parameters:
activityInstanceOid - the oid of the activity instance from where the transition will be performed.
target - the transition target.
complete - true if the activity instance specified should be completed, false if the activity should be aborted.
Returns:
the activity instance from which the transition was performed.
Throws:
IllegalOperationException - if the transition could not be performed because the specified TransitionTarget did not originate from the specified activity instance, or the process instance containing the activity instance has more than one active activity instance.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not allowed to perform the ad-hoc transition, or the activity instance was already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified oid.

performAdHocTransition

@ExecutionPermission(id=performActivity,
                     scope=activity,
                     defaults=OWNER)
TransitionReport performAdHocTransition(TransitionTarget target,
                                                                                                       boolean complete)
                                        throws IllegalOperationException,
                                               org.eclipse.stardust.common.error.ObjectNotFoundException,
                                               org.eclipse.stardust.common.error.AccessForbiddenException
Performs the transition from the specified activity instance to the specified target.

Parameters:
target - the transition target.
complete - true if the activity instance specified should be completed, false if the activity should be aborted.
Returns:
a pair of activity instances, where the first is the activity instance from which the transition was performed and the second is the activity instance that was created for the target activity.
Throws:
IllegalOperationException - if the transition could not be performed because the specified TransitionTarget did not originate from the specified activity instance, or the process instance containing the activity instance has more than one active activity instance.
org.eclipse.stardust.common.error.AccessForbiddenException - if the current user is not allowed to perform the ad-hoc transition, or the activity instance was already terminated.
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no activity instance with the specified oid.

getStartableProcessDefinitions

@ExecutionPermission(id=readModelData,
                     defaults=ALL)
List<ProcessDefinition> getStartableProcessDefinitions()
Retrieves the list of process definitions that can be started by the current user.

Returns:
a List with ProcessDefinition objects.

getUser

@ExecutionPermission
User getUser()
Retrieves information on the current user.

Returns:
the current user.

getPermissions

@ExecutionPermission
List<Permission> getPermissions()
Retrieves all permissions the current user has on this service.

Returns:
a list of permission ids.

setProcessInstanceAttributes

@ExecutionPermission(id=modifyAttributes,
                     scope=processDefinition,
                     defaults=ALL)
void setProcessInstanceAttributes(ProcessInstanceAttributes attributes)
                                  throws org.eclipse.stardust.common.error.ObjectNotFoundException
Sets specific attributes of a process instance. At the moment attributes has to be bound to a scope process instance.

Note: After a ProcessInstanceAttributes instance is applied to this method it is discouraged to use this same instance again. Any new note which has been added by the first use will be added again. In order to add new notes to a certain process instance a fresh ProcessInstance has to be retrieved (e.g. by getProcessInstance(long)). Get a current copy of ProcessInstanceAttributes by ProcessInstance.getAttributes().

Parameters:
attributes - the container of attributes.
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no process instance with the specified OID.
org.eclipse.stardust.common.error.PublicException - if the process instance is no scope process instance.
org.eclipse.stardust.common.error.InvalidArgumentException - if attributes is null.

setActivityInstanceAttributes

@ExecutionPermission(id=modifyAttributes,
                     scope=activity,
                     defaults=ALL)
void setActivityInstanceAttributes(ActivityInstanceAttributes attributes)
                                   throws org.eclipse.stardust.common.error.ObjectNotFoundException,
                                          org.eclipse.stardust.common.error.InvalidArgumentException
Sets attributes for an activity instance

Parameters:
attributes - - the attributes to set
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - - if the activity instance specified by ActivityInstanceAttributes.getActivityInstanceOid() could no be found.
org.eclipse.stardust.common.error.InvalidArgumentException - - when a result is set (ActivityInstanceAttributes.getQualityAssuranceResult() and the codes list(QualityAssuranceResult.getQualityAssuranceCodes() contains a null element
org.eclipse.stardust.common.error.InvalidArgumentException - - when the specified quality assurance ActivityInstanceAttributes.getActivityInstanceOid() instance is marked as ResultState.PASS_WITH_CORRECTION or ResultState.FAILED, the corresponding activity for this activity instance supplies error codes IActivity.getQualityAssuranceCodes() and no error code was supplied

writeLogEntry

@ExecutionPermission(id=modifyAuditTrailStatistics)
void writeLogEntry(LogType logType,
                                                                   ContextKind contextType,
                                                                   long contextOid,
                                                                   String message,
                                                                   Throwable throwable)
                   throws org.eclipse.stardust.common.error.ObjectNotFoundException
Logs an audit trail event of type LogCode.EXTERNAL.

Parameters:
logType - Set the type of log (info, warn, error etc.). Whereas the Unknown type is mapped to a warning.
contextType - Set the context scope of the event
contextOid - Oid of the runtime object (only used if context type is set to ProcessInstance or ActivityInstance)
message - any message that should be logged
throwable - any exception (or null) that should be appended to the message
Throws:
org.eclipse.stardust.common.error.ObjectNotFoundException - if there is no runtime object with the specified OID

execute

@ExecutionPermission
Serializable execute(ServiceCommand serviceCmd)
                     throws org.eclipse.stardust.common.error.ServiceCommandException
Executes a ServiceCommand in a single engine transaction. If the service command implements Configurable , the following option may be provided:

Parameters:
serviceCmd - the ServiceCommand to be executed.
Returns:
the result of the execution. May be null if the command has no result.
Throws:
org.eclipse.stardust.common.error.ServiceCommandException - that encapsulates any exception thrown during the execution of the command.

createBusinessObjectInstance

@ExecutionPermission(id=modifyDataValues,
                     scope=data,
                     defer=true,
                     defaults=ALL)
org.eclipse.stardust.engine.api.runtime.BusinessObject createBusinessObjectInstance(String qualifiedBusinessObjectId,
                                                                                                                                                   Object initialValue)
Creates a new business object instance if it does not exist.

Parameters:
qualifiedBusinessObjectId - the qualified id of the business object.
initialValue - the initial value of the business instance (can be null).
Returns:
the newly created business object instance.
Throws:
org.eclipse.stardust.common.error.ObjectExistsException - if BO already exists.

updateBusinessObjectInstance

@ExecutionPermission(id=modifyDataValues,
                     scope=data,
                     defer=true,
                     defaults=ALL)
org.eclipse.stardust.engine.api.runtime.BusinessObject updateBusinessObjectInstance(String qualifiedBusinessObjectId,
                                                                                                                                                   Object newValue)
Updates the value of a business object instance.

Parameters:
qualifiedBusinessObjectId - the qualified id of the business object.
newValue - the new value of the business instance (can be null).
Returns:
the updated business object instance.

deleteBusinessObjectInstance

@ExecutionPermission(id=modifyDataValues,
                     scope=data,
                     defer=true,
                     defaults=ALL)
void deleteBusinessObjectInstance(String qualifiedBusinessObjectId,
                                                                                                 Object primaryKey)
Deletes a business object instance.

Parameters:
qualifiedBusinessObjectId - the qualified id of the business object.
primaryKey - the primary key identifying the instance to be deleted.


Copyright © 2016 SunGard CSA LLC. All Rights Reserved.