use of org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphFileIndexer method fillIndexBuilder.
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final GuidedDecisionTableEditorGraphModel model = GuidedDTGraphXMLPersistence.getInstance().unmarshal(content);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final GuidedDecisionTableGraphModelIndexVisitor visitor = new GuidedDecisionTableGraphModelIndexVisitor(builder, model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder, visitor);
return builder;
}
use of org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel in project drools-wb by kiegroup.
the class GuidedDTGraphXMLPersistenceTest method checkUnmarshallingEmptyString.
@Test
public void checkUnmarshallingEmptyString() {
final GuidedDecisionTableEditorGraphModel model = GuidedDTGraphXMLPersistence.getInstance().unmarshal("");
assertEmptyModel(model);
}
use of org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel in project drools-wb by kiegroup.
the class GuidedDTGraphXMLPersistenceTest method checkUnmarshallingModel.
@Test
public void checkUnmarshallingModel() {
final GuidedDecisionTableEditorGraphModel model = GuidedDTGraphXMLPersistence.getInstance().unmarshal(emptyModelXml);
assertEmptyModel(model);
}
use of org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel in project drools-wb by kiegroup.
the class GuidedDTGraphXMLPersistenceTest method checkUnmarshallingNull.
@Test
public void checkUnmarshallingNull() {
final GuidedDecisionTableEditorGraphModel model = GuidedDTGraphXMLPersistence.getInstance().unmarshal(null);
assertEmptyModel(model);
}
use of org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel in project drools-wb by kiegroup.
the class GuidedDTGraphXMLPersistenceTest method checkMarshallingModelWithEntryPosition.
@Test
public void checkMarshallingModelWithEntryPosition() {
final Path path = PathFactory.newPath("path", "default://path");
final GuidedDecisionTableEditorGraphModel model = new GuidedDecisionTableEditorGraphModel();
model.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(path, path, 100.0, 200.0));
final String xml = GuidedDTGraphXMLPersistence.getInstance().marshal(model);
assertNotNull(xml);
assertEqualsIgnoreWhitespace("<graph>\n" + " <entries>\n" + " <entry>\n" + " <pathHead class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\">\n" + " <uri>default://path</uri>\n" + " <fileName>path</fileName>\n" + " <attributes/>\n" + " <hasVersionSupport>false</hasVersionSupport>\n" + " </pathHead>\n" + " <pathVersion class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\" reference=\"../pathHead\"/>\n" + " <x>100.0</x>\n" + " <y>200.0</y>\n" + " </entry>\n" + " </entries>\n" + "</graph>", xml);
}
Aggregations