With my knowledge and experience around scripts, I would recommend not to have complex logic and lengthy code written in the scripts. You should rather explore the option of Java class here. I do understand that scripts give you the flexibility to add and run your code without much fuss and downtime but it is important to understand when we should write scripts and when to write java. With any complex logic and lengthy code, I would always go for Java so that you have a better control and code is also readable.
Original Message:
Sent: Mon December 18, 2023 11:17 AM
From: Pankaj Bhide
Subject: Size of automation script (jython) 1 MB
Hello,
Thanks for your insight. The script that I am working on is not associate with any launch point (object/ attribute). We use this script for inserting/updating rows on work order related MBOs. We receive a json payload from a web application. We need to parse the content of the json, validate the contents of the json and upon successful validation insert and update rows in the work order related MBOs.
We are working on revising the longer script in the parts (e.g. split the functions in the separate files etc.). This way, we can probably overcome the size limitation.
------------------------------
Pankaj Bhide
Original Message:
Sent: Fri December 15, 2023 02:32 PM
From: Bradley Downing
Subject: Size of automation script (jython) 1 MB
Pankaj,
I want to make sure I preface my comment with this: I do not want to come across as rude or insentive. I understand that many Maximo customer have move customizations into Automation Scripts. THAT is a good thing. But as a business focused technologist I have to ask Why?
Why such a large automation script to begin with? Think of this for just a moment.... one byte in ASCII is one character, such that "TEST" is four bytes. a regular express (such as a Carrige return) is also a single byte. This means you have jython script that is a MILLION characters long. WHY? the tis almost un managed bye to begin with from any given launch point perspective. What are you trying to accomplish with such a large piece of executable code at run time? I trust that you have already looked at the collection of automation scripts and have leveraged that.
So knowing that some scripts will CERTIANLY be large.... perhaps you can skinny down these as well? Performance wise I would argue that several scripts call in succession will execute faster that on large script. Curious to know what your thoughts are. Hope this helps.
------------------------------
Bradley K. Downing , MBA
Senior Brand Technical Specialist
IBM
Bakersfield CA
Original Message:
Sent: Thu December 14, 2023 05:35 PM
From: Pankaj Bhide
Subject: Size of automation script (jython) 1 MB
Hello,
We are on MAXIMO 7.6.1.3 and we are utilizing jython for the automation scripts.
We recently experienced that the size of the jython file should not exceed 1 MB.
If we separate out a few functions in the library script and invoke the library script for these function (instead of the keeping them in main file - thus reducing the size of the main automation script) from the main jython file, can we overcome this size limitation? OR Is it the total of main file and the library script that counts for the 1 MB size?
Has anybody experienced this issue and how you overcome this? I understand that the limit of 1 MB is hardcoded and it can not be changed.
Please advice
------------------------------
Pankaj Bhide
------------------------------