Package com.orchestranetworks.workflow

# Interface ProcessInstanceStep

public interface ProcessInstanceStep
Represents a step of a process instance. A workflow step can be:

- a script task,
- a condition,
- a user task,
- a sub-workflows invocation.

Since:
  5.4.1
See Also:
  - `ProcessInstanceHistory`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static enum`
  `ProcessInstanceStep.WaitTaskState`
  Represents the different states of a wait task.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Boolean`
  `getConditionResult()`
  Returns the result of the condition.
  `DataContext`
  `getDataContextAfter()`
  Returns the state of the data context just after the execution of the step.
  `DataContext`
  `getDataContextBefore()`
  Returns the state of the data context just before the execution of the step.
  `UserMessage`
  `getDescription()`
  Returns the description of this step.
  `Date`
  `getEndDate()`
  Returns the end date of this step.
  `int`
  `getId()`
  Returns the identifier of this step.
  `UserMessage`
  `getLabel()`
  Returns the label of this step.
  `Date`
  `getStartDate()`
  Returns the start date of this step.
  `List<ProcessInstance>`
  `getSubWorkflowsInvocationSubWorkflows()`
  Deprecated.
  Since 5.7.0.
  `List<ProcessInstanceKey>`
  `getSubWorkflowsKeys()`
  Returns the list including the key of each sub-workflow created by this step or `null` if this step is not a sub-workflow invocation.
  `UserTask.CompletionStrategy`
  `getUserTaskCompletionStrategy()`
  Returns the end criteria of the user task.
  `UserTask.UserTaskMode`
  `getUserTaskMode()`
  Returns the user task mode or `null` if this step is not a user task.
  `UserTask.WorkItem`
  `getUserTaskWorkItem()`
  Returns the work item associated to the user task or `null` if this step is not a user task.
  `List<UserTask.WorkItem>`
  `getUserTaskWorkItems()`
  Returns the list of work items associated with the user task.
  `Profile`
  `getWaitTaskExpectedProfile()`
  Returns the profile authorized to resume the wait task; returns `null` if this step is not a wait task.
  `Boolean`
  `getWaitTaskHasBeenForcedToResume()`
  Returns `Boolean.TRUE` if the resumption has been done by an administration action; returns `null` if this step is not a wait task.
  `Map<String,String>`
  `getWaitTaskReceivedParameters()`
  Returns the parameters which were received when the wait task was resumed; returns `null` if this step is not a wait task.
  `String`
  `getWaitTaskResumeId()`
  Returns the resumption identifier associated with the wait task; returns `null` if this step is not a wait task.
  `ProcessInstanceStep.WaitTaskState`
  `getWaitTaskState()`
  Returns the current state of the wait task; returns `null` if this step is not a wait task.
  `boolean`
  `isCondition()`
  Returns `true` if this step is a condition.
  `boolean`
  `isCurrentStep()`
  Returns `true` if this step is the current step of the process instance.
  `boolean`
  `isHiddenInProgressView()`
  Indicates if the step has been defined as hidden in the progress view.
  `boolean`
  `isScriptTask()`
  Returns `true` if this step is a script task.
  `boolean`
  `isSubWorkflowsInvocation()`
  Returns `true` if this step is a sub-workflow invocation.
  `boolean`
  `isUserTask()`
  Returns `true` if this step is a user task.
  `boolean`
  `isWaitTask()`
  Returns `true` if this step is a wait task.

