REST Interface for BPEL-related Task Resources - Task Resource - POST Method

Use this method to create a new instance of a human task.

Sample method invocation

POST /rest/bpm/htm/v1/task?taskTemplateID={string}[&mode={string}][&relation={string}][&parentTaskID={string}]

Parameters

Required Parameters
NameValue TypeDescription
taskTemplateID string
The ID of the task template from which the new task instance is created.
Optional Parameters
NameValue TypeDescription
mode string
Specifies the mode in which the task instance is created.
ValueDescription
createOnly (default)
Creates the task but does not start the task. This value is not allowed if the parameters relation and parentTaskID are specified.
sync
Use a synchronous operation to start the task. This value is only allowed for invocation tasks, and it is not allowed if the parameters relation and parentTaskID are specified.
async
Use a asynchronous operation to start the task.
relation string
Task relationship - must be specified together with the parentTaskID parameter.
ValueDescription
subTask
The new task is a subtask. This value can only be used when the mode parameter is set to async.
parentTaskID string
Task ID of the parent task - must be specified together with the relation parameter.

Request Content

Human task input (optional).

The default content-type is application/xml.

MIME Type: application/xml

The XML Schema type/element is defined as part of the custom task definition.

MIME Type: application/json

The JSON Schema can be derived from the XML Schema type/element definition (see [JSON Format]).

Response Content

The returned response depends on the specified mode parameter and the outcome of a task that runs synchronously:
  1. mode=createOnly or mode=async,
  2. mode=sync and task returns output data,
  3. mode=sync and task returns fault data.

MIME Type: application/json

1. Human task details are returned if the mode parameter is set to createOnly or async.


