Package com.orchestranetworks.workflow

# Interface UserTask.WorkItem

Enclosing class:
  UserTask

public static interface UserTask.WorkItem
Defines the resulting state of a work item.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static final class`
  `UserTask.WorkItem.State`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getComment()`
  Returns the work item comment.
  `Date`
  `getCompletionDate()`
  Returns the completion date of the work item.
  `UserMessage`
  `getDescription()`
  Returns description of the associated node.
  `int`
  `getItemIndex()`
  Returns the work item index.
  `UserMessage`
  `getLabel()`
  Returns label of the associated node.
  `Role`
  `getOfferedTo()`
  Deprecated.
  Since 5.7.0.
  `List<Profile>`
  `getOfferedToProfiles()`
  Returns the list of profiles the work item is offered to.
  `ProcessInstanceKey`
  `getProcessInstanceKey()`
  Returns the `ProcessInstanceKey` of the workflow associated to the current work item.
  `UserMessage`
  `getSpecificLabel()`
  Returns the specific label of the work item.
  `Date`
  `getStartDate()`
  Returns the start date of the work item.
  `UserTask.WorkItem.State`
  `getState()`
  Returns the current state of the work item.
  `UserReference`
  `getUserReference()`
  Returns the owner of the work item.
  `WorkItemKey`
  `getWorkItemKey()`
  Returns the identifier of the work item.
  `boolean`
  `hasReachedDeadline()`
  Returns `true` if the deadline has been reached for the current work item.
  `boolean`
  `isAccepted()`
  Returns `true` if the work item is accepted.
  `boolean`
  `isCommentEnabled()`
  Returns `true` if the comment is enabled for the work item (enable the comment is specified in the user task definition Reference: Enable Comments radio button).
  `boolean`
  `isRejected()`
  Returns `true` if the work item is rejected.
  `boolean`
  `isRejectEnabled()`
  Returns `true` if the rejection is enabled for the work item (the activation of the rejection is specified in the user task definition).

- ## Method Details

  - ### getProcessInstanceKey

    ProcessInstanceKey getProcessInstanceKey()
    Returns the `ProcessInstanceKey` of the workflow associated to the current work item.
    Since:
      5.7.0

  - ### isAccepted

    boolean isAccepted()
    Returns `true` if the work item is accepted.

    Returns `false` if no interaction has been found for the work item.

  - ### isRejected

    boolean isRejected()
    Returns `true` if the work item is rejected.

    Returns `false` if no interaction has been found for the work item.

  - ### isRejectEnabled

    boolean isRejectEnabled()
    Returns `true` if the rejection is enabled for the work item (the activation of the rejection is specified in the user task definition).
    Since:
      5.7.1 fix D

  - ### hasReachedDeadline

    boolean hasReachedDeadline()
    Returns `true` if the deadline has been reached for the current work item.

    Returns `false` if the work item is completed or past.

    Since:
      5.6.0

  - ### isCommentEnabled

    boolean isCommentEnabled()
    Returns `true` if the comment is enabled for the work item (enable the comment is specified in the user task definition Reference: Enable Comments radio button).
    Since:
      6.2.1

  - ### getComment

    String getComment()
    Returns the work item comment.

  - ### getUserReference

    UserReference getUserReference()
    Returns the owner of the work item.

  - ### getOfferedTo

    @Deprecated Role getOfferedTo()
    Deprecated.
    Since 5.7.0. This method is replaced by `getOfferedToProfiles()`.
    Returns the role to which the work item is offered. For the default user task mode (single work item), if only one role is defined, returns this, else throws an exception.
    Throws:
      `IllegalStateException` - if the work item is offered to more than one profile or if the profile is not a role.
    Since:
      5.2.3

  - ### getOfferedToProfiles

    List<Profile> getOfferedToProfiles()
    Returns the list of profiles the work item is offered to. In the legacy user task mode, this method returns a list with at most one element.
    Since:
      5.7.0

  - ### getLabel

    UserMessage getLabel()
    Returns label of the associated node.

  - ### getDescription

    UserMessage getDescription()
    Returns description of the associated node.

  - ### getItemIndex

    int getItemIndex()
    Returns the work item index. In the default user task mode (single work item), this method always returns 0.

  - ### getSpecificLabel

    UserMessage getSpecificLabel()
    Returns the specific label of the work item.

  - ### getState

    UserTask.WorkItem.State getState()
    Returns the current state of the work item.

  - ### getStartDate

    Date getStartDate()
    Returns the start date of the work item.

    This is the date on which the work item entered the started state.

  - ### getCompletionDate

    Date getCompletionDate()
    Returns the completion date of the work item.

    This is the date on which the work item entered the completed state.

    Returns `null` if the work item has not been completed.

    See Also:
      - `getState()`

  - ### getWorkItemKey

    WorkItemKey getWorkItemKey()
    Returns the identifier of the work item.

    This method may return `null` in some cases, for example, if the work item has been deleted and does not have primary key.

    Since:
      5.2.3