To import classes properly in Nashorn you can do the following, where you import the
MXServer class and then in this case get the LABOR MboSet.
var MXServer = Java.type("psdi.server.MXServer")
var set = MXServer.getMXServer().getMboSet("LABOR", MXServer.getMXServer().getSystemUserInfo());
You may also run into issues with calling overloaded methods such as mbo.setValue("attribute","value") since the value parameter may be of many different types. To avoid this you can specify the specific method you want to call by specifying the types as shown below.
mbo["setValue(String, String)"]("ATTRIBUTENAME", "string value")
mbo["setValue(String, int)"]("ATTRIBUTENAME", "int value")------------------------------
Jason VenHuizen
------------------------------
Original Message:
Sent: Fri May 29, 2020 08:54 AM
From: Robert Goff
Subject: Maximo 7.6.1 - Automation script. Errors with parameters doesnt work (javascript)
I haven't had a problem using jython lists as before instead of java.ArrayList; the first thing I'd try is adding double quotes around the values in your list, i.e. ["value1", "value2"]
If that doesn't help, here's an article about using the mozilla-compatible version of Nashorn:
https://a3jgroup.com/automation-scripts-compatibility-with-maximo-7-6-1/
------------------------------
Robert Goff
------------------------------