+ View Schema
{  "description": "Task", 
   "type": "object",
   "properties":
   {  "activationTime": {"type": "string", "format": "date-time",
         "description": "Time the task instance is set into the ready state - this also happens when the task is restarted or when a claim is canceled."
      },
      "applicationDefaultsID": {"type": "string",
         "description": "ID of the application component that specifies the defaults for the task."
      },
      "applicationName": {"type": "string",
         "description": "Name of the application the task is part of."
      },
      "assignmentType": {"type": "string",
         "description": "States whether the task can be assigned to a single person only or to multiple persons in parallel.",
         "enum":
         [
            "ASSIGNMENT_TYPE_SINGLE",
            "ASSIGNMENT_TYPE_PARALLEL"
         ]
      },
      "autoDeletionMode": {"type": "string",
         "description": "States whether the task instance is automatically or conditionally deleted when it reaches an end execution state."
      },
      "binaryCustomPropertiesMetadata": {"type": "object", "additionalProperties": {"type": "string"},
         "description": "Metadata for binary custom properties associated with this task."
      },
      "calendarName": {"type": "string",
         "description": "Name of the calendar used, for example, for expiration calculations."
      },
      "clientTypes": {"type": ["string"],
         "description": "A user-defined client type to specify UI client information, for example, Web, Portal, or Custom."
      },
      "completionTime": {"type": "string", "format": "date-time",
         "description": "Time when the task instance reached an end state."
      },
      "containmentContextID": {"type": "string",
         "description": "ID of the context which embraces the task instance."
      },
      "contextAuthorizationOfOwner": {"type": "string",
         "description": "Authorization rights of the task owner to the associated context."
      },  
      "customProperties": {"type": "object", "additionalProperties": {"type": "string"},
         "description": "List of custom property names and values."
      },
      "customText1": {"type": "string",
         "description": "Inline custom property 1."
      },
      "customText2": {"type": "string",
         "description": "Inline custom property 2."
      },
      "customText3": {"type": "string",
         "description": "Inline custom property 3."
      },
      "customText4": {"type": "string",
         "description": "Inline custom property 4."
      },
      "customText5": {"type": "string",
         "description": "Inline custom property 5."
      },
      "customText6": {"type": "string",
         "description": "Inline custom property 6."
      },
      "customText7": {"type": "string",
         "description": "Inline custom property 7."
      },
      "customText8": {"type": "string",
         "description": "Inline custom property 8."
      },
      "definitionName": {"type": "string",
         "description": "Name of the task definition in the TEL."
      },
      "definitionNamespace": {"type": "string",
         "description": "XML schema namespace of the task definition in the TEL."
      },
      "deletionTime":  {"type": "string", "format": "date-time",
         "description": "Time when the task is deleted."
      },
      "description": {"type": "string",
         "description": "Description of the task."
      },
      "displayName": {"type": "string",
         "description": "Display name of the task."
      },
      "dueTime":  {"type": "string", "format": "date-time",
         "description": "Time when the task is due."
      },
      "durationUntilDeleted": {"type": "string",
         "description": "Duration that the task is kept after it has reached an end state."
      },
      "durationUntilDue": {"type": "string",
         "description": "Duration when the task becomes due."
      },
      "durationUntilExpires": {"type": "string",
         "description": "Duration when the task expires once it is activated."
      },
      "eventHandlerName": {"type": "string",
         "description": "Name of the associated event handler."
      },
      "expirationTime": {"type": "string", "format": "date-time",
         "description": "Time when the task instance will expire or was due to expire."
      },
      "firstActivationTime": {"type": "string", "format": "date-time",
         "description": "Time the task instance is set into the ready state for the first time."
      },
      "followOnTaskID": {"type": "string",
         "description": "ID of the next task instance in a sequence."
      },
      "inheritedAuthorization": {"type": "string",
         "description": "States for a subtask which kind of authorization is inherited from a parent task.",
         "enum":
         [
            "INHERITED_AUTH_NONE",
            "INHERITED_AUTH_ADMINISTRATOR",
            "INHERITED_AUTH_ALL"
         ]
      },
      "inputMessageTypeName": {"type": "string", 
         "description": "Name of the input message type. The value has the format {namespace}localname."
      },
      "invokedInstanceID": {"type": "string",
         "description": "The object ID of the invoked service."
      },
      "invokedInstanceType": {"type": "string",
         "description": "The type of service called by this task.",
         "enum":
         [
            "INVOKED_INSTANCE_TYPE_PROCESS",
            "INVOKED_INSTANCE_TYPE_TASK",
            "INVOKED_INSTANCE_TYPE_EVENT",
            "INVOKED_INSTANCE_TYPE_ACTIVITY",
            "INVOKED_INSTANCE_TYPE_NOT_SET"
         ]
      },
      "isAdHoc": {"type": "boolean",
         "description": "States whether the task has been created ad-hoc."
      },
      "isBusinessRelevant": {"type": "boolean",
         "description": "States whether the task is a business relevant or an 'auxiliary' step."
      },
      "isBusinessRelevanceUpdateable": {"type": "boolean",
         "description": "Signals whether the business relevance property can be changed for the kind and current state of the object."
      },
      "isChild": {"type": "boolean",
         "description": "States for standalone tasks whether the task instance runs dependently of its parent or not."
      },
      "isContextAuthorizationOfOwnerUpdateable": {"type": "boolean",
         "description": "Signals whether the context authorization property can be changed for the kind and current state of the object."
      },
      "isDeletionTimeUpdateable": {"type": "boolean",
         "description": "Signals whether the deletion time property can be changed for the kind and current state of the object."
      },
      "isDescriptionUpdateable": {"type": "boolean",
         "description": "Signals whether the description property can be changed for the kind and current state of the object."
      },
      "isDisplayNameUpdateable": {"type": "boolean",
         "description": "Signals whether the display name property can be changed for the kind and current state of the object."
      },
      "isDueTimeUpdateable": {"type": "boolean",
         "description": "Signals whether the due time property can be changed for the kind and current state of the object."
      },
      "isDurationUntilDeletedUpdateable": {"type": "boolean",
         "description": "Signals whether the duration until deleted property can be changed for the kind and current state of the object."
      },
      "isDurationUntilDueUpdateable": {"type": "boolean",
         "description": "Signals whether the duration until due property can be changed for the kind and current state of the object."
      },
      "isDurationUntilExpiresUpdateable": {"type": "boolean",
         "description": "Signals whether the duration until expires property can be changed for the kind and current state of the object."
      },
      "isEscalated": {"type": "boolean",
         "description": "States whether an escalation occurred."
      },
      "isEscalatedUpdateable": {"type": "boolean",
         "description": "Signals whether the isEscalated property can be changed for the kind and current state of the object."
      },
      "isEventHandlerNameUpdateable": {"type": "boolean",
         "description": "Signals whether the event handler name property can be changed for the kind and current state of the object."
      },
      "isExpirationTimeUpdateable": {"type": "boolean",
         "description": "Signals whether the expiration time property can be changed for the kind and current state of the object."
      },
      "isInline":  {"type": "boolean",
         "description": "States whether the task is an inline task."
      },
      "isNameUpdateable": {"type": "boolean",
         "description": "Signals whether the name property can be changed for the kind and current state of the object."
      },
      "isNamespaceUpdateable": {"type": "boolean",
         "description": "Signals whether the namespace property can be changed for the kind and current state of the object."
      },
      "isParentContextIDUpdateable": {"type": "boolean",
         "description": "Signals whether the parent context ID property can be changed for the kind and current state of the object."
      },
      "isPriorityUpdateable": {"type": "boolean",
         "description": "Signals whether the priority property can be changed for the kind and current state of the object."
      },
      "isRead": {"type": "boolean",
         "description": "States whether the task instance is marked read."
      },
      "isReadUpdateable": {"type": "boolean",
         "description": "Signals whether the isRead property can be changed for the kind and current state of the object."
      },
      "isSupportsClaimIfSuspendedUpdateable": {"type": "boolean",
         "description": "Signals whether the supports claim suspended property can be changed for the kind and current state of the object."
      },
      "isSupportsDelegationUpdateable": {"type": "boolean",
         "description": "Signals whether the supports delegation property can be changed for the kind and current state of the object."
      },
      "isSupportsFollowOnTasksUpdateable": {"type": "boolean",
         "description": "Signals whether the supports follow on task property can be changed for the kind and current state of the object."
      },
      "isSupportsSubTasksUpdateable": {"type": "boolean",
         "description": "Signals whether the supports sub task property can be changed for the kind and current state of the object."
      },
      "isSuspended": {"type": "boolean",
         "description": "States whether the task instance is suspended."
      },
      "isTransferredToWorkBasket": {"type": "boolean",
         "description": "States whether the task instance had been transferred to some work basket."
      },
      "isTypeUpdateable": {"type": "boolean",
         "description": "Signals whether the type property can be changed for the kind and current state of the object."
      },
      "isWaitingForSubTask": {"type": "boolean",
         "description": "States whether the task is waiting for the completion of a subtask."
      },
      "isWorkBasketNameUpdateable": {"type": "boolean",
         "description": "Signals whether the work basket property can be changed for the kind and current state of the object."
      },
      "jndiNameOfCalendar": {"type": "string",
         "description": "JNDI name of a user-defined calendar."
      },
      "jndiNameOfStaffPluginProvider": {"type": "string",
         "description": "JNDI name of a user-defined people directory configuation."
      },
      "kind": {"type": "string",
         "description": "Kind of the task."
      },
      "lastModificationTime":{"type": "string", "format": "date-time",
         "description": "Last time a property of the task instance changed."
      },
      "lastStateChangeTime": {"type": "string", "format": "date-time",
         "description": "Last time the state of the task instance changed."
      },
      "name": {"type": "string",
         "description": "Name of the task instance."
      },
      "namespace": {"type": "string",
         "description": "Namespace that categorizes the task instance."
      },
      "originator": {"type": "string",
         "description": "ID of the user that created the task instance or on whose behalf the task instance was created."
      },
      "outputMessageTypeName": {"type": "string",
         "description": "Name of the output message type. The value has the format {namespace}localname."
      },
      "owner": {"type": "string",
         "description": "Owner of the task instance."
      },
      "parentContextID": {"type": "string",
         "description": "ID of the parent context of the task instance."
      },
      "positionInHierarchy": {"type": "string", 
         "description": "Position in a possible task instance hierarchy.",
         "enum":
         [
            "HIERARCHY_POSITION_FOLLOW_ON_TASK",
            "HIERARCHY_POSITION_SUB_TASK",
            "HIERARCHY_POSITION_TOP_TASK"
         ]
      },
      "priority": {"type": "integer",
         "description": "Priority of the task instance."
      },
      "resumptionTime": {"type": "string", "format": "date-time",
         "description": "Resumption time of the task instance if the task instance is suspended and is to be resumed automatically."
      },
      "roles": {"type": ["string"],
         "description": "Roles of the current user."
      },
      "starter": {"type": "string",
         "description": "Starter of the task instance."
      },
      "startTime":  {"type": "string", "format": "date-time",
         "description": "Time when the task was claimed or when an invocation task enters the running state."
      },
      "state": {"type": "string", 
         "description": "State of the task instance.",
         "enum":
         [
            "STATE_CLAIMED", 
            "STATE_EXPIRED", 
            "STATE_FAILED", 
            "STATE_FINISHED", 
            "STATE_FORWARDED", 
            "STATE_INACTIVE", 
            "STATE_READY", 
            "STATE_RUNNING", 
            "STATE_TERMINATED"
         ]
      },
      "substitutionPolicy": {"type": "string",
         "description": "Substitution policy that takes place when people assignments are performed."
      },
      "supportsAutomaticClaim": {"type": "boolean",
         "description": "States whether the task is claimed automatically when it becomes ready."
      },
      "supportsClaimIfSuspended": {"type": "boolean",
         "description": "States whether the task can be claimed even if it is suspended."
      },
      "supportsDelegation": {"type": "boolean",
         "description": "States whether the task supports delegation, for example, by transferring work items."
      },
      "supportsFollowOnTasks": {"type": "boolean",
         "description": "States whether the task supports the creation of follow-on tasks."
      },
      "supportsSubTasks": {"type": "boolean",
         "description": "States whether the task supports the creation of subtasks."
      },
      "taskTemplateID": {"type": "string",
         "description": "ID of the task template this instance is derived from."
      },
      "taskTemplateName": {"type": "string",
         "description": "Name of the task template this instance is derived from."
      },
      "tkiid": {"type": "string",
         "description": "Task instance ID."
      },
      "topLevelTaskID": {"type": "string",
         "description": "ID of the topmost task instance in a hierarchy of tasks."
      },
      "type": {"type": "string",
         "description": "Type of the task."
      },
      "workBasketName": {"type": "string",
         "description": "The name of the work basket the task belongs to."
      }
   }
}

