我在 Boomi 中使用 Groovy(1.5) 来捕捉上个月的最后一天,并且我一直在混合我通过 Google 找到的一些东西:
import java.util.Properties;
import java.io.InputStream;
for( int i = 0; i < dataContext.getDataCount(); i++ ) {
InputStream is = dataContext.getStream(i);
Properties props = dataContext.getProperties(i);
dataContext.storeStream(is, props);
}
var dt = new Date();
dt.setDate(1);
dt.setHours(-1);
props.setProperty("document.dynamic.userdefined.StartDate",dt);
但是我遇到了以下错误:
No signature of method: com.sun.script.groovy.GroovyScriptEngine.var() is applicable for argument types: (java.util.Date) values: {Thu Feb 25 16:09:33 UTC 2021} (in groovy script);
Caused by: No signature of method: com.sun.script.groovy.GroovyScriptEngine.var() is applicable for argument types: (java.util.Date) values: {Thu Feb 25 16:09:33 UTC 2021}