However, in MAS 8.11 the things are a bit... different. I took the script that you posted and I've tested it:
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.
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
Original Message:
Sent: 07-12-2024 13:42
From: Dragos Chitu
Subject: Error on Automation Script Object Launch Point
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
------------------------------