com.adobe.idp.workflow.client
Class ProcessManager

java.lang.Object
  extended by WorkflowServiceClient
      extended by com.adobe.idp.workflow.client.ProcessManager

public class ProcessManager
extends WorkflowServiceClient

The ProcessManager class is used to enable client applications to invoke, suspend, unsuspend, terminate, and complete process instances.


Field Summary
static java.lang.String SERVICE_NAME
           
 
Constructor Summary
ProcessManager(ServiceClientFactory serviceClientFactory)
          Used to create a Adobe Experience Manager forms Workflow client.
 
Method Summary
 void completeAction(java.lang.String invocationId)
          Sends a request to the process engine to complete an action instance.
 void completeAction(java.lang.String invocationId, java.lang.String aDirectedRouteId)
          Sends a request to complete an action instance and to take the specified route instead of evaluating all routes.
 void completeProcess(java.lang.String invocationId)
          Completes the specified process instance and all its related branches.
 void createActionLog(java.lang.String invocationId, short aLogLevel, java.lang.String aMessage)
          Creates a log entry for the specified action instance.
 void createActionNote(java.lang.String invocationId, java.lang.String aTitle, java.lang.String aNote)
          Creates a note for the specified action instance and stores it in the database.
 void createProcessNote(java.lang.String invocationId, java.lang.String aTitle, java.lang.String aNote)
          Creates a note for the specified process instance and stores it in the database.
 java.util.List getCommonVariableDefinitions()
          Returns the list of common process variable definitions.
 java.lang.String getInvocationIdForProcessId(java.lang.String processId)
          Returns the Invocation ID associated with the process instance specified by the process's ID.
 void interruptAction(java.lang.String invocationId, java.lang.String eventCatchTemplateId)
          Interrupts a workflow action and fires an interrupt event.
 void postMessageToAction(java.lang.String invocationId, ProcessMessage aMessage)
          Deprecated. Do not use.
 void purgeAttachments(java.lang.Long processInstanceId)
          Purges all attachments for the specified process instance.
 void purgeProcess(java.lang.String processName, java.lang.Short majorVersion, java.lang.Short minorVersion, int status, long age, com.adobe.idp.workflow.dsc.type.PurgeFilter filter, boolean includeChildren)
          Purges all instances of the processes with a given name, a version and other characteristics.
 void purgeProcesses(java.lang.String processCategory, int status, long age, boolean includeChildren)
          Purges all instances of the processes under a given service category.
 void purgeProcessInstance(java.lang.String invocationId)
          Purges single process instance based on the invocation Id.
 void retryAction(long anActionOId)
          same as above except taking a action instance id instead of invocation id
 void retryAction(java.lang.String invocationId)
          Retries an action in a stalled process instance.
 void retryBranch(long aBranchOID)
          Retries a branch in a stalled process instance.
 void scheduleMessageForAction(java.lang.String invocationId, java.util.Date aDate, ProcessMessage aMessage)
          Deprecated. Do not use.
 void sendMessageToAction(java.lang.String invocationId, ProcessMessage aMessage)
          Deprecated. Do not use.
 void stallAction(java.lang.String invocationId, java.lang.String aMessage)
          Changes the status of an action to Stalled.
 void suspendProcess(java.lang.String invocationId)
          Suspends the specified process instance and all its related branches.
 void terminateAction(java.lang.String invocationId)
          Changes the status of an action instance to Terminated.
 void terminateProcess(java.lang.String invocationId)
          Terminates the specified process instance and all its related branches.
 void unSuspendProcess(java.lang.String invocationId)
          Unsuspends the specified process instance and all its related branches.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

ProcessManager

public ProcessManager(ServiceClientFactory serviceClientFactory)
Used to create a Adobe Experience Manager forms Workflow client.

Parameters:
serviceClientFactory - The service client factory needed to create an instance of the Adobe Experience Manager forms Workflow client.
Method Detail

purgeProcessInstance

public void purgeProcessInstance(java.lang.String invocationId)
                          throws ProcessManagerException
Purges single process instance based on the invocation Id. Use this method to purge long-lived processes started asyncronously via Job Manager. The data that are purged include process variables, branches, state, audit information, documents, tasks, attachments, etc.

Parameters:
invocationId - - The id of the invocation used to start the process.
Throws:
ProcessManagerException - if a problem occurs while completing the purge.

purgeProcess

public void purgeProcess(java.lang.String processName,
                         java.lang.Short majorVersion,
                         java.lang.Short minorVersion,
                         int status,
                         long age,
                         com.adobe.idp.workflow.dsc.type.PurgeFilter filter,
                         boolean includeChildren)
                  throws ProcessManagerException
Purges all instances of the processes with a given name, a version and other characteristics. The data that are purged include process variables, branches, state, audit information, documents, tasks, attachments, etc. The processes are purged one by one. If a process instance fails to be purged, the operation logs the exception into the system log and moves to the next process instance.

