If an exception is launched the values of ValueInput are losts [2.9.0, 2.9.2]

FlowCanvas Forums Support If an exception is launched the values of ValueInput are losts [2.9.0, 2.9.2]

  • This topic has 3 replies, 2 voices, and was last updated 6 years ago by Gavalakis.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2309
    toto007
    Participant

      If an exception is launched the values of ValueInput  are losts.

      For reproduce the bug I add a variable “duration” of type ValueInput in class ANDMERGE, initialized this value from inspector the graph and launch a generic exception. After I remove the exception, the value in variable “duration” is lost. What I expect the value is persisted.
      I have prepared a video that reproduces the problem:

      I tested this bug in 2.9.0 and 2.9.2 (I had read that a similar bug was there in the 2.9.1)

      #2311
      Gavalakis
      Keymaster

        Hello,

        Just to explain what is going on, if you open up FlowNode.cs and take a look at the “GatherPorts” method, you will see that “RegisterPorts” is called within, and right after that, the “DeserializeInputPortValues” is called. If of course an exception is thrown within the RegisterPorts implementation, the “DeserializeInputPortValues” is never called and thus the port values (of this particular node) are lost since the graph is then serialized back.

        There is an exception handling per node registration (so that if one node throws an exception the rest proceed normally), but to avoid what is happening in a per-node basis when an exception is thrown, there will need to exist yet another exception handling. Changing the “GatherPorts” method to be like the following will effectively work the way you suggest (make port serialization perist):

        I don’t really like this solution a lot though. Let me know what you think.
        Thanks.

        #2318
        toto007
        Participant

          Thank you for your reply.

          The solution resolve in part the problem. When the exception is not verified the data of valueinput are restore correctly  but the connections are lost.

          This video reproduce of issue:

          #2322
          Gavalakis
          Keymaster

            Hello again,

            This is the only way to handle this correctly (even though it’s ugly):

            Let me know what you think.
            Thanks.

          Viewing 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.