PUT /rest/bpm/wle/v1/service/{instanceId}?action={string}[&field={string}][&value={string}][¶ms={string}][&failureMode={string}]
POST /rest/bpm/wle/v1/service/{instanceId}?action={string}[&field={string}][&value={string}][¶ms={string}][&failureMode={string}]
instanceId
parameter should be specified as the service instance identifier, which is the value that is returned as the key
element
within the ServiceRunModel
response when a service is started. The key is either a task identifier (numeric) or a service instance identifier (@numeric).field
and value
parameters, or you can set multiple
variables by using the params
parameter.Note: You must specify either the field
and value
parameters or the params
parameter.
Name | Value Type | Description | ||||
---|---|---|---|---|---|---|
action | string | A string indicating the action to be taken on the service.
|
Name | Value Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
field | string |
The name of the variable to be set.
|
||||||||
value | string |
A string containing a JSON expression that represents the value to be assigned to the variable.
Examples: ..../v1/service/<instanceId>?action=setData&field=orderNumber&value=5 ..../v1/service/<instanceId>?action=setData&field=customerName&value={"firstName":"John","lastName":"Doe"} |
||||||||
params | string |
A string containing a JSON expression that contains one or more variable settings.
Each of the variables is set in the context of the running service.
Example: ..../v1/service/<instanceId>?action=setData¶ms={"orderNumber":"5","customerName":{"firstName":"John","lastName":"Doe"}} |
||||||||
failureMode | string | A string that represents how variable-related failures should be handled.
|
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 your query parameters to the HTTP request body and avoid request URI length restrictions.
Example:
POST http://myhost.mycompany.com:9080/rest/bpm/wle/v1/service/17 HTTP Headers: Content-Type: application/x-www-form-urlencoded X-Method-Override: PUT Accept: application/json HTTP Request Body: action=setData¶ms={"orderNumber":"5","customerName":{"firstName":"John","lastName":"Doe"}}
The default content type is application/json.
{ "description": "WLE Service Result", "type": "object", "properties": { "result": {"type": "[string]", "description": "The string representation of the JSON object which represents the result obtained from evaluating a javascript expression within the context of a currently running service." } "resultMap": {"type": "[object]", "description": "The JSON object which represents the result obtained from evaluating a javascript expression within the context of a currently running service." } } }
{ "status":"200", "data":{ "result": "{\"stringParam1\":\"stringValue1\",\"listBo1\":{\"selected\": [], \"items\": [{\"parameter1\":\"value1\",\"parameter2\":\"value2\",\"@metadata\":{\"objectID\":\"21a84356-c481-47c7-8d05-e7758aa8ecc9\",\"dirty\":false,\"invalid\":false,\"shared\":false,\"rootVersionContextID\":\"2064.e826064b-fe5e-4944-b3f5-f0ad575e910cT\",\"className\":\"listBO\"}}],\"@metadata\":{\"objectID\":\"afe3f5c0-cfaf-4303-ace9-fbfee5bd2d29\",\"dirty\":false,\"invalid\":false,\"shared\":false}}}", "resultMap": { "stringParam1":"stringValue1", "listBo1": { "selected": [], "items": [ { "parameter1": "value1", "parameter2": "value2", "@metadata": { "objectID": "21a84356-c481-47c7-8d05-e7758aa8ecc9", "dirty": false, "invalid": false, "shared": false, "rootVersionContextID": "2064.e826064b-fe5e-4944-b3f5-f0ad575e910cT", "className": "listBO" } } ], "@metadata": { "objectID": "afe3f5c0-cfaf-4303-ace9-fbfee5bd2d29", "dirty": false, "invalid": false, "shared": false } } } } }
<?xml version="1.0" encoding="UTF-8"?> <schema targetNamespace="http://rest.bpm.ibm.com/v1/data/service" elementFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://rest.bpm.ibm.com/v1/data/service" xmlns:pref="http://rest.bpm.ibm.com/v1/data/root" xmlns:cmn="http://rest.bpm.ibm.com/v1/data/common"> <import schemaLocation="Common.xsd" namespace="http://rest.bpm.ibm.com/v1/data/common"/> <import schemaLocation="BPMRestData.xsd" namespace="http://rest.bpm.ibm.com/v1/data/root"/> <!-- This type represents a service model. --> <complexType name="ServiceModel"> <complexContent> <extension base="pref:Data"> <sequence> <!-- This field corresponds to the "header" part of the service model --> <element name="header" type="tns:Header"/> <!-- This field corresponds to the "diagram" part of the service model --> <element name="diagram" type="tns:Diagram"/> <!-- This field corresponds to the "dataModel" part of the service model --> <element name="dataModel" type="tns:DataModel"/> </sequence> </extension> </complexContent> </complexType> <complexType name="Header"> <sequence> <!-- The unique ID of the service --> <element name="UUID" type="string" /> <!-- The type of the service --> <element name="type" type="string" /> <!-- The name of the service --> <element name="name" type="string" /> <!-- The description of the service --> <element name="description" type="string" /> <element name="richDescription" type="string" /> <!-- The snapshot ID of the service --> <element name="snapshotId" type="string" /> <!-- Warning --> <element name="warning" type="string" /> <!-- not used --> <element name="startTaskURL" type="string" /> <!-- not used --> <element name="startServiceURL" type="string" /> </sequence> </complexType> <complexType name="Diagram"> <sequence> <!-- The list of steps associated with the service --> <element name="step" type="tns:ServiceStep" minOccurs="0" maxOccurs="unbounded" /> </sequence> </complexType> <complexType name="DataModel"> <sequence> <!-- The variables (properties) associated with the service The key is the name of the property. The value containing a description of the property: * type (name of the type) * isList * description * richDescription --> <element name="properties" type="cmn:Map" /> <!-- The input variables associated with the service The key is the name of the variable. The value containing a description of the parameter: * type (name of the type) * isList * description * richDescription --> <element name="inputs" type="cmn:Map" /> <!-- The output variables associated with the service The key is the name of the variable. TThe value containing a description of the parameter: * type (name of the type) * isList * description * richDescription --> <element name="outputs" type="cmn:Map" /> <!-- Detailed information about the types referenced by the service. Each type referenced above and nested types are described. The key is the name of the type. The value is an map of information about the type Here are some of the fields: * ID, pattern, properties, isShared, options, min, max, description, fixedLength --> <!-- A structure explaining the data model of the service --> <element name="validation" type="cmn:Map" /> </sequence> </complexType> <!-- This type represents a step associated with a service. --> <complexType name="ServiceStep"> <sequence> <!-- The step ID --> <element name="ID" type="string" /> <!-- The step name --> <element name="name" type="string" /> <!-- The X, Y coordinate of the center point of the step within the diagram --> <element name="x" type="int" /> <element name="y" type="int" /> <!-- The step type --> <element name="type" type="string" /> <!-- Web Service Integration Data --> <element name="data" type="tns:WSIntegrationData" /> <!-- The set of lines extending out from this step within the diagram --> <element name="lines" type="tns:ServiceStepLines" /> </sequence> </complexType> <!-- This type represents webservices integration data --> <complexType name="WSIntegrationData"> <sequence> <element name="wsdlURI" type="string" /> <element name="serviceName" type="string" /> <element name="portName" type="string" /> <element name="operationName" type="string" /> <element name="isProtectedWSDL" type="boolean" /> <element name="isOverrideEndpointAddress" type="boolean" /> <element name="endpointAddressURL" type="string" /> </sequence> </complexType> <!-- This type represents a set of lines associated with a service step --> <complexType name="ServiceStepLines"> <sequence> <element name="stepLine" minOccurs="0" maxOccurs="unbounded" type="tns:ServiceStepLine" /> </sequence> </complexType> <!-- This type represents a single line associated with a service step --> <complexType name="ServiceStepLine"> <sequence> <!-- The ID of the step to which this line extends --> <element name="to" type="string" /> <!-- A string containing a comma-separated list of coordinates through which this line extends. The list of points must contain the first point (coordinate of the "fromPort") and the last point (coordinate of the "toPort"). --> <element name="points" type="string" /> </sequence> </complexType> <!-- This type contains information related to a running service --> <complexType name="ServiceRunModel"> <complexContent> <extension base="pref:Data"> <sequence> <!-- The status of the service; values: "end", "running", "coach", "error", "debug" --> <element name="serviceStatus" type="string" /> <!-- The ID of the running service or task instance. This is the ID to be used when resuming the service or task. --> <element name="key" type="string" /> <!-- The ID of the current step within the context of the running service --> <element name="step" type="string" /> <!-- The flag to determine if it was reset back to a certain step --> <element name="reset" type="boolean" /> <!-- The unique ID of the current step within the context of the running service --> <element name="stepId" type="string" /> <!-- The ID of the PO that implements the step --> <element name="poId" type="string" /> <!-- The ID of the processItem of the step --> <element name="processItemId" type="string" /> <!-- The data (symbol table) associated with the running service --> <element name="data" type="anyType" /> <!-- If the service status is "coach", this field contains the coach XML data --> <element name="coach" type="string" /> <!-- If the service status is "coach", this field contains a Map of evaluated coach values --> <element name="coachEvals" type="cmn:Map" /> <!-- If the service status is "coach", this field contains a list of available actions (end point) --> <element name="actions" type="string" minOccurs="0" maxOccurs="unbounded" /> <!-- If the service status is "coach", this field contains a map of actions and associated labels --> <element name="actionsMap" type="cmn:Map" /> </sequence> </extension> </complexContent> </complexType> <complexType name="CoachEval"> <sequence> <element name="ID" type="string" /> <element name="value" type="string" /> </sequence> </complexType> <!-- This type represents a list of currently running services --> <complexType name="CurrentlyRunning"> <complexContent> <extension base="pref:Data"> <sequence> <!-- A list of keys of services that are currently running for the current user --> <element name="instanceIDs" type="string" minOccurs="0" maxOccurs="unbounded" /> </sequence> </extension> </complexContent> </complexType> <!-- This type represents the result obtained from evaluating a javascript expression within the context of a currently running service --> <complexType name="Result"> <complexContent> <extension base="pref:Data"> <sequence> <element name="result" type="string" minOccurs="0" maxOccurs="1" /> <!-- Data information stored in an actual Map --> <element name="resultMap" type="cmn:Map" minOccurs="0"/> </sequence> </extension> </complexContent> </complexType> </schema>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bpm:ResponseData xmlns:bpm='http://rest.bpm.ibm.com/v1/data'> <status>200</status> <data xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:svc='http://rest.bpm.ibm.com/v1/data/service' xsi:type='svc:Result'> <result>"100"</result> </data> </bpm:ResponseData>
The default content type is application/json.
{ "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." } } }
<?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> <element name="errorData" type="tns:ErrorData" minOccurs="0" /> </sequence> </complexType> <complexType name="ErrorData"> <sequence> <element name="code" type="string" /> <element name="data" type="string" minOccurs="0" /> </sequence> </complexType> </schema>
Code | Description |
---|---|
200 OK | Success completion. |
400 Bad Request | The parameters are not valid or they are missing. |
401 Unauthorized | The caller is not authorized for this request. |
404 Not Found | The service does not exist.
|
406 Not Acceptable | The requested content type or content encoding is not supported. |
500 Internal Server Error | A severe problem has occurred, programmer's details are provided. |
7.5.0
Parent Topic: Service Resource