Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

Automation script best practices for dealing with failures creating child objects in a hierarchy

  • 1.  Automation script best practices for dealing with failures creating child objects in a hierarchy

    Posted Wed June 11, 2025 01:41 PM

    I am working on a Maximo automation script that creates multiple related objects, including: PLUSDESTCONTROL, PLUSDESTVERSION, PLUSDSTATION, PLUSDSTNPARAM, PLUSDSTNDETAIL and WORKORDER. There are situations where there might be errors creating the child records in the hierarchy. What are the best practices for dealing with errors and not leaving partial record structures? Is there any kind of transaction boundary that can automatically back out records that are created in the case of an error? Or do I need to add logic to the script to track all the records that are created and deleting them in the script?



    ------------------------------
    Theo Pozzy
    ------------------------------


  • 2.  RE: Automation script best practices for dealing with failures creating child objects in a hierarchy

    Posted Thu June 12, 2025 03:04 PM

    Hi Theo,

    As long as you create the WorkOrder record first and use relationships from the WorkOrder to PlusDEstControl and from PlusDEstControl to PlusDEstVersion, etc., you should be fine as long as you don't save the WorkOrder MBO Set until everything has been added successfully.  If you encounter an error anywhere along the way, don't do a save, just close the WorkOrder MBO Set.

    The save of the WorkOrder MBO Set will also save all lower level records accessed through relationships.

    I don't work too much with Automation scripts but that's how it works in Java and in RulesManager.



    ------------------------------
    Julio Hernandez
    Ergonare, Inc.
    Phoenix AZ
    480-759-9870
    ------------------------------