IBM Support

HOWTO: Throwing a Warning Dialog in an Automation Script

Technical Blog Post


Abstract

HOWTO: Throwing a Warning Dialog in an Automation Script

Body

In this brief blog, we'll throw a warning dialog in an Automation Script. We'll be using python.

The script necessary to throw the warning will take the following form:

if some_condition:
    warngroup = "warning_group"
    warnkey = "warning_key"

If there are parameters in the message, you can create a string array with the necessary substitutions, e.g.:

   warnparams = [string1, string2, etc.]

If it's an error dialog you want then use errorgroup, errorkey and params.

As an example, let's make a simple SR object automation script with the following code snippet:

if mbo.getString('ticketid') == "TEST":
    warngroup = "mygroup"
    warnkey = "mykey"
    warnparams = ["dog","cat"]

image

Happy Scripting!

 

 

 

 

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11129815