Object structure action
When you call a custom action on your MBO or MboSet from the REST API, you can define an Object Structure Action. Currently, this is specific to each object structure but will be enhanced in Manage 8.3 or TPAE 184.108.40.206 so that you can define these as System Actions to be used across all Object Structures.
|OslcRequest representation of the request being made. This exposes methods such as request.getQueryParam(“parameter”) and request.getHeader(“header”) to retrieve values provided as a query parameter or header respectively. You can also access the UserInfo by calling request.getUserInfo().
|The body of the request if one was provided.
|Whether this was a GET, POST, PUT, etc. Can also be retrieved by calling request.getHttpMethod().
|This is the MBO for the main object of the object structure.
|This is the MboSet for the main object of your object structure.
In the Automation Script application, create a Script for Integration and choose the Object Structure. Select the radio button for Action Processing and give it a unique name. Provide the script source.
In the Object Structures application, open the Object Structure used in Step 1. From More Actions open the Action Definition dialog and add a new row.
Provide a name and description. It is best to set the Action name to match the script action name, which is SENDCOMM in the example. Set the Implementation Type to Script and select the script created in Step 1. Optionally, select the Collection Action option if your action is intended to be used on the set, which does not require a specific record. Optionally, provide an Option Name if you wish to restrict this to a signature option. You should tie it to the Save permission if it modifies the record.
template=request.getQueryParam("template")if template:commMbo=mbo.createComm()commMbo.setValue("TEMPLATEID", template)commMbo.sendMessage()
Call with a POST request like:
Note: Be sure to utilize the x-method-override header of PATCH when acting on an existing record.