Maximo

Maximo

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

 View Only
  • 1.  WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Sun December 12, 2021 12:13 AM
    Edited by System Admin Wed March 22, 2023 11:49 AM
    MAM 7.6.1.2:

    I'm planning to add an INVALID status (synonym of CLOSE) to the WOSTATUS domain.
    Purpose: to indicate that a WO should be cancelled, but can't, because of Maximo's restrictions on the CAN status

    The catch:

    I don't want both the CANCEL and INVALID statuses to be available at the same time. It would always be better for the user to choose CANCEL, if possible. The INVALID status is just meant to be a plan B for when CANCEL isn't available.

    Question:

    What condition should I put on INVALID so that it's only available when CANCEL isn't available?
    Note: users have the UNDOAPPR sigoption, so they're able to indirectly cancel INPRG WOs via WAPPR.

    Here's my draft conditional expression for INVALID:
    (applies both WOs and tasks)

    1. (status in ('WAPPR', 'WSCH', 'WPCOND', 'WMATL', 'APPR', 'INPRG') and genapprservreceipt=1 and actlabhrs<>0)    
      1. It's possible in Maximo for a WO to be WAPPR and have actuals, since an APPR or INPRG WO (without any approved labor actuals with non-zero hours) can be changed to WAPPR via the UNDOAPPR sigoption. So that's why I included WAPPR.
      2. For INPRG WOs (without any approved labor actuals with non-zero hours):
        Neither the CANCEL nor INVALID status will be available. But that's because the user has the option to change the WO back to WAPPR and cancel from there.
    2. or status in ('COMP','CLOSE')  
      1. I'll need to check if a closed WO can be changed to INVALID via the Edit History action.

    Are there any issues with the above status condition?

    Thanks.


    Related:
    Rules for cancelling WOs



    #AssetandFacilitiesManagement
    #Maximo


  • 2.  RE: WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Mon December 13, 2021 09:29 AM
    If you want it to be dynamic (not dependent on specific criteria) you can do a custom condition automation script and actually check whether the cancel change status is allowed. That way you enforce the same logic verbatim. You can do that by calling mbo.canChangeStatus("CAN").

    NOTE: This will throw an error so wrap it in a try except and set your result accordingly.

    You could also call mbo.getValidStatusList() and then iterate through that but that causes the mbo.canChangeStatus to be invoked for each status before being returned so it's more efficient to just execute the mbo.canChangeStatus directly for the one status you're interested in. 

    Assuming you want to utilize a condition, your genapprservreceipt=1 should be actlabcost!=0 instead (or you could turn that into a subquery against labtrans).

    ------------------------------
    Steven Shull
    ------------------------------



  • 3.  RE: WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Mon December 13, 2021 12:14 PM
    Edited by System Admin Wed March 22, 2023 11:44 AM
    Interesting! Thanks Steven.

    To follow up:
    When you said I should use actlabcost instead of actlabhrs...what was the reasoning behind that? I'm sure you're right, I just want to make sure I understand.

    One thing that came to mind: it's possible to leave actlabhrs as zero, but then populate premium pay hours. So in that case, actlabhrs would be zero, but actlabcost would be non-zero. So I'm guessing the WO couldn't be cancelled in that scenario. Is that the kind of thing you were thinking of? Maybe Maximo/Java looks at actlabcost, not actlabhrs, when determining if a WO can be cancelled?





  • 4.  RE: WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Mon December 13, 2021 12:20 PM
    You should check both as Maximo does. You had genapprservreceipt=1 and that should be swapped actlabcost!=0 (while still keeping the actlabhrs<>0)

    ------------------------------
    Steven Shull
    ------------------------------



  • 5.  RE: WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Mon December 13, 2021 09:22 PM
    Edited by System Admin Wed March 22, 2023 11:53 AM


    Got it. My mistake.


    The reason why I'm wondering if genapprservreceipt (aka "Approved?") should be in the condition too is:
    It looks like it's possible to cancel WOs where the actuals have non-zero hours, but the actuals are unapproved (genapprservreceipt=0). So in that case, we'd want to check genapprservreceipt too.

    Does that match your experience?
    I suppose, normally, "Automatically Approve Inside Labor Transactions?" would be enabled, so all saved labor actuals would be automatically approved. So it wouldn't normally be necessary to query for genapprservreceipt. But in my case, that option is disabled, so we have unapproved labor actuals to contend with.


    Updated condition:

    (status in ('WAPPR', 'WSCH', 'WPCOND', 'WMATL', 'APPR', 'INPRG') and genapprservreceipt=1 and actlabhrs<>0 and actlabcost<>0)
    or status in ('COMP','CLOSE')










    #AssetandFacilitiesManagement
    #Maximo


  • 6.  RE: WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Tue December 14, 2021 07:50 AM
    Effectively, looking at actlabcost & actlabhrs is equivalent to checking that the labtrans is approved and non-zero. This is because only when the labor transaction is approved are the values incremented on the WO. IE if you have 1 labor transaction on a WO with 10 hours at a cost of 1000 and have not approved it, the actlabcost & actlabhrs are equal to 0. Once you approve it is when those are increased.

    The Maximo logic only looks at the total on the WO today, it doesn't look at the transaction tables themselves. I assume this was done to avoid opening or iterating through sets to make it more performant.

    ------------------------------
    Steven Shull
    ------------------------------



  • 7.  RE: WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Tue December 14, 2021 08:37 AM
    Edited by System Admin Wed March 22, 2023 11:51 AM
    Makes sense.

    For what it's worth, I realized that we are prevented from cancelling a WO when the hours are non-zero, but the cost is zero.
    So I think my updated condition should have used "OR", not "AND" -- since only one thing needs to be true in order for the WO to be un-cancel-able:
    and (actlabhrs<>0 or actlabcost<>0) instead of and actlabhrs<>0 and actlabcost<>0 .

    Full condition:
    (status in ('WAPPR', 'WSCH', 'WPCOND', 'WMATL', 'APPR', 'INPRG') and (actlabhrs<>0 or actlabcost<>0) )
    or status in ('COMP','CLOSE')

    Hopefully I understood that correctly.







  • 8.  RE: WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Sat December 18, 2021 11:47 PM
    Edited by System Admin Wed March 22, 2023 11:49 AM
    For what it's worth, I'm not really happy with the "INVALID" synonym name. It's awkward to use in a sentence, since it sounds like I'm saying the status value is not a valid status (a status value that is not allowed in Maximo).

    Alternative ideas:
    • CANCELED (custom)
    • CANCELED (workaround)
    • ERROR
    • NOT COMPLETED
    • NOT EXECUTED
    • INVALID WO

    Not sure if those are any better. I'm open to ideas.



    #Maximo
    #AssetandFacilitiesManagement


  • 9.  RE: WO status - Only show INVALID [CLOSE] if CANCEL is unavailable

    Posted Sun December 19, 2021 12:18 AM
    Edited by System Admin Wed March 22, 2023 11:46 AM
    WO completed by mistake: How to indicate WO is invalid?
    Only make the INVALID status be available if the costs are zero. Otherwise, the WO Costs window in WOTRACK will have no way to know that it needs to ignore the costs in the INVALID WO, so the totals in the WO Costs window would be incorrect.

    #AssetandFacilitiesManagement
    #Maximo