Hi,
Is it possible to read the properties from the graph file, BEFORE loading it. I am trying to get a list of the properties in the XML file to present to the user as configurable variables. Once the user has filled in the values, I then load the graph with these variables.
Here is the code I am using to get the properties at the moment, but I get warnings about the properties not being defined
===========
Thanks
Des
Is it possible to read the properties from the graph file, BEFORE loading it. I am trying to get a list of the properties in the XML file to present to the user as configurable variables. Once the user has filled in the values, I then load the graph with these variables.
Here is the code I am using to get the properties at the moment, but I get warnings about the properties not being defined
try {
EngineInitializer.initEngine("plugins", null, null);
TransformationGraph graph = TransformationGraphXMLReaderWriter.loadGraph(graphXMLFile, runtimeContext.getAdditionalProperties());
TypedProperties currentGraphProperties = graph.getGraphProperties();
System.out.println("Properties = " + currentGraphProperties);
} catch (XMLConfigurationException xmle){
System.out.println("BuyerAdaptor Upload - graph XMLConfigurationException " + xmle);
} catch (GraphConfigurationException gce) {
System.out.println("BuyerAdaptor Upload - graph GraphConfigurationException" + gce);
}
===========
WARN 16-06 13:18:29,136 (PropertyRefResolver.java:resolveRef2:214) -Can't resolve reference to graph property: SUPPLIER.FILE.ID
Thanks
Des
-
Unfortunately we don't have any specialized graph properties reader, which you can use in your case. We haven't need it before. Nonetheless, it shouldn't be so complicated to write your own. Check TransformationGraphXMLReaderWriter.instantiateProperties() method. This method tries to resolve all parameter references, what is in fact undesirable in your case (if I understand well what's your point).
Martin -
Martin
Thanks for the reply. I guess a simple XML ready would also do the trick?
Thanks
Des
Please sign in to leave a comment.
Comments 2