Home » Eclipse Projects » Sirius » Compilation error for expression XYZ, headless mode(Programmatically generating an SVG file of an diagram in Headless mode)
Compilation error for expression XYZ, headless mode [message #1706296] |
Tue, 25 August 2015 09:41  |
Eclipse User |
|
|
|
Hello,
i have a problem with generating an SVG file of a Diagram in headless mode (console version of eclipse). I've loaded the "aird" resource, the semantic model resource but during the running of the following code line
DRepresentation representation = dialectManager.createRepresentation("ProcessDiagram", eObject,
repDescription, session, new NullProgressMonitor());
I get a bunch of errors of the following pattern:
Compilation error for expression [self.XYZ()/] : Cannot find operation (XYZ()) for the type (ABC)
for example:
!MESSAGE Compilation error for expression [self.getActions()/] : Cannot find operation (getActions()) for the type (Process)
In normal Eclipse Workbench it is working, it could find the Methods. Do i have to do something special for the programmatic way of generating the diagram?
Thanks in advance.
Best regards
m.emin
|
|
|
Re: Compilation error for expression XYZ, headless mode [message #1706297 is a reply to message #1706296] |
Tue, 25 August 2015 09:51   |
Eclipse User |
|
|
|
Hi,
I need more details to help you. Then some questions :
- Which release of Sirius do you use?
- Can you show the code you execute to do SVG diagram export
programmatically in headless?
- Do you have the XYZ(), getActions() operation and the ABC, Process
EClasses in your classpath?
- If the previous XYZ(), getActions() operations are java services, you
can try service interpreter [1] instead of using Acceleo 3.
[1]
https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#specialized
Best Regards.
Le 25/08/2015 15:41, Emin M. a écrit :
> Hello,
>
> i have a problem with generating an SVG file of a Diagram in headless
> mode (console version of eclipse). I've loaded the "aird" resource, the
> semantic model resource but during the running of the following code line
>
> DRepresentation representation =
> dialectManager.createRepresentation("ProcessDiagram", eObject,
> repDescription, session, new NullProgressMonitor());
>
>
> I get a bunch of errors of the following pattern:
> Compilation error for expression [self.XYZ()/] : Cannot find operation
> (XYZ()) for the type (ABC)
>
> for example: !MESSAGE Compilation error for expression
> [self.getActions()/] : Cannot find operation (getActions()) for the type
> (Process)
>
>
> In normal Eclipse Workbench it is working, it could find the Methods. Do
> i have to do something special for the programmatic way of generating
> the diagram?
>
> Thanks in advance.
>
> Best regards
> m.emin
--
Esteban Dugueperoux - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Compilation error for expression XYZ, headless mode [message #1706302 is a reply to message #1706297] |
Tue, 25 August 2015 10:04   |
Eclipse User |
|
|
|
the version i am using is 2 (qualified 2.0.0.201410241344).
final RepresentationDescription repDescription = representationDescription;
editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
@Override
protected void doExecute() {
dAnalysisImpl.getModels().add(eObject);
dAnalysisImpl.getSelectedViews().add(representationContainer);
// Attach eObject to session see https://www.eclipse.org/forums/index.php/t/1068187/
eObject.eAdapters().add(new SessionTransientAttachment(session)); // experimentally..
DRepresentation representation = dialectManager.createRepresentation("ProcessDiagram", eObject, repDescription, session, new NullProgressMonitor());
representationContainer.getOwnedRepresentations().add(representation);
}
});
DRepresentation representation = representationContainer.getOwnedRepresentations().get(0); // experimentally..
DialectUIManager.INSTANCE.export(representation, session, Path.fromOSString(path + "testfile.svg"), new ExportFormat(ExportDocumentFormat.NONE, ImageFileFormat.SVG), new NullProgressMonitor());
Like i've tried to describe, it currently even can't generate the diagram. The exceptions are thrown in the line
DRepresentation representation = dialectManager.createRepresentation("ProcessDiagram", eObject, repDescription, session, new NullProgressMonitor());
representationContainer.getOwnedRepresentations().add(representation);
---- EDIT:
All needed bundles are listed as required bundles in my plugins dependencies.
[Updated on: Tue, 25 August 2015 10:07] by Moderator
|
|
| |
Re: Compilation error for expression XYZ, headless mode [message #1706391 is a reply to message #1706305] |
Wed, 26 August 2015 10:14   |
Eclipse User |
|
|
|
The update to sirius 3 caused dependency problems to other bundles that i need. So i reverted the update. I've also cleaned up the model, so it doesn't uses any acceleo expressions nor java services..
It fails now during the image generation in the following line
DialectUIManager.INSTANCE.export(representation, session, Path.fromOSString("C:\\Users\\mkaraman\\Desktop\\testfile.svg"), new ExportFormat(
ExportDocumentFormat.NONE, ImageFileFormat.SVG), new NullProgressMonitor());
How can i reach that the OffscreenEditPart will be used to generate it in headless mode, or are there any other ways to generate image in headless mode?
[Updated on: Wed, 26 August 2015 10:15] by Moderator
|
|
|
Re: Compilation error for expression XYZ, headless mode [message #1706469 is a reply to message #1706391] |
Thu, 27 August 2015 02:47   |
Eclipse User |
|
|
|
Hi,
Your snippet code seems correct and it uses already OffscreenEditPart in
headless. Can you give more details on the failure?
Best Regards.
Le 26/08/2015 16:14, Emin M. a écrit :
> The update to sirius 3 caused dependency problems to other bundles that
> i need. So i reverted the update. I've also cleaned up the model, so it
> doesn't uses any acceleo expressions nor java services..
>
> It fails now during the creation in the line
> DialectUIManager.INSTANCE.export(representation, session,
> Path.fromOSString("C:\\Users\\mkaraman\\Desktop\\testfile.svg"), new
> ExportFormat(
> ExportDocumentFormat.NONE, ImageFileFormat.SVG),
> new NullProgressMonitor());
>
> How can i reach that the OffscreenEditPart will be used to generate it
> in headless mode, or are there any other ways to generate image in
> headless mode?
--
Esteban Dugueperoux - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
| | | | |
Re: Compilation error for expression XYZ, headless mode [message #1706501 is a reply to message #1706499] |
Thu, 27 August 2015 08:21  |
Eclipse User |
|
|
|
I've found the problem and could solve it. For all others hwo encounter the same problem: I had to load the project bundle and trigger the import loading,
final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(eObject);
interpreter.setProperty("files", Collections.singletonList("/" + PLUGIN_ID + "/" PATH_TO_ODESIGN_FILE));
InterpreterRegistry.prepareImportsFromSession(interpreter, SessionManager.INSTANCE.getSession(eObject));
[Updated on: Thu, 27 August 2015 08:22] by Moderator
|
|
|
Goto Forum:
Current Time: Wed Jul 23 16:30:10 EDT 2025
Powered by FUDForum. Page generated in 0.04338 seconds
|