org.jbpm.services.api

## Interface UserTaskService

- All Known Subinterfaces:
    UserTaskServiceEJBLocal, UserTaskServiceEJBRemote
  All Known Implementing Classes:
    UserTaskServiceCDIImpl, UserTaskServiceEJBImpl, UserTaskServiceImpl

      public interface UserTaskService

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate(Long taskId, String userId)` Activate the task, i.e. set the task to status Ready.
    `Long` | `addAttachment(Long taskId, String userId, String name, Object attachment)` Add attachment to a task
    `Long` | `addComment(Long taskId, String text, String addedBy, Date addedOn)` Add comment to a task
    `void` | `claim(Long taskId, String userId)` Claim responsibility for a task, i.e. set the task to status Reserved
    `void` | `complete(Long taskId, String userId, Map<String,Object> params)` Complete a task with the given data
    `void` | `delegate(Long taskId, String userId, String targetUserId)` Delegate a task from userId to targetUserId
    `void` | `deleteAttachment(Long taskId, Long attachmentId)` Delete attachment from a task
    `void` | `deleteComment(Long taskId, Long commentId)` Deletes comment from a task
    `void` | `deleteContent(Long taskId, Long contentId)` Deletes content given by `contentId` from given task
    `<T> T` | `execute(String deploymentId, org.kie.api.command.Command<T> command)` Executes provided command on the underlying command executor
    `<T> T` | `execute(String deploymentId, org.kie.api.runtime.manager.Context<?> context, org.kie.api.command.Command<T> command)` Executes provided command on the underlying command executor
    `void` | `exit(Long taskId, String userId)` Requesting application is no longer interested in the task output
    `void` | `fail(Long taskId, String userId, Map<String,Object> faultData)` Actual owner completes the execution of the task raising a fault.
    `void` | `forward(Long taskId, String userId, String targetEntityId)` Forward the task to another organization entity.
    `org.kie.api.task.model.Attachment` | `getAttachmentById(Long taskId, Long attachmentId)` Get attachment by identifier
    `Object` | `getAttachmentContentById(Long taskId, Long attachmentId)` Get attachment's content by identifier
    `List<org.kie.api.task.model.Attachment>` | `getAttachmentsByTaskId(Long taskId)` Get attachments for a task
    `org.kie.api.task.model.Comment` | `getCommentById(Long taskId, Long commentId)` Get comment by identifier
    `List<org.kie.api.task.model.Comment>` | `getCommentsByTaskId(Long taskId)` Get comments for a task
    `org.kie.api.task.model.Task` | `getTask(Long taskId)` Returns task instance
    `Map<String,Object>` | `getTaskInputContentByTaskId(Long taskId)` Returns task input data of a task
    `Map<String,Object>` | `getTaskOutputContentByTaskId(Long taskId)` Returns task output data currently stored, might be null of no data is stored
    `void` | `nominate(Long taskId, String userId, List<org.kie.api.task.model.OrganizationalEntity> potentialOwners)` Nominate a task to be handled by potentialOwners
    `void` | `release(Long taskId, String userId)` Release a previously claimed task
    `void` | `resume(Long taskId, String userId)` Resume a previously suspended task
    `Long` | `saveContent(Long taskId, Map<String,Object> values)` Saves gives values as content of a task, applies to task output as input cannot be altered
    `void` | `setDescription(Long taskId, String description)` Sets description of the task
    `void` | `setExpirationDate(Long taskId, Date date)` Sets expiration date of a task to given value
    `void` | `setName(Long taskId, String name)` Sets name of the task
    `void` | `setPriority(Long taskId, int priority)` Sets priority of a task to given value
    `void` | `setSkipable(Long taskId, boolean skipable)` Sets skipable property of a task to given value
    `void` | `skip(Long taskId, String userId)` Skip a claimed task
    `void` | `start(Long taskId, String userId)` Start the execution of the task, i.e. set the task to status InProgress.
    `void` | `stop(Long taskId, String userId)` Cancel/stop the processing of the task.
    `void` | `suspend(Long taskId, String userId)` Suspend a claimed task.

- - ### Method Detail

    - #### activate

          void activate(Long taskId,
                      String userId)

      Activate the task, i.e. set the task to status Ready.
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### claim

          void claim(Long taskId,
                   String userId)

      Claim responsibility for a task, i.e. set the task to status Reserved
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### complete

          void complete(Long taskId,
                      String userId,
                      Map<String,Object> params)

      Complete a task with the given data
      Parameters:
        `taskId` -
        `userId` -
        `data` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### delegate

          void delegate(Long taskId,
                      String userId,
                      String targetUserId)

      Delegate a task from userId to targetUserId
      Parameters:
        `taskId` -
        `userId` -
        `targetUserId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### exit

          void exit(Long taskId,
                  String userId)

      Requesting application is no longer interested in the task output
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### fail

          void fail(Long taskId,
                  String userId,
                  Map<String,Object> faultData)

      Actual owner completes the execution of the task raising a fault. The fault illegalOperationFault is returned if the task interface defines no faults. If fault name or fault data is not set the operation returns illegalArgumentFault.
      Parameters:
        `taskId` -
        `userId` -
        `faultData` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### forward

          void forward(Long taskId,
                     String userId,
                     String targetEntityId)

      Forward the task to another organization entity. The caller has to specify the receiving organizational entity. Potential owners can only forward a task while the task is in the Ready state. For details on forwarding human tasks refer to section 4.7.3 in WS-HumanTask_v1.pdf
      Parameters:
        `taskId` -
        `userId` -
        `targetEntityId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### release

          void release(Long taskId,
                     String userId)

      Release a previously claimed task
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### resume

          void resume(Long taskId,
                    String userId)

      Resume a previously suspended task
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### skip

          void skip(Long taskId,
                  String userId)

      Skip a claimed task
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### start

          void start(Long taskId,
                   String userId)

      Start the execution of the task, i.e. set the task to status InProgress.
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### stop

          void stop(Long taskId,
                  String userId)

      Cancel/stop the processing of the task. The task returns to the Reserved state.
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### suspend

          void suspend(Long taskId,
                     String userId)

      Suspend a claimed task.
      Parameters:
        `taskId` -
        `userId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### nominate

          void nominate(Long taskId,
                      String userId,
                      List<org.kie.api.task.model.OrganizationalEntity> potentialOwners)

      Nominate a task to be handled by potentialOwners
      Parameters:
        `taskId` -
        `userId` -
        `potentialOwners` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### setPriority

          void setPriority(Long taskId,
                         int priority)

      Sets priority of a task to given value
      Parameters:
        `taskId` -
        `priority` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### setExpirationDate

          void setExpirationDate(Long taskId,
                               Date date)

      Sets expiration date of a task to given value
      Parameters:
        `taskId` -
        `date` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### setSkipable

          void setSkipable(Long taskId,
                         boolean skipable)

      Sets skipable property of a task to given value
      Parameters:
        `taskId` -
        `skipable` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### setName

          void setName(Long taskId,
                     String name)

      Sets name of the task
      Parameters:
        `taskId` -
        `name` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### setDescription

          void setDescription(Long taskId,
                            String description)

      Sets description of the task
      Parameters:
        `taskId` -
        `description` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### saveContent

          Long saveContent(Long taskId,
                         Map<String,Object> values)

      Saves gives values as content of a task, applies to task output as input cannot be altered
      Parameters:
        `taskId` -
        `values` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### getTaskOutputContentByTaskId

          Map<String,Object> getTaskOutputContentByTaskId(Long taskId)

      Returns task output data currently stored, might be null of no data is stored
      Parameters:
        `taskId` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### getTaskInputContentByTaskId

          Map<String,Object> getTaskInputContentByTaskId(Long taskId)

      Returns task input data of a task
      Parameters:
        `taskId` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### deleteContent

          void deleteContent(Long taskId,
                           Long contentId)

      Deletes content given by `contentId` from given task
      Parameters:
        `taskId` -
        `contentId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### addComment

          Long addComment(Long taskId,
                        String text,
                        String addedBy,
                        Date addedOn)

      Add comment to a task
      Parameters:
        `taskId` -
        `text` -
        `addedBy` -
        `addedOn` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### deleteComment

          void deleteComment(Long taskId,
                           Long commentId)

      Deletes comment from a task
      Parameters:
        `taskId` -
        `commentId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### getCommentsByTaskId

          List<org.kie.api.task.model.Comment> getCommentsByTaskId(Long taskId)

      Get comments for a task
      Parameters:
        `taskId` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### getCommentById

          org.kie.api.task.model.Comment getCommentById(Long taskId,
                                                      Long commentId)

      Get comment by identifier
      Parameters:
        `commentId` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### addAttachment

          Long addAttachment(Long taskId,
                           String userId,
                           String name,
                           Object attachment)

      Add attachment to a task
      Parameters:
        `taskId` -
        `userId` -
        `attachment` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### deleteAttachment

          void deleteAttachment(Long taskId,
                              Long attachmentId)

      Delete attachment from a task
      Parameters:
        `taskId` -
        `attachmentId` -
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### getAttachmentById

          org.kie.api.task.model.Attachment getAttachmentById(Long taskId,
                                                            Long attachmentId)

      Get attachment by identifier
      Parameters:
        `attachmentId` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### getAttachmentContentById

          Object getAttachmentContentById(Long taskId,
                                        Long attachmentId)

      Get attachment's content by identifier
      Parameters:
        `attachmentId` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### getAttachmentsByTaskId

          List<org.kie.api.task.model.Attachment> getAttachmentsByTaskId(Long taskId)

      Get attachments for a task
      Parameters:
        `taskId` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### getTask

          org.kie.api.task.model.Task getTask(Long taskId)

      Returns task instance
      Parameters:
        `taskId` -
      Returns:
      Throws:
        `TaskNotFoundException` - in case task with given id was not found

    - #### execute

          <T> T execute(String deploymentId,
                      org.kie.api.command.Command<T> command)

      Executes provided command on the underlying command executor
      Parameters:
        `deploymentId` - identifier of the deployment that engine should be used for execution
        `command` - actual command for execution
      Returns:
        results of command execution

    - #### execute

          <T> T execute(String deploymentId,
                      org.kie.api.runtime.manager.Context<?> context,
                      org.kie.api.command.Command<T> command)

      Executes provided command on the underlying command executor
      Parameters:
        `deploymentId` - identifier of the deployment that engine should be used for execution
        `context` - context implementation to be used for getting runtime engine
        `command` - actual command for execution
      Returns:
        results of command execution

Copyright © 2001–2015 JBoss by Red Hat. All rights reserved.