MIME Type: application/xml

2. The human task output is returned if the task is an invocation task, the mode parameter is set to sync, and the task returned with output. The XML Schema for the task output, that is, the XML Schema type/element used for the WSDL message part definition, is defined as part of the custom task template definition.

MIME Type: application/xml

3. The human task fault is returned if the task is an invocation task, the mode parameter is set to sync, and the task returned with a fault. An XML wrapper element is returned containing the WSDL fault name and the fault data. The XML Schema for the task fault data, that is, the XML Schema type/element used for the WSDL message part definition, is defined as part of the custom task template definition. Data defined by an XML Schema simple type is wrapped in an XML element provided by this REST interface (see Simple-Typed Data).


+ View Schema
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.ibm.com/xmlns/prod/websphere/bpm/rest/htm/v1/taskFault" 
   xmlns="http://www.ibm.com/xmlns/prod/websphere/bpm/rest/htm/v1/taskFault" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
   elementFormDefault="qualified" 
   attributeFormDefault="unqualified">
   <!--
      Task Fault
   -->
   <xsd:element name="taskFault" type="tTaskFault"/>
   <xsd:complexType name="tTaskFault">
      <xsd:sequence>
         <xsd:element name="faultName" type="xsd:QName"/>
         <xsd:element name="faultData" type="xsd:anyType" nillable="true"/>
      </xsd:sequence>
   </xsd:complexType>
