Interface UserTask


public interface UserTask
Provides an interface for managing a user task of the workflow.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    complete(String outcome)
    Completes this user task for the current user with the specified outcome.
    Returns the completion type of this user task.
    Returns the key that uniquely identifies the user task instance.
    Returns the Mendix object for this user task.
    Returns the workflow of this user task.
    void
    Opens the page for this user task.
    void
    openPage(boolean assignOnOpen, boolean openWhenAssigned)
    Opens the page for this user task with control over when to assign automatically.
  • Method Details

    • getMendixObject

      IMendixObject getMendixObject()
      Returns the Mendix object for this user task.
      Returns:
      the user task object
    • openPage

      void openPage()
      Opens the page for this user task.

      For single user tasks, this method assigns the user task to the current user if the task is not assigned. It also prevents opening (resulting in an exception) when the task is already assigned to someone else.

      For multi user tasks, this method assigns the user task to the current user without validating it, even if it was already assigned to another user.

    • openPage

      void openPage(boolean assignOnOpen, boolean openWhenAssigned)
      Opens the page for this user task with control over when to assign automatically.
      Parameters:
      assignOnOpen - specifies whether to assign the task page automatically to the current user. For single user tasks, this user task will be assigned only when it is not assigned yet. For multi user tasks, this user task will be assigned irrespective of whether it was assigned before (to another user) or not.
      openWhenAssigned - specifies whether other users are allowed to open the assigned user task page. For multi user tasks, this parameter is ignored when assignOnOpen is true.
    • complete

      void complete(String outcome)
      Completes this user task for the current user with the specified outcome.

      For single user tasks, this method completes the user task with the specified outcome.

      For multi user tasks, this method stores the selected outcome and check whether the completion criteria are met by evaluating all collected outcomes. When they are met, the user task is completed with the resulting, otherwise the user task remains in-progress.

      Parameters:
      outcome - the outcome that is selected by the current user
    • getWorkflow

      Workflow getWorkflow()
      Returns the workflow of this user task.
      Returns:
      the workflow
    • getCompletionType

      UserTaskCompletionType getCompletionType()
      Returns the completion type of this user task.
      Returns:
      the completion type
    • getKey

      String getKey()
      Returns the key that uniquely identifies the user task instance. The value is the same as WorkflowActivityRecord.getTaskKey().

      The value cannot and should not be used for retrieving user tasks from the database.

      Returns:
      the user task key