How to set up node inputs that are created ar runtime, but dont break json #615
-
I'm using Rete (V1 now, plan to convert to V2 when it's stable.) for a text processing application. One of the features I have created allows users to create variables that become inputs to the node. Example: I have this working. however, I am allowing the user to save and load the diagrams as well. When the diagram is loaded is when things break. any dynamically creating inputs disappear, until a emitter("process") is triggered. It also displays an error that any connections to the dynamic inputs "IO not found for node x". I'm not really sure why this happens, since the inputs are clearly added to the outputted json.
Here is the code for handling dynamic inputs.
Code from worker, where this is called:
I would love any help fixing this issue! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
having connections in JSON is not enough, because I guess the Also I wouldn't recommend calling |
Beta Was this translation helpful? Give feedback.
having connections in JSON is not enough, because
Rete.Input
andRete.Output
must be predefined for them in the node instance (builder
method)I guess the
dynamic_input
function should be called insidebuilder
method.Also I wouldn't recommend calling
dynamic_input
insideworker
. If possible, update dynamic inputs directly when the text in the input changes.