...
Meanwhile we can say the object formula editor is the favorite one. It is faster has more functions and works better due to its object approach. The formula editor (line by line) should be used only in special circumstances, e.g. with an input channel of a measurement component where the measurement value come into jBEAM value by value, which is line by line.
How can I define several result objects in Inline Java-Class?
Result objects can be defined using parent.setResultObjects(...). By default, a DoubleChannel is created. This can be overwritten in init. Example:
Code Block |
---|
@Override
public void init(InlineUserClassParentIF parent) {
this.parent = parent;
try {
GroupOfChannels result = ProducerUtils.getResultDataObject(parent, "Gruppe", GroupOfChannels.class, true);
StringChannel result2 = ProducerUtils.getResultDataObject(parent, "StringChannel", StringChannel.class, true);
parent.setResultObjects(result, result2);
} catch (Cea2ItemNotAvailable | Cea2UnsupportedDataType e) {
throw new IllegalStateException(e);
}
}
@Override
public void validate() {
if (parent == null) {
return;
}
GroupOfChannels result = (GroupOfChannels) parent.getResultObject(0);
StringChannel result2 = (StringChannel) parent.getResultObject(1);
... |