Topic
  • 3 replies
  • Latest Post - ‏2013-02-20T10:31:03Z by maxmix
SystemAdmin
SystemAdmin
5842 Posts

Pinned topic Multiple qualifiers in a conditional expression in Maximo Condition

‏2013-02-11T16:24:10Z |
Hi All,

I have a requirement to NOT allow a Maximo work order go to Complete or Close status under certain condtions.

I seem to be able to get a condition to work with 1 variable or qualifier such as PROBLEMCODE is not null, but when I start adding qualifiers things start to break down and not work.

Example that doesn't work in all situaitons - PROBLEMCODE is not null and geaforasset = 1 and wotype not in ('PM','FM') things don't work.

One suggestion from others is to move the expressions around such as geaforasset = 1 and wotype not in ('PM','FM') and PROBLEMCODE is not null. So I'm starting to try this.

I posted a PMR on this issue and was told to try taking the colon : off and not using that.

It was also suggested to use more parenthesis ( ) to group conditions and I'm trying that but haven't found the right combination yet.

Anyone had success with multiple expressions within 1 condition and what has and hasn't worked?
Updated on 2013-02-20T10:31:03Z at 2013-02-20T10:31:03Z by maxmix
  • maxmix
    maxmix
    83 Posts

    Re: Multiple qualifiers in a conditional expression in Maximo Condition

    ‏2013-02-15T15:36:30Z  
    hm your example has no colons so I do not see where you had them prior to removing them ;)

    The colons are very important, as they are the only proper way of referencing an attribute in reference to the MBO your condition is applied to.

    so in case the condition is applied to your workorder, all fields you want to reference within that workorder need to be prefixed with a colon.
    Example of a ficticious usecase where to use and not use colons...

    " :wotype is not in ('PM','FM') and :reportedby is not in (select userid from users where status='INACTIVE')"
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Multiple qualifiers in a conditional expression in Maximo Condition

    ‏2013-02-15T16:30:41Z  
    • maxmix
    • ‏2013-02-15T15:36:30Z
    hm your example has no colons so I do not see where you had them prior to removing them ;)

    The colons are very important, as they are the only proper way of referencing an attribute in reference to the MBO your condition is applied to.

    so in case the condition is applied to your workorder, all fields you want to reference within that workorder need to be prefixed with a colon.
    Example of a ficticious usecase where to use and not use colons...

    " :wotype is not in ('PM','FM') and :reportedby is not in (select userid from users where status='INACTIVE')"
    Thank you for the response. I have an open PMR with support, and it was support who suggested trying this without the colon when it didn't work with the colon. For whatever reason, part of it works without the colon. I have gone back to using the colon, but still have not been able to resolve this. I had a note in some instructions that I had which said that "Multiple" conditions are evaluated as OR. What I don't know if this is conditions with different names applied to the same sigoption, Ex1, Ex2, Ex3 - or if it means 3 variables or expressions within 1 condition. At this point, I have tried multiple things, different orders, adding parenthesis to group the variables - ((:GEAFORASSET = 1) and (:WORKTYPE in ('CM')) and (:PROBLEMCODE is not null)) - this validates, but doesn't work. In the case of this one, it still applies to all work orders where GEASSET is 1 or 0 and applies to all Worktypes, not just CM. I tried not in first, then in. Still no luck. Ray
  • maxmix
    maxmix
    83 Posts

    Re: Multiple qualifiers in a conditional expression in Maximo Condition

    ‏2013-02-20T10:31:03Z  
    Thank you for the response. I have an open PMR with support, and it was support who suggested trying this without the colon when it didn't work with the colon. For whatever reason, part of it works without the colon. I have gone back to using the colon, but still have not been able to resolve this. I had a note in some instructions that I had which said that "Multiple" conditions are evaluated as OR. What I don't know if this is conditions with different names applied to the same sigoption, Ex1, Ex2, Ex3 - or if it means 3 variables or expressions within 1 condition. At this point, I have tried multiple things, different orders, adding parenthesis to group the variables - ((:GEAFORASSET = 1) and (:WORKTYPE in ('CM')) and (:PROBLEMCODE is not null)) - this validates, but doesn't work. In the case of this one, it still applies to all work orders where GEASSET is 1 or 0 and applies to all Worktypes, not just CM. I tried not in first, then in. Still no luck. Ray
    Hi ray,
    > ((:GEAFORASSET = 1) and (:WORKTYPE in ('CM')) and (:PROBLEMCODE is not null))
    misses a starting parenthesis.
    Other than that, please start with only
    :WORKTYPE in ('CM')
    if this yields the proper result to start with, then increment your condition piece by piece to see when the scale tips. As I trust the standard fields first, I'd add "GEAFORASSET" only at last.
    Is this field a peristent one, does it have field class attached and what type is it btw?