IBM Support

Maximo Cleanup Work Order and Ticket MBO

Technical Blog Post


Abstract

Maximo Cleanup Work Order and Ticket MBO

Body

Maximo Cleanup Work Order and Ticket MBO

IBM Maximo automation scripts (Jython) to cleanup MBOs such as Work Order and Ticket

 

Disclaimer

The script and steps are provided as is and use it at own risk. It is not recommended for production environment, please use maximo archiving product instead.

 

Background

Certain maximo MBOs do not allow deletion after activities have been committed to the record such as change of status, applied workflow, and communication log This behaviour is expected in production environment. However, at development and test environment, maximo designer may need to delete records after test activities. This library has some scripts that may help the record deletion after testing.

 

Prepare Cleanup for Communication Log

1. Create Script with Action Launch Point:

    Launch Point: CLEANUPCOMMLOG
    Description: Cleanup Communication Log
    Object: COMMLOG
    Action: CLEANUPCOMMLOG
    Action Description: Cleanup Communication Log
    Active: Ticked
    Script: New

image


Continue with the next dialog for New Script Details:

    Script: CLEANUPGENERIC
    Script Description: Generic Cleanup Script
    Script Language: jython
    Source Code: import or copy the script from cleanupgeneric.py available in attachment Cleanup.zipView Details

image image
2. Create Action Group:

    Action: CLEANUPCOMMLOG_GRP
    Action Description: Cleanup Communication Log - Group
    Type: Action Group
    Members: CLEANUPCOMMLOG

image
3. Create Escalation:

    Escalation: CLEANUPCOMMLOG
    Description: Cleanup Communication Log
    Schedule: Adjust as needed
    Condition: type the 'where clause' condition as needed.

Add one (1) escalation point with Action Group: CLEANUPCOMMLOG_GRP
(Optional) Tick Repeat box as needed

Important:

    Ensure the condition only select the records that you intend to delete!
    Deactivate the escalation when it is not being used

image


Prepare Cleanup for Workflow Instance

1. Create Script with Action Launch Point:

    Launch Point: CLEANUPWFINSTANCE
    Description: Cleanup Workflow Instance
    Object: COMMLOG
    Action: CLEANUPWFINSTANCE
    Action Description: Cleanup Workflow Instance
    Active: Ticked
    Script: Existing (share existing script previously created for CLEANUPCOMMLOG)
    Script: browse and select CLEANUPGENERIC

image image image
2. Create Action Group:

    Action: CLEANUPWFINSTANCE_GRP
    Action Description: Cleanup Workflow Instance - Group
    Type: Action Group
    Members: CLEANUPWFINSTANCE

image
3. Create Escalation:

    Escalation: CLEANUPWFINSTANCE
    Description: Cleanup Workflow Instance
    Schedule: Adjust as needed
    Condition: type the 'where clause' condition as needed.

Add one (1) escalation point with Action Group: CLEANUPWFINSTANCE_GRP
(Optional) Tick Repeat box as needed

Important:

    Ensure the condition only select the records that you intend to delete!
    Deactivate the escalation when it is not being used

image


Prepare Cleanup for Work Order

1. Create Script with Action Launch Point for Work Order:

    Launch Point: CLEANUPWORKORDER
    Description: Cleanup WorkOrder
    Object: WORKORDER
    Action: CLEANUPWORKORDER
    Action Description: Cleanup WorkOrder
    Active: Ticked
    Script: New

image


Continue with the next dialog for New Script Details:

    Script: CLEANUPWORKORDER
    Script Description: WorkOrder Cleanup Script
    Script Language: jython
    Source Code: import or copy the script from cleanupworkorder.py available in attachment Cleanup.zipView Details

image image
2. Create Action Group:

    Action: CLEANUPWORKORDER_GRP
    Action Description: Cleanup WorkOrder - Group
    Type: Action Group
    Members: CLEANUPWORKORDER

image
3. Create Escalation:

    Escalation: CLEANUPWORKORDER
    Description: Cleanup WorkOrder
    Schedule: Adjust as needed
    Condition: type the 'where clause' condition as needed.

Add one (1) escalation point with Action Group: CLEANUPWORKORDER_GRP
(Optional) Tick Repeat box as needed

Important:

    Ensure the condition only select the records that you intend to delete!
    Deactivate the escalation when it is not being used

image


Prepare Cleanup for Ticket

1. Create Script with Action Launch Point for Ticket:

    Launch Point: CLEANUPTICKET
    Description: Cleanup Ticket
    Object: TICKET
    Action: CLEANUPTICKET
    Action Description: Cleanup Ticket
    Active: Ticked
    Script: New

image
Continue with the next dialog for New Script Details:

    Script: CLEANUPTICKET
    Script Description: Ticket Cleanup Script
    Script Language: jython
    Source Code: import or copy the script from cleanupticket.py available in attachment Cleanup.zipView Details

image image
2. Create Action Group:

    Action: CLEANUPTICKET_GRP
    Action Description: Cleanup Ticket - Group
    Type: Action Group
    Members: CLEANUPTICKET

image
3. Create Escalation:

    Escalation: CLEANUPTICKET
    Description: Cleanup Ticket
    Schedule: Adjust as needed
    Condition: type the 'where clause' condition as needed.

Add one (1) escalation point with Action Group: CLEANUPTICKET_GRP
(Optional) Tick Repeat box as needed

Important:

    Ensure the condition only select the records that you intend to delete!
    Deactivate the escalation when it is not being used

image


Sample Usage:

1. Cleanup WorkOrder #1234:

    a. Update Condition of CLEANUPCOMMLOG Escalation:
    ownerid in (select workorderid from workorder where wonum='1234' and woclass='WORKORDER') and ownertable='WORKORDER'

    b. Update Condition of CLEANUPWFINSTANCE Escalation:
    ownerid in (select workorderid from workorder where wonum='1234' and woclass='WORKORDER') and ownertable='WORKORDER'

    c. Update Condition of CLEANUPWORKORDER Escalation:
    wonum='1234' AND woclass='WORKORDER'

    d. Activate the Escalations: CLEANUPCOMMLOG, CLEANUPWFINSTANCE, CLEANUPWORKORDER

    e. Verify the result and Deactivate the Escalations: CLEANUPCOMMLOG, CLEANUPWFINSTANCE, CLEANUPWORKORDER

 

2. Cleanup Service Request (SR) Ticket that has CLOSED status:

    a. Update Condition of CLEANUPCOMMLOG Escalation:
    ownerid in (select ticketuid from ticket where status='CLOSED' and class='SR') and ownertable='SR'

    b. Update Condition of CLEANUPWFINSTANCE Escalation:
    ownerid in (select ticketuid from ticket where status='CLOSED' and class='SR') and ownertable='SR'

    c. Update Condition of CLEANUPTICKET Escalation:
    status='CLOSED' and class='SR'

    d. Activate the Escalations: CLEANUPCOMMLOG, CLEANUPWFINSTANCE, CLEANUPTICKET

    e. Verify the result and Deactivate the Escalations: CLEANUPCOMMLOG, CLEANUPWFINSTANCE, CLEANUPTICKET

 

[{"Business Unit":{"code":"BU005","label":"IoT"}, "Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm11130193