How to get PortObject back into NodeModel#execute() which is modified from NodeDialog#loadSetingsFrom

#1

Hi,

I have one situation here. In NodeDialog of type DataAwareNodeDialogPane, I have used the PortObject and changed the PortObject through an interactive Panel.
After the interation in NodeDialog back to NodeModel, I found the PortObject stays unchanged.

So my question is
How to get the changed PortObject from the methods

protected void loadSettingsFrom(final NodeSettingsRO settings,
final PortObject input) throws NotConfigurableException { … }

back into

protected PortObject execute(final PortObject inData,
final ExecutionContext exec) throws Exception { … }

Best Regards
Kefang

0 Likes

#2

Hi @KFDing,

That is not possible as it would violate KNIME node behavior principles. You can see the input data in the DataAwareNodeDialogPane but you can not change it. The node dialog defines how a node modifies its input data, in your case you need to store the modifications to the PortObject in a preference key and apply that during node execution.

Can you give us a more detailed description of what you want to achieve? Then we can give you a better answer.

0 Likes

#3

Hi Gabriel,

glad to hear your reply. The concrete codes are in this link

In the method

protected void loadSettingsFrom(final NodeSettingsRO settings,
final PortObject input) throws NotConfigurableException {

List<TraceVariant> variants = EventLogUtilities.getTraceVariants(log);

// Through the interation with user, it changes the values of variants from PortObject
vPanel = new VariantWholeView(variants, info);

}

I’d like to have the changed PortObject as the execution result.

Regards
Kefang

0 Likes

#4

Hi Gabriel,

I understand the reason for unchangable PortObject in the NodeDialog. After that, I tried to move the Interaction Panel into execution part. Now doing the bebug.
Regards
Kefang

0 Likes