Skip to main contentCarbon Design System

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 7.6.1.3 so that you can define these as System Actions to be used across all Object Structures.

Implicit variables

Variable nameDescription
requestOslcRequest 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().
requestBodyThe body of the request if one was provided.
httpMethodWhether this was a GET, POST, PUT, etc. Can also be retrieved by calling request.getHttpMethod().
mboThis is the MBO for the main object of the object structure.
mbosetThis is the MboSet for the main object of your object structure.
  1. 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. Action Script Creation

  2. 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.

  3. 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.

Example script

template=request.getQueryParam("template")
if template:
commMbo=mbo.createComm()
commMbo.setValue("TEMPLATEID", template)
commMbo.sendMessage()

Call with a POST request like:

https://myurl.com/maximo/api/os/mxapisr/_U1IvMTA2Nw--?lean=1&action=SENDCOMM&template=1014

Note: Be sure to utilize the x-method-override header of PATCH when acting on an existing record.