Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Customized Helper Methods in EmbeddedXtextEditor
Customized Helper Methods in EmbeddedXtextEditor [message #1716314] Wed, 02 December 2015 21:28 Go to next message
Daria Giacinto is currently offline Daria GiacintoFriend
Messages: 7
Registered: July 2015
Junior Member
Hi,

I'm using a customized EcoreEnvironment/EcoreEvaluationEnvironment/EcoreEnvironmentFactory to validate OCL constraints programmatically with the help of Java helper methods. Additionally, I integrated the EmbeddedXtextEditor to define OCL constraints. Hence, I am looking for a way to integrate the helper methods in order that these methods are supported by the EmbeddedXtextEditor. Do I have to extend the OCL standard library and use the org.eclipse.ocl.pivot.standard_library extension point? Or is there no possibility to extend this EmbeddedXtextEditor for customized operations?

Best regards

Daria
Re: Customized Helper Methods in EmbeddedXtextEditor [message #1716516 is a reply to message #1716314] Fri, 04 December 2015 13:57 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6040
Registered: July 2009
Senior Member
Hi

a) CGed custom library

If you have a significant amount of Java and usage you could generate
your own customized library in similar style to

GIT\org.eclipse.ocl\examples\org.eclipse.ocl.examples.codegen\model\CGLibrary.oclstdlib
GIT\org.eclipse.qvtd\plugins\org.eclipse.qvtd.pivot.qvtimperative\model\QVTimperativeLibrary.oclstdlib

The MWE/Xtend scripts that support generating Java for custom libraries
was fixed for Mars.

QVTimperativeLibrary is automatically in use within the *.qvti Xtext
editor so it probably provides most of the tricks that you need to
replicate.

b) Dynamic custom library

Alternatively you can define a custom library and use it by an import.
see for instance testImport_CompleteOCL_custom_OCLstdlib in
GIT\org.eclipse.ocl\tests\org.eclipse.ocl.examples.xtext.tests\src\org\eclipse\ocl\examples\test\xtext\ImportTests.java

The advantage of a custom library is that you need just two declarations:

1) an 'OCL' declaration of what can be used in OCL and a redirection to
a Java class
operation getSeverity() : Integer[1] =>
'org.eclipse.ocl.pivot.library.string.CGStringGetSeverityOperation';
2) the Java class on the class path that complies with (a refinement of)
the LibraryOperation API.

c) Embedded OCLinEcore

Much easier is just to bury your added value into your models using the
OCLinEcore editor.

Regards

Ed Willink


On 02/12/2015 21:28, Daria Giacinto wrote:
> Hi,
>
> I'm using a customized
> EcoreEnvironment/EcoreEvaluationEnvironment/EcoreEnvironmentFactory to
> validate OCL constraints programmatically with the help of Java helper
> methods. Additionally, I integrated the EmbeddedXtextEditor to define
> OCL constraints. Hence, I am looking for a way to integrate the helper
> methods in order that these methods are supported by the
> EmbeddedXtextEditor. Do I have to extend the OCL standard library and
> use the org.eclipse.ocl.pivot.standard_library extension point? Or is
> there no possibility to extend this EmbeddedXtextEditor for customized
> operations?
>
> Best regards
>
> Daria
Re: Customized Helper Methods in EmbeddedXtextEditor [message #1719247 is a reply to message #1716516] Wed, 06 January 2016 15:05 Go to previous messageGo to next message
Daria Giacinto is currently offline Daria GiacintoFriend
Messages: 7
Registered: July 2015
Junior Member
Hi,

c) is not appropriate for my problem but I have tried a) and b).

However, I am running into a few problems. Hence, I created two small examples what I have tried and included some text files with more detailed information.

Thanks in advance for your help.

Best regards

Daria
Re: Customized Helper Methods in EmbeddedXtextEditor [message #1721553 is a reply to message #1719247] Thu, 28 January 2016 09:48 Go to previous message
Sebastian Lehrig is currently offline Sebastian LehrigFriend
Messages: 16
Registered: July 2012
Junior Member
*push* have the same issue like Daria for her "CustomLibraryDynamic.zip" case Sad
Previous Topic:Extend OCL
Next Topic:EMF validation with several OCL documents
Goto Forum:
  


Current Time: Sat Sep 22 11:56:00 GMT 2018

Powered by FUDForum. Page generated in 0.01361 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top