miho / VWorkflows

Flow Visualization Library for JavaFX and VRL-Studio
http://vworkflows.mihosoft.eu
Other
294 stars 67 forks source link

Loading project from XML issue #24

Open LaurentiuVasile opened 9 years ago

LaurentiuVasile commented 9 years ago

Hello Michael,

Lawrence here... So... In order to make the issue better understood i've took your first tutorial and just added a "SAVE" button to call saveToXML(Path p, VFlowModel flow) method, then adeded a button "load" to call loadFromXML(Path p).

Steps to reproduce:

1) Run the App class. 2) Save the flow by clicking save button. 3) Load the flow by clicking load button. (optional here close the nodes before).

Expected Result: The flow is created.

Actual Result: NullPointerException occurs.

Here is the code:

import java.io.IOException; import java.nio.file.Paths;

import javafx.application.Application; import javafx.event.EventHandler; import javafx.stage.Stage; import eu.mihosoft.vrl.workflow.FlowFactory; import eu.mihosoft.vrl.workflow.VFlow; import eu.mihosoft.vrl.workflow.VNode; import eu.mihosoft.vrl.workflow.fx.FXSkinFactory; import eu.mihosoft.vrl.workflow.io.WorkflowIO; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.input.MouseEvent; import jfxtras.labs.scene.layout.ScalableContentPane;

/*

I've also tried to load the flow direct from the xml from the beginning(loading the flow direct from the xml ), the same issue occurs

So i'm getting a NullPointerException

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at eu.mihosoft.vrl.workflow.io.WorkflowIO.toValueObject(WorkflowIO.java:389) at eu.mihosoft.vrl.workflow.io.WorkflowIO.createFlowFromPersistent(WorkflowIO.java:273) at eu.mihosoft.vrl.workflow.io.WorkflowIO.flowFromPersistentFlow(WorkflowIO.java:250) at eu.mihosoft.vrl.workflow.io.WorkflowIO.loadFromXML(WorkflowIO.java:115) at eu.mihosoft.vrl.workflow.io.WorkflowIO.loadFromXML(WorkflowIO.java:72) at aa.bc.App$2.handle(App.java:105) at aa.bc.App$2.handle(App.java:1) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source) at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source) at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source) at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source) at javafx.event.Event.fireEvent(Unknown Source) at javafx.scene.Scene$ClickGenerator.postProcess(Unknown Source) at javafx.scene.Scene$ClickGenerator.access$8300(Unknown Source) at javafx.scene.Scene$MouseHandler.process(Unknown Source) at javafx.scene.Scene$MouseHandler.access$1800(Unknown Source) at javafx.scene.Scene.impl_processMouseEvent(Unknown Source) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source) at com.sun.glass.ui.View.handleMouseEvent(Unknown Source) at com.sun.glass.ui.View.notifyMouse(Unknown Source) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.access$300(Unknown Source) at com.sun.glass.ui.win.WinApplication$4$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

(WorkflowIO.java:389) goes here (witch has the TODO that i was talking about)

public static ValueObject toValueObject(VNode node, PersistentValueObject vObj) { ValueObject result = new DefaultValueObject();

    result.setParent(node);
    // line 389
    result.setValue(vObj.getValue());
    // resulult. // .. TODO visualizationRequest isnot persistent! 11.01.2014

    return result;
}

If there is more information about this issue please do tell and thank you once again for the assistance.

Regards, Lawrence.

LaurentiuVasile commented 9 years ago

Hello Michael,

     Any updates on this issue ?

Regards, Lawrence.