Reply To: Renaming Tasks

NodeCanvas Forums General Discussion Renaming Tasks Reply To: Renaming Tasks

#13081
Gavalakis
Keymaster

Hello and sorry for the very late reply (I was ill).

Indeed the NC Console does not catch the ‘missing type errors’ right now and is something that needs to be improved upon. It is also something that I am working towards for the next version (along with some other workflow improvements like “search in graph”).
Hopefully, I might be able to also add some tool, to batch rename missing type nodes in a graph to the new correct type. This will of course still be done manually by entering the new serialized full type name, but at least it could be done in batch.

Having said that, there is already a useful attribute for handling this problem though, that attribute being [DeserializeFrom].
You can use this attribute on top of your Task class to specify the full type name from which to deserialize from (eg the previously Full type name).

Thus for example, if your task was MyNamespace.MyTask and you’ve renamed it to MyNamespace.MyAwesomeTask, you can solve this like this:

Note also, that the [DeserializeFrom] arguments is not a single string, but rather a params string[]. As such, if you later on further rename the task, you can provide all previous names for safety. For example:

Finally, [DeserializeFrom] works for everything serialized in a NodeCanvas graph, including nodes.

Let me know if that works for you.
Thanks and once again, sorry for the very late reply.

Join us on Discord: https://discord.gg/97q2Rjh