StateFlowGraph should be serializable #77

Closed
amesbah opened this Issue Dec 18, 2012 · 5 comments

Projects

None yet

3 participants

@amesbah
Member
amesbah commented Dec 18, 2012

Making the StateFlowGraph serializable enables saving and restoring of the whole graph.

@amesbah amesbah was assigned Dec 18, 2012
@amesbah amesbah closed this Dec 20, 2012
@mehdimir

StateFlowGraph is no longer serializable because of class ExitNotifier. I tried to make ExitNotifier serializable (by making it implementing Serializable) however, I got another java.io.NotSerializableException error for class java.util.concurrent.CountDownLatch. I think this issue need to get reopened.

@mehdimir

I made all objects related to package java.util.concurrent transient. I Also made InputValue and FormInput implement Serializable. This avoids exception during Serialization. However, lack of lockRead/lockWrite lead to a malformed deserialization. For example, method toString raise exception on deserialized object.

@amesbah
Member
amesbah commented Oct 18, 2013

The SFG should actually be a graph; any concurrency logic/code should be moved out of this class.

@alexnederlof
Member

Our SFG implementation is not serializable and controls the locking/access mechanism to the underlying DirectedGraph<StateVertex, Eventable> which is serializable. If you want to serialize, you can use that object, not the our wrapping SFG.

@mehdimir

I am currently serializing sfg field of InMemoryStateFlowGraph. However, I ended up implementing methods like containsVertex, containsEdge, and equals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment