Running in the context of an Eclipse Plugin

Dear,

I’ve used testXMLGraph.java as a basis for integrating my CloverETL graph into my new Eclipse Plugin. My graph run perfectly at design time on the graph designer GUI and also when running from a normal java main().

The problem arises when I’m trying to run the graph inside my Eclipse RCP product. Every references to files done at design time, like connection, workspace.prm, metadata can’t be found. The graph engine seem unable to load it’ workspace.prm file. Look like it lost north, can’t load files from a relative path. Any idea how to handle that?

I’ve tried to load workspace.prm manually into TransformationGraph with:
graph.loadGraphProperties(prop), using
Bundle bundle = Activator.getDefault().getBundle();
URL installURL = bundle.getEntry(“/”);
url = new URL(installURL, “workspace.prm”);

The porperties are laoding at first, then I got this message: Can’t load property definition from workspace.prm.

Thanks for helping
Pierre

First of all, are you sure, the graph xml file and all related files are deployed in unzipped form?

Please, try to pass a parameter called PROJECT_DIR to the clover engine. This parameter and its value is usually used to resolve all relative path in the graph xml definition.

I’m not sure how do you run your graph, for instance you use runGraph class to run a graph, pass a “-P:PROJECT_DIR=/path/to/root/folder/of/project” to the command line.

With best regards, Martin

Thank for your answer.

In fact, I had to use PROJECT_DIR properties at a place I didn’t figured at first. as in the java example, I was creating TransformationGraphXMLReaderWriter using null. Now I’m doing this and Eclipse is happy running my graph inside my plugin.

A great thank you for the hour your answer will save me ;).

Pierre

Properties props = new Properties();
props.put(“PROJECT_DIR”, Activator.getDefault().getPluginPath());
TransformationGraphXMLReaderWriter graphReader = new TransformationGraphXMLReaderWriter(props);
TransformationGraph graph = new TransformationGraph();

try {
FileInputStream fis = new FileInputStream(Activator.getDefault().getPluginPath() + GRAPH_NAME);
graph = graphReader.read(fis);