Parameters:
processName - The name of the process to purge
majorVersion - The major version of the process to purge. If null, all process versions are purged
minorVersion - The minor version of the process to purge If null, all minor versions of the given process major version are purged
status - Valid numbers: 1 - purge "Completed" processes only; 2 - purge "Terminated" processes only; 3 - purge both "Completed" and "Terminated" processes
age - The time in seconds defining the age of the process to purge. The process is purged if its completion time is less than or equal to the time calculated by subtracting the number of seconds specified by this field from the time when the purge started. For example, to purge processes completed 1 day ago, set this field to 86400 (number of seconds in a day)
filter - The object tree defining an expression with process variables. The process is purged only if the expression is true. If null, no expression is evaluated
includeChildren - TRUE to recursively purge all processes instantiated by the processes matching all conditions above; FALSE to only purge the processes matching the conditions above
Throws:
ProcessManagerException - if a problem occurs while completing the purge.

purgeProcesses

public void purgeProcesses(java.lang.String processCategory,
                           int status,
                           long age,
                           boolean includeChildren)
                    throws ProcessManagerException
Purges all instances of the processes under a given service category. The data that are purged include process variables, branches, state, audit information, documents, tasks, attachments, etc. The processes are purged one by one. If a process instance fails to be purged, the operation logs the exception into the system log and moves to the next process instance.

Parameters:
processCategory - The process category to purge. If null, processes of any category (i.e. all possible processes) are purged
status - Valid numbers: 1 - purge "Completed" processes only; 2 - purge "Terminated" processes only; 3 - purge both "Completed" and "Terminated" processes
age - The time in seconds defining the age of the process to purge. The process is purged if its completion time is less than or equal to the time calculated by subtracting the number of seconds specified by this field from the time when the purge started. For example, to purge processes completed 1 day ago, set this field to 86400 (number of seconds in a day)
includeChildren - TRUE to recursively purge all children processes (i.e. the processes instantiated by the processes matching all conditions above); FALSE to only purge the processes matching the conditions above
Throws:
ProcessManagerException - if a problem occurs while completing the purge.

purgeAttachments

public void purgeAttachments(java.lang.Long processInstanceId)
                      throws ProcessManagerException
Purges all attachments for the specified process instance. The purged data includes the attachment files in the GDS and their references in the tb_task_attachment table. If a purge fails, the operation logs the exception into the system log.

Parameters:
processInstanceId - The process instance identifier to purge the attachment from.
Throws:
ProcessManagerException - if a problem occurs while completing the purge.

completeProcess

public void completeProcess(java.lang.String invocationId)
                     throws ProcessManagerException
Completes the specified process instance and all its related branches.

The process instance enters the Completing state until all related actions are completed or terminated.

Parameters:
invocationId - The invocation identifier of the process instance to be completed.
Throws:
ProcessManagerException

terminateProcess

public void terminateProcess(java.lang.String invocationId)
                      throws ProcessManagerException
Terminates the specified process instance and all its related branches.

The process instance enters the Terminating state until all related actions are terminated or completed.

Parameters:
invocationId - The invocation identifier of the process instance to be terminated.
Throws:
ProcessManagerException

suspendProcess

public void suspendProcess(java.lang.String invocationId)
                    throws ProcessManagerException
Suspends the specified process instance and all its related branches.

The process instance enters the Suspending state until all related actions are suspended, completed, or terminated.

Parameters:
invocationId - The invocation identifier of the process instance to be suspended.
Throws:
ProcessManagerException

unSuspendProcess

public void unSuspendProcess(java.lang.String invocationId)
                      throws ProcessManagerException
Unsuspends the specified process instance and all its related branches.

Parameters:
invocationId - The invocation identifier of the process instance to be unsuspended.
Throws:
ProcessManagerException

completeAction

public void completeAction(java.lang.String invocationId)
                    throws ProcessManagerException
Sends a request to the process engine to complete an action instance.

Parameters:
invocationId - The invocation identifier of the action instance to be completed.
Throws:
ProcessManagerException
See Also:
ProcessManager.completeAction(java.lang.String, java.lang.String)

completeAction

public void completeAction(java.lang.String invocationId,
                           java.lang.String aDirectedRouteId)
                    throws ProcessManagerException
Sends a request to complete an action instance and to take the specified route instead of evaluating all routes.

This method is used if a user chooses a specific route when submitting a form.

Parameters:
invocationId - The invocation identifier of the action instance to be completed.
aDirectedRouteId - The identifier of the route to take.
Throws:
ProcessManagerException
See Also:
ProcessManager.completeAction(java.lang.String)

terminateAction

public void terminateAction(java.lang.String invocationId)
                     throws ProcessManagerException
Changes the status of an action instance to Terminated.

Parameters:
invocationId - The invocation identifier of the action instance to be terminated.
Throws:
ProcessManagerException

retryAction

public void retryAction(java.lang.String invocationId)
                 throws ProcessManagerException
Retries an action in a stalled process instance. For example, if an action is executed but the required database or network location is not available, the process instance may stall. This method can be used to retry the action when the resource becomes available.

Parameters:
invocationId - The invocation identifier of the action instance to be retried.
Throws:
ProcessManagerException

retryAction

