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
------------------------------
Original Message:
Sent: 07-18-2024 15:17
From: Jason VenHuizen
Subject: Error on Automation Script Object Launch Point
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
------------------------------
Original Message:
Sent: 07-17-2024 08:54
From: Dragos Chitu
Subject: Error on Automation Script Object Launch Point
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
Original Message:
Sent: 07-17-2024 08:31
From: Andreas Brieke
Subject: Error on Automation Script Object Launch Point
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