Maximo Open Forum

 View Only
Expand all | Collapse all

Conditional Expression on Security Group

  • 1.  Conditional Expression on Security Group

    Posted 06-21-2023 10:20

    Hi,

    I have applied a Conditional Expression on a Security Group for the "Complete Work Order" option in the Work Order Tracking application. The purpose of this condition is to restrict users in this Security Group from completing a work order unless one of the following requirements is met:

    1. The work type is not equal to 'IL'.
    2. The work code is not equal to 'MECH CONTRACT LABOR' or 'MECH PARTS MGT'.

    The condition I have written is as follows: WORKTYPE!='IL' or THD_WORKCODE not in ('MECH CONTRACT LABOR','MECH PARTS MGT').

    However, during testing, I have observed that a user in this security group is unable to complete a work order when both requirements are met. I am seeking assistance to understand why the condition is not functioning as expected. I would appreciate any insights or guidance you can provide to help resolve this issue.


    #MaximoApplicationSuite

    ------------------------------
    Carlos Mestre
    Home Depot
    ------------------------------


  • 2.  RE: Conditional Expression on Security Group

    Posted 06-21-2023 11:01

    I think you are missing the colon sign (:) in front of field names.

    Something like:

    :WORKTYPE!='IL' or :THD_WORKCODE not in ('MECH CONTRACT LABOR','MECH PARTS MGT')



    ------------------------------
    Dragos Chitu
    EL
    ------------------------------



  • 3.  RE: Conditional Expression on Security Group

    Posted 06-21-2023 11:08

    Thanks Dragos. I have tested your expression, but I am still able to Complete the WO unless both requirements are met. I don't know why the "OR" is not being triggered. The system is processing the OR as an AND, and it shouldn't. Has anyone else experienced this with conditional expressions?



    ------------------------------
    Carlos Mestre
    Home Depot
    ------------------------------



  • 4.  RE: Conditional Expression on Security Group

    Posted 06-21-2023 11:21

    Try this:

    (:WORKTYPE!='IL') or (:THD_WORKCODE not in ('MECH CONTRACT LABOR','MECH PARTS MGT'))



    ------------------------------
    Dragos Chitu
    EL
    ------------------------------



  • 5.  RE: Conditional Expression on Security Group

    Posted 06-21-2023 12:22

    Same thing happens. I am able to Complete the WO unless both requirements are met. Your expression makes total sense, so I don't understand why it isn't being applied correctly.



    ------------------------------
    Carlos Mestre
    Home Depot
    ------------------------------



  • 6.  RE: Conditional Expression on Security Group

    Posted 06-21-2023 17:32
    Edited by Dragos Chitu 06-21-2023 17:33

    Last things that I could think of:

    1. Try this statement:
      (:WORKTYPE <> 'IL') or (:THD_WORKCODE not in ('MECH CONTRACT LABOR','MECH PARTS MGT'))
    2. Check if there are other conditions (applied somewhere else) which are interfering with the condition above.



    ------------------------------
    Dragos Chitu
    EL
    ------------------------------



  • 7.  RE: Conditional Expression on Security Group

    Posted 06-22-2023 08:50

    Hi Carlos,

    You could try this to meet all conditions.  From logic or means one or the other but not both.

    :WORKTYPE!='IL' or :THD_WORKCODE not in ('MECH CONTRACT LABOR','MECH PARTS MGT') or (:WORKTYPE!='IL' and :THD_WORKCODE not in ('MECH CONTRACT LABOR','MECH PARTS MGT'))



    ------------------------------
    James Robb
    NASA
    ------------------------------



  • 8.  RE: Conditional Expression on Security Group

    Posted 06-22-2023 09:59

    Hi James and Dragos, 

    Thank you both for your help, but I am still having the same issue. I have tried all the conditions you both have recommended, but I am still able to complete the WO unless both the Work Type = IL AND the Work Code = 'MECH CONTRACT LABOR' or 'MECH PARTS MGT'. I am not sure why it's not working.



    ------------------------------
    Carlos Mestre
    Home Depot
    ------------------------------



  • 9.  RE: Conditional Expression on Security Group

    Posted 06-22-2023 10:24

    Could you try :WORKTYPE!='IL' or :THD_WORKCODE not in ('MECH CONTRACT LABOR','MECH PARTS MGT') and :user in (select userid from groupuser where groupname = 'SECURITYGROUPNAME')

    Replace SECURITYGROUPNAME with the name of the security group you are applying the restriction to.  Then apply the restriction to the COMP value of the WOSTATUS domain and Condition Number is your condition.  If you leave Object Name blank it applies to all applications that use the WOSTATUS domain like Workorder, PM, etc.  May require entering WORKORDER for the Object Name field.



    ------------------------------
    James Robb
    NASA
    ------------------------------



  • 10.  RE: Conditional Expression on Security Group

    Posted 06-22-2023 10:38

    Thank you, James. I have replaced 'SECURITYGROUPNAME' with the actual security group, and I have applied this condition to the COMP value of the WOSTATUS domain and set the object to WORKORDER. Now, I am able to complete a WO even if work type = IL and Work Code = 'MECH CONTRACT LABOR' or 'MECH PARTS MGT'



    ------------------------------
    Carlos Mestre
    Home Depot
    ------------------------------



  • 11.  RE: Conditional Expression on Security Group

    Posted 06-22-2023 11:48

    I would still check if there are other conditions interfering with the one that you presented.

    For the user that you are using to test:

    1. list all security groups the user is belonging to, 
    2. check the relationships between the groups (is any of them "Indepenent of other groups"?)
    3. for each of the security groups check if there are other conditions impacting COMP


    ------------------------------
    Dragos Chitu
    EL
    ------------------------------