</xsd:schema>

MIME Type: application/json

2.+3. The JSON Schema can be derived from the XML Schema type/element definition (see [JSON Format]).

Error Response Content

Detailed error information.

The default content-type is application/json.

MIME Type: application/json


+ View Schema
{  "description": "Error Response", 
   "type": "object",
   "properties":
   {  "errorNumber": {"type": "string",
         "description": "Message ID of the exception."
      },
      "errorMessage": {"type": "string",
         "description": "Message text of the exception."
      },
      "errorMessageParameters": {"type": ["string"], "optional": true,
         "description":"Message text parameters of the exception."
      },
      "programmersDetails": {"type": "object", "optional": true,
         "description":"Additional, exception details, for example, a stack trace."
      }
   }
} 

Status codes

The method returns one of the following status codes:
CodeDescription
200 OK
Successful completion (if mode is set to sync).
201 Created
Successful completion (if mode is set to createOnly or async).
400 Bad RequestThe parameters are not valid or they are missing.
401 UnauthorizedThe caller is not authorized for this request.
404 Not Found
The task template, the parent task, or a dependent resource does not exist.
406 Not AcceptableThe requested content type or content encoding is not supported.
409 Conflict
The specified task template might be in a stopped state. If this is a request for creating a subtask, the parent task might not be in the claimed state.
415 Unsupported Media TypeThe content type or content encoding of the request is not supported.
500 Internal Server ErrorA severe problem has occurred. Programmer's details are provided.

