Disabling "Refresh " widget till previous nodes are executed.

I have a component, in which the user selects one of the names from the first Label and clicks refresh .Upon doing this a background calculation happens . After this he needs to select the bins he requires and click the 2nd refresh button.

If the user clicks the 2nd refresh button before the calculation is complete , the following error shown below is displayed.

Node:
Message: {
“code”: -32001,
“message”: “Illegal state “IDLE” encountered in method “org.knime.core.node.workflow.SingleNodeContainer#rawReset” in node Refresh Button Widget 0:892:0:884:0:809”,
“data”: {
“exceptionTypeName”: “java.lang.IllegalStateException”,
“message”: “Illegal state “IDLE” encountered in method “org.knime.core.node.workflow.SingleNodeContainer#rawReset” in node Refresh Button Widget 0:892:0:884:0:809”
}
}

I dont want to use a “Wait” node because the time for execution for different names are different because the datasets for each name have different number of rows.

Is it possible to disable the 2nd refresh button until the calculation is complete or the previous nodes are executed ?

Is it possible to send the “Executed” status of the previous node as a flow variable to the 2nd " Refresh" button ?

Thank you.

Hi @sriram5608

If you connect the output flow variable of the first refresh’s calculations to to the second refresh does that help? In theory the second refresh shouldn’t trigger if you have a flow variable that it is waiting on.

It would look something like this (which I have not tested)

Regards,
Wali

1 Like

Thanks for your reply . In my workflow the 2 refresh buttons are part of a component. So even though the 2nd refresh button is connected by flow variable or even if I insert a Wait node, it does not stop the user from clicking the 2nd refresh button before the calculation is done resulting in the error . User when looking at the component output is not aware if the calculation is complete.

So I want to prevent the user from clicking the 2nd refresh button either by disabling or hiding it till the calculation is complete.

Hi @sriram5608

Thanks, this is definitely possible, but non-trivial. I have done this once by storing a file with the workflow that contains a boolean, and the widgets are encapsulated in a case switch whether to run or not.

Here it is Pricing Validation – KNIME Hub

The easier route would be to separate the the screens into separate components.

Regards,
Wali