Package com.orchestranetworks.workflow

# Interface UserTaskBeforeWorkItemCompletionContext

All Superinterfaces:
  `DataContextReadOnly`, `ProcessExecutionContext`, `ProcessExecutionInfoContext`

public interface UserTaskBeforeWorkItemCompletionContext extends ProcessExecutionContext, DataContextReadOnly
Dedicated context to perform checks when the user clicks the 'accept' or the 'reject' button on an interaction.

Since:
  5.4.3
See Also:
  - `UserTask.checkBeforeWorkItemCompletion(UserTaskBeforeWorkItemCompletionContext)`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.orchestranetworks.workflow.ProcessExecutionContext

  `ProcessExecutionContext.WorkflowPermission`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Session`
  `getSession()`
  Returns the authenticated session of the user who is doing the current interaction.
  `boolean`
  `isAcceptAction()`
  Returns `true` if the incoming action is an 'accept', returns `false` if it is a 'reject'.
  `void`
  `reportMessage(UserMessage anErrorMessage)`
  Blocks the 'accept' or the 'reject' action of the end user and reports the specified error message.

  ### Methods inherited from interface com.orchestranetworks.workflow.DataContextReadOnly

  `getVariableNames, getVariableString, isVariableDefined`

  ### Methods inherited from interface com.orchestranetworks.workflow.ProcessExecutionContext

  `createMailSpec, getProcessInstanceDescription, getProcessInstanceLabel, modifyProcessPriority`

  ### Methods inherited from interface com.orchestranetworks.workflow.ProcessExecutionInfoContext

  `getProcessInstance, getProcessInstanceCreator, getProcessInstanceKey, getProfileForPermission, getPublishedProcessKey, getRepository`

- ## Method Details

  - ### reportMessage

    void reportMessage(UserMessage anErrorMessage)
    Blocks the 'accept' or the 'reject' action of the end user and reports the specified error message.

    This method can be invoked multiple times, in order to display multiple messages in the message box.

    Throws:
      `IllegalArgumentException` - if the specified message is not of the severity `ERROR`.

  - ### isAcceptAction

    boolean isAcceptAction()
    Returns `true` if the incoming action is an 'accept', returns `false` if it is a 'reject'.

  - ### getSession

    Session getSession()
    Returns the authenticated session of the user who is doing the current interaction.

    The returned session is in a read-only state, meaning that the interaction's parameters cannot be modified.

    Specified by:
      `getSession` in interface `ProcessExecutionInfoContext`
    See Also:
      - `InteractionHelper.ParametersMap.setVariableString(String, String)`
      - `SessionInteraction.getInternalParameters()`