Change history

The following changes have been applied to this method:
ReleaseDescription
6.2
The returned human task details object contains new properties:
  • "binaryCustomPropertiesMetadata"
  • "deletionTime"
  • "isChild"
7.0
The returned human task details object contains new properties:
  • "assignmentType"
  • "inheritedAuthorization"
  • "invokedInstanceID"
  • "invokedInstanceType"
  • "isBusinessRelevanceUpdateable"
  • "isContextAuthorizationOfOwnerUpdateable"
  • "isDeletionTimeUpdateable"
  • "isDescriptionUpdateable"
  • "isDisplayNameUpdateable"
  • "isDueTimeUpdateable"
  • "isDurationUntilDeletedUpdateable"
  • "isDurationUntilDueUpdateable"
  • "isDurationUntilExpiresUpdateable"
  • "isEscalatedUpdateable"
  • "isEventHandlerNameUpdateable"
  • "isExpirationTimeUpdateable"
  • "isNameUpdateable"
  • "isNamespaceUpdateable"
  • "isParentContextIDUpdateable"
  • "isPriorityUpdateable"
  • "isRead"
  • "isReadUpdateable"
  • "isSupportsClaimIfSuspendedUpdateable"
  • "isSupportsDelegationUpdateable"
  • "isSupportsFollowOnTasksUpdateable"
  • "isSupportsSubTasksUpdateable"
  • "isTransferredToWorkBasket"
  • "isTypeUpdateable"
  • "isWorkBasketNameUpdateable"
  • "workBasketName"
7.0 Feature Pack
The returned human task details object contains a new property:
  • "clientTypes"
7.5
The returned human task details object contains a new property:
  • "roles"
7.5.1
The returned human task details object contains new properties:
  • "customText1" ... "customText8"

Available since

6.1.2

Parent topic: Task Resource