Maximo

Maximo

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

 View Only

Example - Checking Reservations against WO Lead Time 

Wed March 18, 2020 09:33 AM

Object Launch point

Example Object Description
Checking reservations outside lead time for a work order WORKORDER

Requirement: COMP status on Storeroom Material Status field of Work Order Tracking does not provide complete information.

In the Work Order Tracking application, Storeroom Material Status is set to COMP ('complete') even when work order's reservation required dates are outside the item / store room's lead time. COMP status is also set when all reservations are within the lead time and have sufficient quantity available.

Solution: Implement a business rule using Object Launch point that provides specific indication on the Work Order Tracking application that a work order's reservation required dates are outside the item's lead time.


Problem Statement

Work Order Tracking, Storeroom Material Status, is set to COMP when the work order s reservation required dates are outside the item/storerooms lead time

This same status is used when all reservations are within the lead time and have sufficient quantity available. The reuse of the COMP status gives incomplete information to the Work Order user.

 

Solution

Implement a rule that provides a specific indication on the Work Order application user interface when work order’s reservation required dates are outside the items lead time

Functional Approach

The reservation type of APHARD and APSOFT are used as proxies to represent an “outside the item lead time” condition. Specifically, if a reservation for an item has been already marked APSOFT by Maximo, that is directly the result of a date calculation out of the box and determination that required date/time are outside the lead time. Checking for a reservation that has been designated APSOFT is sufficient to resolve this issue.

Technical Approach

Implement an Object Launch point and automation script that checks for “APSOFT” reservation type on any reservation associated with the given work order. If at least one “APSOFT” reservation type is found, set a flag (Outside Lead Time flag) in the Work Order user interface (main tab).

APIs used: None

Script code in the form of a PY file (wootl.py) is attached to this article here.

PDF version of this article is attached here.

 

Implementation Details

  1. Add to the WORKORDER MBO a new persistent YORN attribute called OTL. This attribute is set whenever there’s at least one reservation for a work order with required date/time outside item lead time. Configure the database.

  1. Add a field to the WOTRACK presentation and associate the OTL attribute to this field. Ensure the field is read-only.

  1. Create an Object Launch point on the WORKORDER object. No conditions are associated with the launch point. I enabled the launch point for both Add and Update events on work order.

  1. Define several variables and bindings for this Object Launch point.

Variable

Type

Binding

Remarks

v_mtlstatus

IN

STOREROOMMTLSTATUS

Script will run only if STOREROOMMTLSTATUS is being set by Maximo

v_otl

OUT

OTL

Script will set this YORN attribute if it finds at least one APSOFT reservation type for the work order being approved

v_reservations

IN

INVRESERVE.restype*

From work order directly access the INVRESERVE table and pull up an array of reservation type values

v_wostatus

IN

STATUS

Since the script should be executed as the work order is being approved, need to check if the status of work order is being set to APPR

  1. Author the script code (SAMPLE SCRIPT, NOT FOR PRODUCTION USE):

Script Logic

  1. Script checks if work order is being approved (line 2).
  2. Script checks if STOREROOMMTLSTATUS is being set by Maximo (line 4)
  3. Script retrieves reservations array items with a loop (line 8)
  4. Script checks if there’s at least one reservation type of APSOFT (line 9)
  5. If reservation type APSOFT is found, script sets the OTL field and exits the loop (lines 11 and 12)

Scripting Notes

I assumed that I can safely traverse the INVRESERVE relationship from WORKORDER directly to INVRESERVE and examine the reservation types. This code can get more fancy in terms of checks and displaying more data to the user or throwing error message and preventing the status change from happening. Before the script code runs a lot of the existing Maximo work order change status logic would have already run including the creation of the inventory reservation records and determination of reservation types.

Scripting execution time: In a development sandbox, with single user, execution time averaged 2-3 milliseconds. There should be no noticeable impact on end users.




#MaximoIntegrationandScripting
#Maximo
#AssetandFacilitiesManagement

Statistics
0 Favorited
30 Views
0 Files
0 Shares
0 Downloads