Very good input Jason. Thanks!
Original Message:
Sent: 9/15/2023 10:53:00 AM
From: Jason VenHuizen
Subject: RE: How to prevent other automation scripts from firing when update record
Hi Pat,
It sounds like your have a design issue with your scripts in general.
There are two things to consider, for a given Object / Attribute etc you should only have a single script that owns the launch point. If you want to break your script up into multiple scripts, do so and then call those scripts from the one that owns the launch point. This way you have control over which scripts fire and what order the execute in.
Here is an article that explains this approach: https://www.sharptree.io/blog/2021/2021-11-29-js-invoke-library/
The other thing I recommend is using a main function as the entry point for your script. Something like:
Python:
def main():
# your code here
main()
JavaScript:
main();
function main(){
// your code here.
}
This lets you have an entry point within the script from which you can exit. So anywhere in the process you can call return and stop execution without worrying about falling through and executing something unexpected.
Hope that is helpful.
- Jason
------------------------------
Jason VenHuizen
Sharptree
------------------------------
Original Message:
Sent: 09-14-2023 11:26
From: Pat Galloway
Subject: How to prevent other automation scripts from firing when update record
Thanks Prashant - good idea that I had not thought of.
------------------------------
Pat Galloway
Galloway Consulting
Original Message:
Sent: 09-13-2023 11:30
From: Prashant Sharma
Subject: How to prevent other automation scripts from firing when update record
In the automation script which you want to run only from UI and not from Escalation, use interactive check.
If interactive==True:
//your logic which should run from UI and not from escalation.
------------------------------
Prashant Sharma
Sedin Technologies
Connect with me @ https://www.linkedin.com/in/psharmamaximo/
#IBM Champion 2022
#IBM Champion 2023
Original Message:
Sent: 09-12-2023 11:06
From: Pat Galloway
Subject: How to prevent other automation scripts from firing when update record
Hi All - I am on 7.6.1.3 and have escalation that executes an action launchpoint automation script that updates a workorder. I have coded the setValue to noaction(see below). I do not have a save() on mboset but records are saved and updated without that and all is working good - except other workorder automation scripts that have save launchpoints are also executing and I don't want that. I thought the noaction would prevent other scripts from executing ? Any insight one what I am doing wrong?
mbo.setValue("FTW_ACTUALDUR", diff, MboConstants.NOACTION)
I have also tried adding a save to mboset in the auto script - I have tried ways listed below but other autoscripts still fire when escalation runs.
mbo.getThisMboSet().save()
mbo.getThisMboSet().save(9L)
Thanks for any ideas!
Pat
#EverythingMaximo
------------------------------
Pat Galloway
Galloway Consulting
------------------------------