IBM Business Process Manager, Version 8.5.5

REST interface for BPD-related resources - Bulk Commands Resource - POST (bulk commands) Method

Use this method to run a series of commands. The response contains the data responses for each of the commands that was executed. If an individual command fails, processing is halted. The subsequent commands are not executed. A failing command does not cause a transactional rollback of the prior commands.

Sample method invocation

POST /rest/bpm/wle/v1/bulk?command={string}

Alternative Method Invocation

POST /rest/bpm/wle/v1/bulk?command={string}

Parameters

Required parameters
NameValue TypeDescription
command string
An expression of the form <method>:<api> where <method> is "PUT","POST","GET" or "DELETE", and <api> is the path and query string describing a single command. For example, GET:/rest/bpm/wle/v1/task/123 is a command to retrieve the details for task 123.

Multiple command parameters can be specified. Each command is executed in the specified order.

Note that the you should encode & delimitters within the command values.

Request content

MIME type: application/x-www-form-urlencoded

Use this mime-type in situations where the length of the query string might cause the request URI to exceed the maximum length supported by the browser or HTTP client environment. With this mime-type, you can move all of your query parameters to the HTTP request body and avoid request URI length restrictions.

Here is an example request to get the details for task 3 and delete task 3.

   POST  http://myhost.mycompany.com:9080/rest/bpm/wle/v1/bulk

   HTTP Headers:
      Content-Type: application/x-www-form-urlencoded

   HTTP Request Body:
      command=GET:/rest/bpm/wle/v1/task/3&command=PUT:/rest/bpm/wle/v1/task/3?action=cancel

Response content

Detailed response for each executed command.

The default content type is application/json.

MIME type: application/json


+ View schema
{  "description": "Bulk Command Responses", 
   "type": "object",
   "properties":
   {  
       "total": {"type": "int",
               "description": "The total number of specified commands."
                },
       "success": {"type": "int",
               "description": "The number of executed, successful commands."
               },
       "failingAPI": {"type": "string",
               "description": "If a command fails, the failing api path and query string."  
               },
       "failingMethod": {"type": "string",
               "description": "If a command fails, the name of the failing http method."  
               },
       "responses" :
           [ 
              {
                  "api": {"type", "string",
                           "description": "api path and query string for the successful command"
                         },
                  "method": {"type", "string",
                           "description": "http method of the successful command"
                         },
                  "data": {"type", "object",
                           "description": "The data response of the successful command"
                         }  
              }    
           ]
    }                   
 }           
          
+ View example content
{
	"status":"200",
	"data":{
		"total":2,
		"success":2,
		"failingAPI":null,
		"failingMethod":null,
		"response":[
			{
				"api":"/rest/bpm/wle/v1/task/3",
				"method":"GET",
				"data":{
					"activationTime":"2011-10-18T19:04:03Z",
					"clientTypes":["IBM_WLE_Coach"],
					"completionTime":null,
					"containmentContextID":"3",
					"description":"Task: Submit requisition",
					"displayName":"Task: Submit requisition",
					"dueTime":"2011-10-18T20:04:03Z",
					"kind":"KIND_PARTICIPATING",
					"lastModificationTime":"2011-10-18T19:04:03Z",
					"name":"Submit job requisition",
					"originator":"tw_admin",
					"owner":"tw_admin",
					"priority":30,
					"startTime":"2011-10-18T19:04:03Z",
					"state":"STATE_CLAIMED",
					"tkiid":"3",
					"piid":"3",
					"status":"New",
					"priorityName":"Normal",
					"assignedTo":"tw_admin",
					"assignedToType":"user",
					"data":{},
					"serviceID":"1.551dd543-a770-4d6c-b0e0-1c9d61242e55",
					"flowObjectID":"bpdid:5cd499bd441308ca:37d49876:12e27ee26e3:-67db"
				}
			},{
				"api":"/rest/bpm/wle/v1/task/3?action=cancel",
				"method":"PUT"
			}
		]
	}
}

MIME type: application/xml


+ View schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/root" xmlns:tns="http://rest.bpm.ibm.com/v1/data/root"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema" >
	<complexType name="Data" abstract="true" />

	<complexType name="NamedElement" abstract="true" >
		<complexContent>
		    <extension base="tns:Data">
				<sequence>
				    <element name="name" type="string"/>
				</sequence>
		    </extension>
		</complexContent>
	</complexType>
	
	<complexType name="BulkCommandResponses">
	   <complexContent>
	    <extension base="tns:Data">
		   <sequence>
		      <!-- Total number of commands -->
		      <element name="total" type="int" />
		      
		      <!-- Total number of successful commands -->
		      <element name="success" type="int" />
		      
		      <!-- If a command fails, the remaining commands are are not attempted.
		           This is the failing command api and method
		       -->
		       
		      <element name="failingAPI" type="string" minOccurs='0'/>
		      <element name="failingMethod" type="string" minOccurs='0'/>
		      
		      <!-- Responses for each of the successful commands -->
		      <element name="response" type="tns:BulkCommandResponse" minOccurs="0" maxOccurs="unbounded" />
	       </sequence>
		 </extension>
		</complexContent>
	</complexType>
	
	<complexType name="BulkCommandResponse">
		 <sequence>
		      <!-- API and method for the successful command -->
		      <element name="api" type="string" />
		      <element name="method" type="string" />
		      
		      <!-- Response data from the successful command -->
		      <element name="data" type="tns:Data" />
	     </sequence>
	</complexType>