public void retryAction(long anActionOId)
                 throws ProcessManagerException
same as above except taking a action instance id instead of invocation id

Parameters:
anActionOId - The long unique identifier of the action instance to be retried.
Throws:
ProcessManagerException

retryBranch

public void retryBranch(long aBranchOID)
                 throws ProcessManagerException

Retries a branch in a stalled process instance. For example, if a rule in a branch is set incorrectly, the process instance may stall. This method can be used to retry the branch when the rule is corrected.

Parameters:
aBranchOID - The long unique identifier of the branch instance to be retried.

Throws:
ProcessManagerException

stallAction

public void stallAction(java.lang.String invocationId,
                        java.lang.String aMessage)
                 throws ProcessManagerException
Changes the status of an action to Stalled. This method can be used to stall an action temporarily when an error that can be corrected has occurred, such as a network location being temporarily unavailable.

Parameters:
invocationId - The invocation identifier of the action to be stalled.
aMessage - A string containing information about the scheduled action.
Throws:
ProcessManagerException

interruptAction

public void interruptAction(java.lang.String invocationId,
                            java.lang.String eventCatchTemplateId)
                     throws ProcessManagerException
Interrupts a workflow action and fires an interrupt event.

Parameters:
invocationId - The invocation identifier of the action to be interrupted.
eventCatchTemplateId - Designates the notification event target for the interrupt.
Throws:
ProcessManagerException

scheduleMessageForAction

public void scheduleMessageForAction(java.lang.String invocationId,
                                     java.util.Date aDate,
                                     ProcessMessage aMessage)
                              throws ProcessManagerException
Deprecated. Do not use.

Schedules a process message to execute at a specific date and time. The process message is delivered to a component's onMessage method.

For example, this method is used with the Wait component, with which a business analyst can specify a pause in a process. The Wait component uses the time interval entered by the business analyst to calculate the execution time. At execution time, the component completes the step and the process continues.

Parameters:
invocationId - The invocation identifier of the action instance to be scheduled for execution.
aDate - A java.util.Date specifying when the action is to be executed.
aMessage - An object containing information about the scheduled action.
Throws:
ProcessManagerException

sendMessageToAction

public void sendMessageToAction(java.lang.String invocationId,
                                ProcessMessage aMessage)
                         throws ProcessManagerException
Deprecated. Do not use.

Sends a process message to a specified action instance. This allows interaction with a component that is part of the process.

Parameters:
invocationId - The invocation identifier of the action instance that is to receive the message.
aMessage - An object containing information about the action.
Throws:
ProcessManagerException

postMessageToAction

public void postMessageToAction(java.lang.String invocationId,
                                ProcessMessage aMessage)
                         throws ProcessManagerException
Deprecated. Do not use.

Posts a process message to the queue.

Parameters:
invocationId - The invocation identifier of the action instance, which is paired with the process message.
aMessage - An object containing information to be used with the action instance.
Throws:
ProcessManagerException

createProcessNote

public void createProcessNote(java.lang.String invocationId,
                              java.lang.String aTitle,
                              java.lang.String aNote)
                       throws ProcessManagerException
Creates a note for the specified process instance and stores it in the database. You can display this information in a client application.

Parameters:
invocationId - The invocation identifier of the process instance.
aTitle - The title of the note.
aNote - The content of the note.
Throws:
ProcessManagerException

createActionNote

public void createActionNote(java.lang.String invocationId,
                             java.lang.String aTitle,
                             java.lang.String aNote)
                      throws ProcessManagerException
Creates a note for the specified action instance and stores it in the database. You can display this information in a client application.

Parameters:
invocationId - The invocation identifier of the action instance.
aTitle - The title of the note.
aNote - The content of the note.
Throws:
ProcessManagerException

createActionLog

public void createActionLog(java.lang.String invocationId,
                            short aLogLevel,
                            java.lang.String aMessage)
                     throws ProcessManagerException
Creates a log entry for the specified action instance.

The log is used to display messages for stalled actions and stalled branches in the Adobe Experience Manager forms Administration Console.

Parameters:
invocationId - The invocation identifier of the action instance.
aLogLevel - The logging level to use. Valid values are 0 (INFO_LEVEL), 1 (PROCESS_INFO_LEVEL), and 2 (ERROR_LEVEL). Custom levels may also be specified.
aMessage - The message to write to the log.
Throws:
ProcessManagerException

getInvocationIdForProcessId

public java.lang.String getInvocationIdForProcessId(java.lang.String processId)
                                             throws ProcessManagerException
Returns the Invocation ID associated with the process instance specified by the process's ID. the returned invocatio id can then be fed into process manager APIs e.g. terminateProcess.

Parameters:
processId - The Id of the process instance.

Returns:
a string specifying the invocation id.
Throws:
ProcessManagerException - if a problem occurs while finding the ID


getCommonVariableDefinitions

public java.util.List getCommonVariableDefinitions()
                                            throws ProcessManagerException
Returns the list of common process variable definitions.

Returns:
a list of common process variable definitions.
Throws:
ProcessManagerException