com.ibm.openpages.api.workflow

## Interface IWFProcess

- All Superinterfaces:
    IWFProcessContext

      public interface IWFProcess
      extends IWFProcessContext

  Interface that represents the process instance. The process instance is created either by a resource creation ( when `IWFProcessDefinition.getType()` returns `WFProcessDefinitionType.create` ) or user's operation to start the workflow, and provides access to the whole lifecycle of the process. The interface inherits from `IWFProcessContext` which provides majority of the process information. The access to the activity instance is provided here on top of it.

  Typically the `IWFProcessContext.getState()` returns `WFProcessState.open` while the process is active, and is marked `WFProcessState.complete` when the process reaches an activity whose type is `WFActivityType.end`. When the process instance is cancelled by the process termination, it is marked `WFProcessState.cancelled`. Also when the system is processing a transition in background, the state is marked `WFProcessState.executing`, until the background execution completes.

  When a workflow process is started on a resource, it uses the latest published version of the process definition, and would not be impacted by the subsequent change to the process definition or new published version. The version of the process definition used by the process instance is available by `IWFProcessContext.getProcessVersionId()`.

  Currently, the workflow system only allows single active process instance association to a resource. If a user attempts to start new process while the resource already has active process instance, the system throws an error.

  Since:
    8.0.0.2

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `IWFActivityInstance` | `getActivityInstance(Id activityInstanceId)` Returns an `IWFActivityInstance` by the activity instance ID.
    `java.util.List<IWFActivityInstance>` | `getActivityInstances()` Returns list of `IWFActivityInstance` created out of the process instance.
    `IWFActivityInstance` | `getCurrentActivityInstance()` Returns an `IWFActivityInstance` for the current activity.
    `IWFTransitionComment` | `getLastTransitionComment()` Returns the comment provided by the user on the last transition.
    `Id` | `getOriginatingProcessId()` If this process was started by another process, this method returns the Id value of that process.
    `void` | `setAttribute(java.lang.String name, java.lang.Object value)` Assigns a process instance attribute by the attribute name via transition actions.
    `void` | `setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)` Assigns the process instance attributes via transition actions.
    `void` | `setCriticality(WFProcessCriticality criticality)` Assigns criticality of the process instance via transition actions.
    `void` | `setDueDate(java.util.Date dueDate)` Assigns due date of the process instance via transition actions.
    `void` | `setOwners(java.util.List<java.lang.String> owner)` Assigns the oversight owners of the process instance via transition actions.
    `void` | `setStatusMessage(java.lang.String statusMessage)` Assigns status message of the process instance via transition actions.
    `void` | `setStatusMessageLabels(java.util.List<ILabel> processStatusLabels)` Assigns status message labels of the process instance via transition actions.

    - ### Methods inherited from interface com.ibm.openpages.api.workflow.IWFProcessContext

      `getAttribute, getAttributes, getCreatedBy, getCreatedDate, getCriticality, getDueDate, getId, getLastTransition, getLastTransitionBy, getLastTransitionDate, getModifiedBy, getModifiedDate, getOwners, getProcessVersionId, getResourceContext, getResourceId, getState, getStatusMessage, getStatusMessageLabel, getStatusMessageLabels, getType`

- - ### Method Detail

    - #### getCurrentActivityInstance

          IWFActivityInstance getCurrentActivityInstance()

      Returns an `IWFActivityInstance` for the current activity.
      Returns:

    - #### getActivityInstances

          java.util.List<IWFActivityInstance> getActivityInstances()

      Returns list of `IWFActivityInstance` created out of the process instance.
      Returns:

    - #### getActivityInstance

          IWFActivityInstance getActivityInstance(Id activityInstanceId)

      Returns an `IWFActivityInstance` by the activity instance ID.
      Parameters:
        `id` -
      Returns:

    - #### setCriticality

          void setCriticality(WFProcessCriticality criticality)

      Assigns criticality of the process instance via transition actions.
      Parameters:
        `criticality` -

    - #### setDueDate

          void setDueDate(java.util.Date dueDate)

      Assigns due date of the process instance via transition actions.
      Parameters:
        `dueDate` -

    - #### setStatusMessage

          void setStatusMessage(java.lang.String statusMessage)

      Assigns status message of the process instance via transition actions.
      Parameters:
        `statusMessage` -

    - #### setStatusMessageLabels

          void setStatusMessageLabels(java.util.List<ILabel> processStatusLabels)

      Assigns status message labels of the process instance via transition actions.
      Parameters:
        `processStatusLabels` -

    - #### setOwners

          void setOwners(java.util.List<java.lang.String> owner)

      Assigns the oversight owners of the process instance via transition actions.
      Specified by:
        `setOwners` in interface `IWFProcessContext`
      Parameters:
        `owner` -

    - #### setAttributes

          void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)

      Assigns the process instance attributes via transition actions.
      Parameters:
        `attributes` -

    - #### setAttribute

          void setAttribute(java.lang.String name,
                            java.lang.Object value)

      Assigns a process instance attribute by the attribute name via transition actions.
      Parameters:
        `name` -
        `value` -

    - #### getOriginatingProcessId

          Id getOriginatingProcessId()

      If this process was started by another process, this method returns the Id value of that process. Otherwise returns null.
      Returns:

    - #### getLastTransitionComment

          IWFTransitionComment getLastTransitionComment()

      Returns the comment provided by the user on the last transition.
      Specified by:
        `getLastTransitionComment` in interface `IWFProcessContext`
      Returns:

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.