使用自定义公式函数/自动化脚本的Maximo公式? [英] Maximo formula that uses a custom formula function/automation script?

查看:147
本文介绍了使用自定义公式函数/自动化脚本的Maximo公式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Maximo 7.6.1.1中:

In Maximo 7.6.1.1:

我想创建一个使用自定义公式函数/自动化脚本的属性公式.

I would like to create an attribute formula that uses a custom formula function/automation script.

我尝试按照以下步骤进行操作,但是不幸的是,当我尝试在WO Tracking中使用它时出现错误:

I've tried doing it with the steps below, but unfortunately, I get an error when I try to use it in WO Tracking:

BMXAA3761E - The event has failed. Ensure that the event is registered correctly.
See the log file in the APP HOME directory for more details about the error.
null


步骤:


Steps:

  1. 创建自动化脚本:

  1. Create an automation script:

添加/修改公式功能:

Add/Modify Formula Function:

添加/修改属性的公式:

Add/Modify Formula For Attribute:

创建一个WO.保存它,以便调用属性公式.

Create a WO. Save it so that the attribute formula is invoked.

错误:

从SystemOut日志中:

From the SystemOut log:

Caused by: 
java.lang.NullPointerException
    at com.ibm.tivoli.maximo.expression.FormulaMboEventListener.preSaveEventAction(FormulaMboEventListener.java:213)
    at psdi.server.event.EventTopic$Subscription.preSaveEventAction(EventTopic.java:731)
    at psdi.server.event.EventTopic.preSaveEventAction(EventTopic.java:342)


有人知道我为什么会收到此错误吗?


Does anyone know why I'm getting this error?

此处的相关问题: Maximo公式可以返回null吗?

推荐答案

据我所知,此preSaveEventAction方法不期望null值,并且会自动崩溃.查看Javadoc中的com.ibm.tivoli.maximo.expression.Expression.eval()方法.它正在返回BigDecimal,这是公式应返回数字的线索.

From what I see, this preSaveEventAction method is not expecting a null value and voluntarily crashes. Look at the com.ibm.tivoli.maximo.expression.Expression.eval() method from the Javadoc. It is returning a BigDecimal, a clue that a formula should return a number.

https://developer.ibm. com/static/site-id/155/maximodev/7609/maximocore/businessobjects/

所以出现此错误的原因似乎是因为您的脚本返回了无效的值,与此处相同:

So the reason you're getting this error seems to be because your script returns an invalid value, same as here: Can Maximo formulas return null?

这篇关于使用自定义公式函数/自动化脚本的Maximo公式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