这个 Maximo 自动化脚本是用什么编程语言编写的?

What programming language is this Maximo automation script written in?

我正在尝试自学 Maximo 自动化脚本。

我遇到了 script in the Maximo help。我想尝试了解它是如何工作的。

但首先,它是用什么编程语言编写的?

service.log("I want to multiply 2 numbers and log the result")
from java.util import HashMap
a=3
b=2
ctx = HashMap()
ctx.put("x",a)
ctx.put("y",b)
service.invokeScript("MULTIPLY",ctx)
service.log("the result is "+str(ctx.get("z")))

编辑:

我找到了一个看起来相似的脚本,它被标记为 JS (download PDF):

importPackage(java.util)
importPackage(Packages.psdi.server)
var ctx = new HashMap();
ctx.put("url","http://localhost:7001/maximo/oslc/script/countryapi?_lid=wilson&_lpwd=wilson");
service.invokeScript("LIB_HTTPCLIENT",ctx);
var jsonResp = ctx.get("response");
var countries = JSON.parse(jsonResp);

然而,它在每一行的末尾都有分号,而第一个脚本没有。

不知道有没有帮助。

来自docs

The source code must be written in the languages that are supported by the following script engines:

  • Mozilla Rhino, version 1.6 release 2
  • Jython, version 2.5.2

您的第一个片段看起来像 Jython。第二个看起来像 Javascript (Rhino)。