Class: ServiceAPI

ServiceAPI

A ServiceAPI control provides the following configuration properties in Process Designer:
Behavior
Data Retrieval Mode: {All Details | Data Only | Available Actions | None} string
Events
On Load:
Description: This event is triggered when the control is loaded.
Example:
On Request Complete:
Description: This event is triggered when a request is complete.
Example:
On Request Error:
Description: This event is triggered when there is a request error.
Example:

new ServiceAPI()

This constructor is never used explicitly.

Extends

  • com.ibm.bpm.coach.CoachView

Methods

Returns the data
Name Type Description
asList boolean whether or not to return the data as a list

getLastAction(){string}

Gets the last type of request made
Returns:
Type Description
string

getResult(){Array.<string>}

Returns results from last executed query
Returns:
Type Description
Array.<string>

getType(){string}

Returns the type of the control
Returns:
Type Description
string

queryExposedServices(subTypes)

Get a list of exposed services. Results are stored in control and can be accessed through getResult.
Name Type Description
subTypes string | Array.<string> subtypes to query in the exposed services

queryRunningServices()

Searches for all the available running services. Results are stored in control and can be accessed through getResult.

requestData(svcInstanceId, fields)

Programmatically making a data request call. Results are stored in control and can be accessed through getResult.
Name Type Description
svcInstanceId string the service instance Id
fields string | Array.<string> a list of fields to retrieve

setData(svcInstanceId, data)

Sets the data for the control
Name Type Description
svcInstanceId string the service instance Id
data Array.<string> a list of data to insert

start(svcModelId, params, snapshotId, parts, createTask, taskId)

Programmatically start the service. Results of start are stored in control and can be accessed through getResult.
Name Type Default Description
svcModelId string
params Array.<string> optional JSON formatted string with input parameter settings.
snapshotId string optional Id of the snapshot to use. Default is tip of the default track.
parts string "all" optional Indicates which parts of the response data should be returned. Valid values are "data", "all", or "none".
createTask boolean false optional Flag whether or not corresponding task thould be created when starting service.
taskId string optional Id of existing task to associate with service.

stop(svcInstanceId)

Programmatically stops the service
Name Type Description
svcInstanceId string the service instance id