design-automation / mobius-beijing

Mobius for Geospatial Modelling, integrated with the Cesium Viewer
https://design-automation.github.io/mobius-cesium/
GNU General Public License v3.0
2 stars 4 forks source link

Nodes with higher-order function as input can't be saved as saved nodes properly #46

Open limyyj opened 6 years ago

limyyj commented 6 years ago

Not the most pressing but sometimes when you try to save these nodes they save and give you a "successful" message but when you try to create a new node, new nodes won't show up on the flowchart.

Whether I disconnect all the inputs or switch them all to empty simple input types doesn't help. I've tried copy and pasting the procedure into a new node but that also does not help. Sometimes it works when you recreate the node from scratch.

Below is one file I encountered this problem with. cannot save.zip

akshatamohanty commented 6 years ago

Yes - this problem exists when you use the higher order function in the node procedure - right?

This one needs more thought on the design for higher order functions. The problem is - here, we are talking about two nodes, the node being saved and the node it's referencing as the higher order function node. The node being saved needs to other node to be created, but that other node might not be in existence while creating a new instance of this node. So I'm not sure how to deal with this one

derekpung commented 6 years ago

I faced an issue that might be similar to this*.

I had created a function node, saved and created a copy, edited the copy, and connected the edited function node to the main node. Deleting the first function node caused me to be unable to save the entire network file. Worked around it by saving the new edited node, and making a copy of it into an old file. All is well (saving works) until the first function node is deleted again.

*@akshatamohanty I read your comment and found that my issue can be avoided if the original function call is deleted from the procedure line and replaced with the new one (I guess it relates to how referencing works as you have highlighted above). However, execution still works when the function call procedure line belonged to an old node - it executes the code within the new node that is connected to it.

It didn't occur to me that using the function call of an old node would cause an issue since the output I wanted from the function was the same. Maybe the function call in the procedure line could be highlighted red or deleted automatically when the function node it is paired with is deleted.

saveIssue.zip