- ## Method Details

  - ### getId

    int getId()
    Returns the identifier of this step.
    Since:
      5.6.0

  - ### getStartDate

    Date getStartDate()
    Returns the start date of this step.

  - ### getEndDate

    Date getEndDate()
    Returns the end date of this step.

  - ### getLabel

    UserMessage getLabel()
    Returns the label of this step.

  - ### getDescription

    UserMessage getDescription()
    Returns the description of this step.

  - ### getDataContextBefore

    DataContext getDataContextBefore()
    Returns the state of the data context just before the execution of the step.
    Since:
      5.6.1

  - ### getDataContextAfter

    DataContext getDataContextAfter()
    Returns the state of the data context just after the execution of the step.
    Since:
      5.6.1

  - ### isScriptTask

    boolean isScriptTask()
    Returns `true` if this step is a script task.

  - ### isUserTask

    boolean isUserTask()
    Returns `true` if this step is a user task.

  - ### isCondition

    boolean isCondition()
    Returns `true` if this step is a condition.

  - ### isSubWorkflowsInvocation

    boolean isSubWorkflowsInvocation()
    Returns `true` if this step is a sub-workflow invocation.
    Since:
      5.5.0

  - ### isWaitTask

    boolean isWaitTask()
    Returns `true` if this step is a wait task.
    Since:
      5.6.1

  - ### isCurrentStep

    boolean isCurrentStep()
    Returns `true` if this step is the current step of the process instance.

  - ### getConditionResult

    Boolean getConditionResult()
    Returns the result of the condition.

    Returns `null` if this step is not a condition.

    See Also:
      - `isCondition()`

  - ### getUserTaskWorkItems

    List<UserTask.WorkItem> getUserTaskWorkItems()
    Returns the list of work items associated with the user task. Returns `null` if this step is not a user task. In the default user task mode (single work item), this method returns a list with a single work item.

    For the default single work item mode, it is recommended to use instead `getUserTaskWorkItem()`.

    Returns:
      a `List` of `UserTask.WorkItem`.
    See Also:
      - `isUserTask()`

  - ### getUserTaskWorkItem

    UserTask.WorkItem getUserTaskWorkItem()
    Returns the work item associated to the user task or `null` if this step is not a user task.

    In the legacy user task mode, this method throws an exception if user tasks have several work items.

    Throws:
      `IllegalStateException` - if user tasks have several work items.
    Since:
      5.7.0

  - ### getUserTaskMode

    UserTask.UserTaskMode getUserTaskMode()
    Returns the user task mode or `null` if this step is not a user task.

    This method is useful to know which method must be called (`getUserTaskWorkItem()` or `getUserTaskWorkItems()`).

    Since:
      5.7.0

  - ### getUserTaskCompletionStrategy

    UserTask.CompletionStrategy getUserTaskCompletionStrategy()
    Returns the end criteria of the user task.

    Returns `null` if the step is not a user task.

    In the default user task mode (single work item), this method always returns the criteria `UserTask.CompletionStrategy.ALL_WORK_ITEMS_COMPLETED`.

    See Also:
      - `isUserTask()`

  - ### getSubWorkflowsInvocationSubWorkflows

    @Deprecated List<ProcessInstance> getSubWorkflowsInvocationSubWorkflows()
    Deprecated.
    Since 5.7.0. This method is replaced by `getSubWorkflowsKeys()`
    Returns the list of sub-workflows created by this step or `null` if this step is not a sub-workflow invocation.

    This method will return an empty list if the sub-workflows were deleted.

    To get the history of a sub-workflow, use `WorkflowEngine.getProcessInstanceHistory(ProcessInstanceKey)` with the key of the sub-workflow.

    Returns:
      a `List` of `ProcessInstance`.
    Since:
      5.5.0

  - ### getSubWorkflowsKeys

    List<ProcessInstanceKey> getSubWorkflowsKeys()
    Returns the list including the key of each sub-workflow created by this step or `null` if this step is not a sub-workflow invocation.

    To get the history of a sub workflow, use `WorkflowEngine.getProcessInstanceHistory(ProcessInstanceKey)` with the key of the sub-workflow.

    Returns:
      a `List` of `ProcessInstanceKey`.
    Since:
      5.7.0

  - ### getWaitTaskReceivedParameters

    Map<String,String> getWaitTaskReceivedParameters()
    Returns the parameters which were received when the wait task was resumed; returns `null` if this step is not a wait task.
    Returns:
      a `Map` of parameters (key: parameter name, value: parameter value).
    Since:
      5.6.1

  - ### getWaitTaskResumeId

    String getWaitTaskResumeId()
    Returns the resumption identifier associated with the wait task; returns `null` if this step is not a wait task.

    This identifier is required to resume a wait task.

    Since:
      5.6.1

  - ### getWaitTaskExpectedProfile

    Profile getWaitTaskExpectedProfile()
    Returns the profile authorized to resume the wait task; returns `null` if this step is not a wait task.
    Since:
      5.6.1

  - ### getWaitTaskHasBeenForcedToResume

    Boolean getWaitTaskHasBeenForcedToResume()
    Returns `Boolean.TRUE` if the resumption has been done by an administration action; returns `null` if this step is not a wait task.
    Since:
      5.6.1

  - ### getWaitTaskState

    ProcessInstanceStep.WaitTaskState getWaitTaskState()
    Returns the current state of the wait task; returns `null` if this step is not a wait task.
    Since:
      5.6.1

  - ### isHiddenInProgressView

    boolean isHiddenInProgressView()
    Indicates if the step has been defined as hidden in the progress view.
    Since:
      6.0.0