</schema>
+ View example content
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bpm:ResponseData xmlns:bpm="http://rest.bpm.ibm.com/v1/data" xmlns:ex="http://rest.bpm.ibm.com/v1/data/exception">
	<status>200</status>
	<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:root="http://rest.bpm.ibm.com/v1/data/root" xsi:type="root:BulkCommandResponses">
		<total>2</total>
		<success>2</success>
		<response>
			<api>/rest/bpm/wle/v1/task/3</api>
			<method>GET</method>
			<data xmlns:tsk="http://rest.bpm.ibm.com/v1/data/task" xsi:type="tsk:TaskDetails">
				<activationTime>2011-10-18T19:04:03Z</activationTime>
				<clientTypes>IBM_WLE_Coach</clientTypes>
				<completionTime xsi:nil="true"/>
				<containmentContextID>3</containmentContextID>
				<description>Task: Submit requisition</description>
				<displayName>Task: Submit requisition</displayName>
				<dueTime>2011-10-18T20:04:03Z</dueTime>
				<kind>KIND_PARTICIPATING</kind>
				<lastModificationTime>2011-10-18T19:04:03Z</lastModificationTime>
				<name>Submit job requisition</name>
				<originator>tw_admin</originator>
				<owner>tw_admin</owner>
				<priority>30</priority>
				<startTime>2011-10-18T19:04:03Z</startTime>
				<state>STATE_CLAIMED</state>
				<tkiid>3</tkiid>
				<piid>3</piid>
				<status>New</status>
				<priorityName>Normal</priorityName>
				<assignedTo>tw_admin</assignedTo>
				<assignedToType>user</assignedToType>
				<data/>
				<serviceID>1.551dd543-a770-4d6c-b0e0-1c9d61242e55</serviceID>
				<flowObjectID>bpdid:5cd499bd441308ca:37d49876:12e27ee26e3:-67db</flowObjectID>
			</data>
		</response>
		<response>
			<api>/rest/bpm/wle/v1/task/3?action=cancel</api>
			<method>PUT</method>
		</response>
	</data>
</bpm:ResponseData>

MIME type: application/x-javascript

Error Response content

Detailed error information.

The default content type is application/json.

MIME type: application/json


+ View schema
{  "description": "WLE Error Response", 
   "type": "object",
   "properties":
   {  "status": {"type": "string",
         "description": "The status of the previous API call."
      },
      "exceptionType": {"type": "string",
         "description": "The classname associated with the exception."
      },
      "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."
      }
   }
} 

MIME type: application/xml


+ View schema
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://rest.bpm.ibm.com/v1/data/exception"
	elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:tns="http://rest.bpm.ibm.com/v1/data/exception"
	xmlns:dat="http://rest.bpm.ibm.com/v1/data/root">

    <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root" />
    
    <!--
	This type represents an error response.
    -->    
    <element name="RestRuntimeException">
	<complexType>
	    <sequence>
		<element name="status" type="string"/>
		<element name="Data" type="tns:ExceptionData">
    		</element>
	    </sequence>
	</complexType>
    </element>

    <!-- 
	 This type contains detailed error information associated with an exception.
    -->
    <complexType name="ExceptionData">
	<sequence>
	    <element name="status" type="string"/>

	    <!-- This specifies the java class name of the exception -->
	    <element name="exceptionType" type="string"/>

	    <!-- The message ID of the error message -->
	    <element name="errorNumber" type="string" minOccurs="0"/>

	    <!-- The complete error message -->
	    <element name="errorMessage" type="string"/>

	    <!-- The list of strings inserted into the error message -->
	    <element name="errorMessageParameters" type="string" minOccurs="0" maxOccurs="unbounded"/>

	    <!-- 
		 The stacktrace associated with the exception.
		 Note that this will be omitted unless the "server-stacktrace-enabled" property
		 is enabled in the server's 100Custom.xml file.
	    -->     
	    <element name="programmersDetails" type="string"></element>
	    
	    <!-- Prior responses.  Set if a bulk command was used -->
	    <element name="responses" type="dat:BulkCommandResponses" minOccurs="0"></element>
	</sequence>
    </complexType>
</schema>

MIME type: application/x-javascript

Status codes

The method returns one of the following status codes:
CodeDescription
200 OKSuccess completion.
400 Bad RequestThe parameters are not valid or they are missing.
401 UnauthorizedThe caller is not authorized for this request.
406 Not AcceptableThe requested content type or content encoding is not supported.
500 Internal Server ErrorA severe problem has occurred, programmer's details are provided.

Available since

7.5.1

Parent Topic: Bulk Commands Resource