**assuming ** your file is in your eclipse runtime workspace, this can be
done much, much simpler :
IPath path = new Path(
"/home/damien/Workspaces/BPEL/org.example.loadbpel/bpel/ldiplom.bpel");
IFile bpelFile = ResourcesPlugin.getWorkspace().getRoot().getFile
(path);
loadBPEL(bpelFile);).
protected Process loadBPEL(IFile bpelFile) {
ResourceSet fResourceSet = new BPELResourceSetImpl();
IPath fullProcessPath = bpelFile.getFullPath();
URI uri = URI.createPlatformResourceURI
(fullProcessPath.toString(), false);
bpelResource = fResourceSet.getResource(uri, true);
EcorePackage instance = EcorePackage.eINSTANCE;
instance.eAdapters();
try {
bpelResource.load(Collections.EMPTY_MAP);
EList<EObject> contents = bpelResource.getContents();
if (!contents.isEmpty()) {
return (Process) contents.get(0);
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Alternatively, *if* you want to launch whatever you are doing using a
right-click menu on the bpel process, let me know, I can send you a sample
plug-in for that, too.