Maximo Open Forum

 View Only
  • 1.  Error on Automation Script Object Launch Point

    Posted 07-12-2024 13:43

    Hi,

    I've created an Automation Script with Object Launch Point WORKORDER.

    Object Event Condition is something like this:

    exists (select 1 from wfinstance where ownertable = 'WORKORDER' and  ownerid = :workorderid and active = True)

    But when I'm testing the above expression with Condition Expression Builder, I'm getting the error:

    BMXAA1116E - Validation failed. Invalid character found in a character string argument of the function "DECFLOAT".. SQLCODE=-420, SQLSTATE=22018, DRIVER=4.32.28.
    Invalid character found in a character string argument of the function "DECFLOAT".. SQLCODE=-420, SQLSTATE=22018, DRIVER=4.32.28

    It seems that the issue is related to 
    ownerid = :workorderid

    For whatever reasons Maximo doesn't accept :workorderid in this context.

    Do you have any idea why I'm getting this error or how to overcome this issue?

    Thank you,

    Dragos


    #Administration
    #Analytics
    #Architecture
    #Assets
    #CivilInfrastructure
    #Customizations
    #EndUser
    #EverythingMaximo
    #HSE/OilandGas
    #Infrastructure
    #Integrations
    #Inventory
    #IoT
    #LifeScience/Calibration
    #Linear
    #MaximoApplicationSuite
    #MaximoForAviation
    #MaximoUserGroups
    #Mobility
    #Nuclear
    #Procurement
    #Reporting
    #Scheduling
    #Security
    #ServiceProvider
    #Spatial
    #Transportation
    #Utilities
    #WorkCenters
    #WorkManagement
    #MaximoVisualInspection
    #Predict
    #Monitor
    #Health
    #Assist
    #Safety

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


  • 2.  RE: Error on Automation Script Object Launch Point

    Posted 07-15-2024 06:58

    Hi Dragos

    I don't know what cause the issue, but it likely missing the relationship from inner query to outer query for exists so you need to add it back to inner query just like

    exists (select 1 from wfinstance where ownertable = 'WORKORDER' and  ownerid = :workorderid and active = True and ownerid = workorder.workorderid)

    or you can rewrite it as 

    workorderid in (select ownerid from wfinstance where ownertable = 'WORKORDER' and  ownerid = :workorderid and active = True)

    Regards,

    Jason



    ------------------------------
    Jason Pun
    Lexco Limited
    ------------------------------



  • 3.  RE: Error on Automation Script Object Launch Point

    Posted 07-15-2024 08:38
    Edited by Dragos Chitu 07-15-2024 08:38

    Hi Jason,

    Thank you for your reply!

    Few comments regarding the solutions proposed:

    1. exists (select 1 from wfinstance where ownertable = 'WORKORDER' and  ownerid = :workorderid and active = True and ownerid = workorder.workorderid)
      I don't think that relationship is missing or necessary in this context. If I'm using ownerid = workorderid then the condition passes the test.
      It's wrong for what I intend to verify (as it's not checking against the current workorderid), but it's accepted by Maximo.
      On the other hand, I have another exists in the condition (which I didn't mentioned) and which is working fine without relationship:
      exists (select 1 from workorderspec where wonum = :wonum and siteid = :siteid and (alnvalue is null or alnvalue = 'False'))
      this one works fine without any relationship.
    2. workorderid in (select ownerid from wfinstance where ownertable = 'WORKORDER' and  ownerid = :workorderid and active = True)
      It's going back to the ownerid = :workorderid which raised the initial error.

    Really appreciate your reply, but unfortunately the suggestions are not working for me.

    Thank you,
    Dragos



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



  • 4.  RE: Error on Automation Script Object Launch Point

    Posted 07-16-2024 08:57

    "active" at the tail of your condition is a Boolean; Maximo stores Booleans in the database as 1 or 0. Compare "active" to 1 to find true.



    ------------------------------
    Robert Goff
    Xanterra Travel Collection
    ------------------------------



  • 5.  RE: Error on Automation Script Object Launch Point

    Posted 07-16-2024 09:06
    Edited by Dragos Chitu 07-16-2024 09:06

    Hi Robert,

    Thank you for your reply!

    I know that active is boolean, but that is not causing the error.

    I've eliminated conditions until I've figured it out that the error is caused by the ownerid = :workorderid.

    What I cannot figure it out is why I get this error or how to overcome it. Any idea?

    Thank you,

    Dragos



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



  • 6.  RE: Error on Automation Script Object Launch Point

    Posted 07-17-2024 08:32
    Edited by Andreas Brieke 07-17-2024 08:32

    Hi Dragos,

    i think this is a problem with datatypes and how maximo handles these substitutions.

    WorkorderID is a BIGINT, so having entries like 1000000. Maximo does a getString to substitute your :workorderid. If you do an getString on a BIGINT (or similar), this gets written as 1.000.000 (with thousands seperators).

    Your database tries to do an DECFLOAT(value) on this because it wants to compare with an BIGINT and can't handle the dots. You could try REPLACE(:workorderid,'.','') to remove those dots from it.

    Regards,

    Andreas



    ------------------------------
    Andreas Brieke
    SVA System Vertrieb Alexander GmbH
    ------------------------------



  • 7.  RE: Error on Automation Script Object Launch Point

    Posted 07-17-2024 08:55

    Hi Andreas,

    Thank you for your answer!

    I tried what you suggested and it worked!

    I also thought that the problem could be related to the way Maximo handles bigint data, but I couldn't figure it out how to convert it.

    Now, both ownerid and workorderid are bigint therefore I wondered if replace() should be used to both of them.

    Therefore when I used ownerid = replace(:workorderid, '.', '') then I get the same error.

    But when I used replace(ownerid, '.', '') = :workorderid it worked (validation successful), I didn't get the error anymore.

    So, issue solved.

    Thank you,

    Dragos



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



  • 8.  RE: Error on Automation Script Object Launch Point

    Posted 07-18-2024 15:17

    I just set up an automation script with Maximo 7.6.1.3, DB2 11.1, the launch point is on WORKORDER Add / Update / Before Save and with the following condition and it works correctly.

    exists (select 1 from wfinstance where ownertable = 'WORKORDER' and  ownerid = :workorderid and active = :yes)

    Note the use of :yes as a bind variable that is replaced with a valid boolean value.  In the original post the statement was using True which would not work. Using a replace and replacing the periods or commas in a string formatted number seems like a very brittle solution and there must be something else going on since it otherwise works in a similar system.



    ------------------------------
    Jason VenHuizen
    Sharptree
    ------------------------------



  • 9.  RE: Error on Automation Script Object Launch Point

    Posted 07-18-2024 16:33

    Hi Jason,

    Thank you for your reply!

    Back in Maximo 7.6.1.3 ownerid = :workorderid worked without any issue.

    However, in MAS 8.11 the things are a bit... different. I took the script that you posted and I've tested it:

    The result is here:

    With this script:

    it works:

    Nevertheless, I agree with you that active = :yes would be a better solution, but not that statement was causing the issue. Issue was solely on ownerid = :workorderid.

    For the rest I'm in agreement with Andreas. The solution he proposed works and the explanation fits as well.

    I know that in theory Maximo 7.6.1.3 and MAS Manage should behave the same; in practice, however, the things are a bit different.

    Thank you,

    Dragos



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