Execute process
Executes a process in the specified mode (synchronous or asynchronous).
This topic includes the following sections:
Request
HTTP method: POST
URL: https://<hostname>:<port>/baocdp/rest/process/<process_name>/execute
In the URL <process_name> represents the process to execute.
Note
If the <process_name>
contains spaces or any special characters, ensure that you encode the URL and then run the API call.
While encoding, a colon can be replaced by %3A and a space is replaced by a %20. For example, if you want to execute the Read File process, your URL is:
https://<hostname>:<port>/baocdp/rest/process/Read%20File/execute
Header: See HTTP request and response headers for header information, such as required authentication token.
Request parameters
Parameter | Type | Required | Description | Values | Default value |
---|---|---|---|---|---|
mode | String | Mode in which to execute the process mode=<mode> | sync, async | sync |
Request body properties
Property | Description |
---|---|
inputParameters | List of input parameters accepted by the process |
name | Input parameter name |
value | Input parameter value Note When providing values containing double quotes, escape the double quotes with backslashes. |
type (optional) | Type of parameter Example, XML |
Example request JSON
{
"inputParameters": [
{
"name": "adapter name",
"value": "HTTP Adapter"
},
{
"name": "url",
"value": "http://www.google.com"
}
]
}
Example request JSON with input as XML with double quotes in the value
{
"inputParameters":
[
{
"name": "param1",
"value": "p1"
},
{
"name": "param2",
"value": "<parent><child>Text data containing \" - double-quotes</child></parent>",
"type": "xml"
}
{
"name": "param3",
"value": "<parent><child attr1=\"aValue\">XML node has an attribute and text data containing \" - double-quotes</child></parent>",
"type": "xml"
}
]
}
Example request JSON with input as string with double quotes
{
"inputParameters":[
{
"name":"param1",
"value":"p1"
},
{
"name":"param2",
"value":"String with \"- double-quotes"
}]
}
Example request JSON with input parameter type is XML with attributes and/or text containing double-quotes
{
"inputParameters": [
{
"name": "param1",
"value": "p1"
},
{
"name": "param2",
"value": "Text data containing \" - double-quotes",
"type": "xml"
},
{
"name": "param3",
"value": "<node1>has \" double quotes</node1></node1>",
"type": "xml"
}
]
}
Response
If successful, this method executes the specified process in the specified mode.
Response body properties
Property | Description |
---|---|
processName | Process name |
jobId | ID of the process job |
Example response JSON
{
processName: ":AutoPilot-AD-Utilities:HTTP:Get"
jobId: "d0f120d29f779a9a:7e39082a:14c80109a76:-7ff81-1428327672246"
}
Status codes and messages
For more details about HTTP response codes, see HTTP response codes.
HTTP code | Message | Description |
---|---|---|
200 | OK | Request succeeded |
401 | Unauthorized | |
405 | Method not allowed |
Video demonstration
The following BMC Communities video (7:30) is part one of a two-part series on using REST to execute workflows. This video demonstrates how to log into an API server, generate an authentication code, and use the code to get process details, execute a workflow (process), retrieve a list of active modules, and get a job's status.
The second part of the video demonstrates how to use the HTTP adapter to perform the same tasks and is available here and in the Content online documentation for the HTTP adapter example section.
Related topics
Execute process synchronously example
Execute process asynchronously example
Comments
Log in or register to comment.