Maximo

Maximo

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

 View Only
  • 1.  Work order Change status - restrict the value using conditional expression

    Posted Thu September 05, 2024 06:26 AM

    Hello,

    We have 3 custom work order tracking applications (clones of WOTRACK) and we want to restrict the work order status based upon the app and also with some specific conditions.

    For example, to start with the simple one - we have a custom work order tracking app titled "LBL_WO" and there is a work order status titled "AUTH_WAPPR" (waiting authorizer approval) which should visible only in "LBL_WO" custom app when user invoke "Chang WO Status" dialog box.

    I created following conditional expression in MAS 9:
    object name=SYNONYMNDOMAIN

    ( (len(trim(:&APPNAME&)=0) or (:&APPNAME&='LBL_WO') )   -- the first one  before "or" is for allowing to change the status via Restful API 

    Now, I associated the above conditional expression to  the WOSTATUS - AUTH_WAPPR domain row and saved the contents.

    However, this work order status is still visible in the out of box work order tracking (it should not be visible in other app except LBL_WO as both the conditions yield false). 

    Any clue what wrong I am doing? Does it need to bounce the app servers? 



    ------------------------------
    Pankaj Bhide
    ------------------------------


  • 2.  RE: Work order Change status - restrict the value using conditional expression

    Posted Fri September 06, 2024 12:49 AM

    Hello!

    Just guess (after some testing this case). As status change is done through separate dialog window, maybe that window doesn't has appname information?



    ------------------------------
    Juris Flugins
    ------------------------------



  • 3.  RE: Work order Change status - restrict the value using conditional expression

    Posted Sun September 08, 2024 04:32 PM

    Hi there, 

    Couple queries:

    • Are the users of each of the Workorder Tracking applications shared?
    • Is the autonumber / site options of the workorders different for each of the clones? 
    • Is there an database config field specific to that type of workorder?


    I have restricted access to status change options via security groups before, i.e. where the SYNONYMNDOMAIN conditional expression checks the :user against a specific security group to see if that person is allowed to use that status.

    Similarly, if the site for the workorders or the autonumber is set to be different, e.g. A1234 for workorders in area A and B1234 for workorders in area B, then you could set the expression to exclude the status change for that site / autonumber / location.



    ------------------------------
    Evan Williams
    ------------------------------



  • 4.  RE: Work order Change status - restrict the value using conditional expression

    Posted Sun September 08, 2024 08:11 PM
    Hello,

    Thank you for your suggestion. The variable :&APPNAME does not seem to work in this case. 

    I will therefore try with your suggestion.

    As far as clarification to your queries:

    1) Yes, there is a separate security group for one app e.g. lockshop
    2) The autonumber site option are same 
    3) No, there is nothing specific to the work orders

    Thanks again







  • 5.  RE: Work order Change status - restrict the value using conditional expression

    Posted Sun September 08, 2024 08:48 PM

    Hi Pankaj,  Please create a custom condition using automation script and attach it to WOSTATUS - AUTH_WAPPR values. 

    Reference link - CustomConditionlink

    sample scripts: 

    if app == 'CUSTOM_WO':
        evalresult=true
        
    appName = mbo.getThisMboSet().getParentApp()
    if appName == 'CUSTOM_WO':
        evalresult=true

    Please let me know if this option works.

    Thanks,

    Suren



    ------------------------------
    Surender Balasundaram
    ------------------------------



  • 6.  RE: Work order Change status - restrict the value using conditional expression

    Posted Sun September 08, 2024 10:16 PM
    Hello 

    Thanks for your help.

    I created the automation script. The "evalresult" seems to be an implicit variable. Correct?

    How do I associate the automation script to the condition? 

    For the condition - there are only 2 types, EXPRESSION and JAVA CLASS. Shall I put the name of the automation script in the EXPRESSION field? Shall I leave "always evaluate" disabled?

    Please let me know at your convenience

    Thanks again

    Pankaj Bhide





  • 7.  RE: Work order Change status - restrict the value using conditional expression

    Posted Sun September 08, 2024 10:59 PM

    Hi Pankaj, 

    Yes. evalresult is implicit variable. 

    https://www.youtube.com/watch?v=UwLafkBNG0k

    Please refer this link on how to create an condition of type class using automation script. 

    https://expertinmaximo.wordpress.com/2016/08/26/automation-script-for-conditional-expressions/?blogsub=subscribed#blog_subscription-4

    Thanks,

    Suren



    ------------------------------
    Surender Balasundaram
    ------------------------------



  • 8.  RE: Work order Change status - restrict the value using conditional expression

    Posted Sun September 08, 2024 11:46 PM
    Thanks Suren for all your help. I will let you know about it shortly.

    Pankaj Bhide 





  • 9.  RE: Work order Change status - restrict the value using conditional expression

    Posted Mon September 09, 2024 09:30 AM

    Pankaj,

    If you decide to do this through Conditional Expression Manager, you might have to create conditions for TWO objects: WOSTATUS and WOCHANGESTATUS (it's what I had to do anyway).  And because of the Attribute names in those tables, you may have to use a different Condition.  For example, in mine, I have restrictions on INPRG.  One condition starts with :status and the other (on the WOCHANGESTATUS object) starts with :wostatus

    Making the Condition for WOCHANGESTATUS controls what is shown in the Change Status dialog.  The Condition for WOSTATUS changes what the WORKORDER itself can accept.

    Then you need to apply BOTH conditions to your status in the Domains application, WOSTATUS domain.



    ------------------------------
    Travis Herron
    ------------------------------