scripting

Handling workflow from automation script

If you need to handle workflows (start, stop, route, etc.) from an automation script you can use the following two Maximo API classes: WorkFlowService and WFInstance. Here are few examples. The WorkFlowService.initiateWorkflow metod can be used to start a workflow: To stop an active workflow you can use WFInstance.stopWorkflow method: To route a workflow I […]

Set long description from automation script

Today I have discovered a strange behavior when setting long descriptions from an automation script. You know that almost every DESCRIPTION field in Maximo has a corresponding “Long Description” field that is a CLOB attribute that can hold big amounts of text. This is driven by the “Long Description Owner” checkbox in Database Configuration. When […]

Display custom message from automation script

There is a well known technique to display a custom error message from an automation script. It requires to create the custom message in the Messages dialog of Database Configuration application and then to trigger the display of it throwing an exception by setting errorgroup/errorkey or using the service.error method. This technique is well described […]

Script to check if current user is in a Security Group

A typical business case is to prevent editing of some specific fields to a set of organizational roles in Maximo. This is typically achieved by implementing attribute data restriction or conditional UI. However, if you need more control over what field should be readonly and when, you can use an automation script on the INIT […]

Setting multiple fields as readonly with script

Sometimes you may need to allow some users to update only few fields. This may be hard to achieve using conditional UI and conditional expressions. In the following snippet I’m setting all fields as readonly except DESCRIPTION and STATUS if the current user is in MANSUP security group. Attach the script to the Initialize event […]

Custom REST service with Automation Script

The REST APIs have a tight integration with the automation scripts. Automation scripts can be used to develop custom APIs. The following example call describes how automation scripts interact with REST APIs. You can also use automation scripts for implementing custom queries and custom actions. JavaScript language is always the preferred choice for integration scripts […]

Why I hate automation script variables binding

There are two approaches when dealing with Maximo automation scripts input and output variables. Using launch point variables – This method is described in the product’s knowledge center and allows to get/set values from/to the database specifying how to bind the script variables to specific database fields. Using getter/setter methods – This approach uses Maximo […]

Scroll to top