Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Opening UML meta-model using oclInEcore editor
Opening UML meta-model using oclInEcore editor [message #1062523] Sat, 08 June 2013 08:56 Go to next message
Capi Tali is currently offline Capi Tali
Messages: 38
Registered: February 2012
Member
Hello everyone,
I try to open the UML ecore meta-model (imported from org.eclipse.uml2.uml) using oclInEcore editor and I got the following error:

Error
Sat Jun 08 10:11:13 CEST 2013
OCL in Ecore Editor linking error

java.lang.NullPointerException
	at org.eclipse.ocl.examples.pivot.utilities.PivotUtil.refreshList(PivotUtil.java:1021)
	at org.eclipse.ocl.examples.pivot.utilities.AbstractConversion.refreshList(AbstractConversion.java:72)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.BasePostOrderVisitor.visitAnnotationCS(BasePostOrderVisitor.java:131)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.BasePostOrderVisitor.visitAnnotationCS(BasePostOrderVisitor.java:1)
	at org.eclipse.ocl.examples.xtext.base.baseCST.impl.AnnotationCSImpl.accept(AnnotationCSImpl.java:219)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1295)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1293)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1293)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1293)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1293)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.update(CS2PivotConversion.java:1201)
	at org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2Pivot.update(CS2Pivot.java:505)
	at org.eclipse.ocl.examples.xtext.base.utilities.CS2PivotResourceAdapter.refreshPivotMappings(CS2PivotResourceAdapter.java:129)
	at org.eclipse.ocl.examples.xtext.base.utilities.CS2PivotLinker.afterModelLinked(CS2PivotLinker.java:69)
	at org.eclipse.xtext.linking.impl.AbstractCleaningLinker.linkModel(AbstractCleaningLinker.java:44)
	at org.eclipse.xtext.resource.XtextResource.doLinking(XtextResource.java:279)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLinking(LazyLinkingResource.java:82)
	at org.eclipse.ocl.examples.xtext.essentialocl.utilities.EssentialOCLCSResource.doLinking(EssentialOCLCSResource.java:98)
	at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:247)
	at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:237)
	at org.eclipse.xtext.resource.XtextResource.update(XtextResource.java:218)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconcilerUnitOfWork.process(XtextReconcilerUnitOfWork.java:55)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconcilerUnitOfWork.process(XtextReconcilerUnitOfWork.java:1)
	at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:36)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.modify(AbstractReadWriteAcces.java:49)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:181)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:90)
	at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.reconcile(XtextDocumentReconcileStrategy.java:44)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(XtextReconciler.java:254)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)


Would you please point out what the problem is and how to fix it?
Many thanks.
Re: Opening UML meta-model using oclInEcore editor [message #1062528 is a reply to message #1062523] Sat, 08 June 2013 09:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4098
Registered: July 2009
Senior Member
Hi

The OCLinEcore editor is primarily intended for OCL embedded with an
Ecore file, either as an *.ecoire XMI file or as a *.oclinecore text file.

Upgrading the functionality to a textual view of UML classes with
embedded OCL is still on the to-do list.

If you want to editing support for OCL in UML use the Kepler
(pre-release) of Papyrus.

If you want to complement an existing UML model, use the Complete OCL
editor.

Regards

Ed Willink


On 08/06/2013 09:57, Capi Tali wrote:
> Hello everyone,
> I try to open the UML ecore meta-model (imported from
> org.eclipse.uml2.uml) using oclInEcore editor and I got the following
> error:
> Error
> Sat Jun 08 10:11:13 CEST 2013
> OCL in Ecore Editor linking error
>
> java.lang.NullPointerException
> at
> org.eclipse.ocl.examples.pivot.utilities.PivotUtil.refreshList(PivotUtil.java:1021)
> at
> org.eclipse.ocl.examples.pivot.utilities.AbstractConversion.refreshList(AbstractConversion.java:72)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.BasePostOrderVisitor.visitAnnotationCS(BasePostOrderVisitor.java:131)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.BasePostOrderVisitor.visitAnnotationCS(BasePostOrderVisitor.java:1)
> at
> org.eclipse.ocl.examples.xtext.base.baseCST.impl.AnnotationCSImpl.accept(AnnotationCSImpl.java:219)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1295)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1293)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1293)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1293)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.visitInPostOrder(CS2PivotConversion.java:1293)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2PivotConversion.update(CS2PivotConversion.java:1201)
> at
> org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2Pivot.update(CS2Pivot.java:505)
> at
> org.eclipse.ocl.examples.xtext.base.utilities.CS2PivotResourceAdapter.refreshPivotMappings(CS2PivotResourceAdapter.java:129)
> at
> org.eclipse.ocl.examples.xtext.base.utilities.CS2PivotLinker.afterModelLinked(CS2PivotLinker.java:69)
> at
> org.eclipse.xtext.linking.impl.AbstractCleaningLinker.linkModel(AbstractCleaningLinker.java:44)
> at
> org.eclipse.xtext.resource.XtextResource.doLinking(XtextResource.java:279)
> at
> org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLinking(LazyLinkingResource.java:82)
> at
> org.eclipse.ocl.examples.xtext.essentialocl.utilities.EssentialOCLCSResource.doLinking(EssentialOCLCSResource.java:98)
> at
> org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:247)
> at
> org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:237)
> at
> org.eclipse.xtext.resource.XtextResource.update(XtextResource.java:218)
> at
> org.eclipse.xtext.ui.editor.reconciler.XtextReconcilerUnitOfWork.process(XtextReconcilerUnitOfWork.java:55)
> at
> org.eclipse.xtext.ui.editor.reconciler.XtextReconcilerUnitOfWork.process(XtextReconcilerUnitOfWork.java:1)
> at
> org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:36)
> at
> org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.modify(AbstractReadWriteAcces.java:49)
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:181)
> at
> org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:90)
> at
> org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.reconcile(XtextDocumentReconcileStrategy.java:44)
> at
> org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(XtextReconciler.java:254)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
>
> Would you please point out what the problem is and how to fix it? Many
> thanks.
Re: Opening UML meta-model using oclInEcore editor [message #1062529 is a reply to message #1062528] Sat, 08 June 2013 10:39 Go to previous messageGo to next message
Capi Tali is currently offline Capi Tali
Messages: 38
Registered: February 2012
Member
Thanks for your help. The Complete OCL editor works well for me. One more question please. I know that OCL is a side-effect free language which means that there is no dynamic creation of objects. However, I wonder if there's a support to create somehow a temporary meta-class (not existed in the meta-model) and evaluate some constraints on it?
Best regards,

[Updated on: Sat, 08 June 2013 10:41]

Report message to a moderator

Re: Opening UML meta-model using oclInEcore editor [message #1062532 is a reply to message #1062529] Sat, 08 June 2013 10:48 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4098
Registered: July 2009
Senior Member
Hi

No. If the meta-class does not exist, why would you want to constrain it.

It seems like you're doing something you haven't sensibly explained, so
I cannot give a helpful answer.

Regards

Ed Willink


On 08/06/2013 11:39, Capi Tali wrote:
> Thanks for your help. The Complete OCL editor works well for me. One
> more question please. I know that OCL is a side-effect free language
> which means that there is no dynamic creation of objects. I wonder if
> there's a way to create a temporary meta-class (not existed in the
> meta-model) and evaluate some constraints on it?
> Best regards,
Re: Opening UML meta-model using oclInEcore editor [message #1062534 is a reply to message #1062532] Sat, 08 June 2013 11:42 Go to previous messageGo to next message
Capi Tali is currently offline Capi Tali
Messages: 38
Registered: February 2012
Member
Thank you for your answer.
Well, in some situations that I encountered, I have to evaluate some constraints on the concept that does not exist in the defined language. Let's say in the meta-model we have two groups of meta-classes: A1,A2,...,An and B1,B2,...,Bn. The notion of "group", which encompasses a set of meta-classes, obviously does not exist at the meta level but a possible constraint could be, let's say "GroupA must have certain relationships with GroupB". Do you have any idea on this?

If the dynamic addition of meta-class is impossible then I have another question: Imagine we have the meta-class Group at the meta-model. Could we somehow declare a new Group object at the model-level and evaluate some constraints on it? For instance, the syntax could be somehow like: let Group g = new Group(a1: A1, a2: A2,...) in evaluate(g).

Best regards.
Re: Opening UML meta-model using oclInEcore editor [message #1062734 is a reply to message #1062534] Mon, 10 June 2013 14:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4098
Registered: July 2009
Senior Member
Hi

Perhaps profiles and stereotypes are what you should use.

Regards

Ed Willink


On 08/06/2013 12:42, Capi Tali wrote:
> Thank you for your answer.
> Well, in some situations that I encountered, I have to evaluate some
> constraints on the concept that does not exist in the defined
> language. Let's say in the meta-model we have two groups of
> meta-classes: A1,A2,...,An and B1,B2,...,Bn. The notion of "group",
> which encompasses a set of meta-classes, obviously does not exist at
> the meta level but a possible constraint could be, let's say "GroupA
> must have certain relationships with GroupB". Do you have any idea on
> this?
>
> If the dynamic addition of meta-class is impossible then I have
> another question: Imagine we have the meta-class Group at the
> meta-model. Could we somehow declare a new Group object at the
> model-level and evaluate some constraints on it? For instance, the
> syntax could be somehow like: let Group g = new Group(a1: A1, a2:
> A2,...) in evaluate(g).
>
> Best regards.
>
Re: Opening UML meta-model using oclInEcore editor [message #1062912 is a reply to message #1062734] Tue, 11 June 2013 11:38 Go to previous messageGo to next message
Capi Tali is currently offline Capi Tali
Messages: 38
Registered: February 2012
Member
Actually I found this thread similar to what I asked:
http://www.eclipse.org/forums/index.php/m/668407/
According to that, I understand that with the actual version of OCL, we can not declare new objects but only new collections and tuples. Could you confirm on this point?
I think the Stereotypes of Profiles are good solutions for this problem in UML. However, the extension mechanism support of domain-specific languages is very limited.

Best regards,
Re: Opening UML meta-model using oclInEcore editor [message #1062918 is a reply to message #1062912] Tue, 11 June 2013 11:49 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4098
Registered: July 2009
Senior Member
Hi

The new Pivot-based OCL which is used in Papyrus, has a prototype
implementation of constructors as suggested by
http://www.omg.org/issues/ocl2-rtf#Issue13057. This re-uses the Tuple
syntax, so you may be able to do

Person{name='aName',age=20}

Regards

Ed Willink


On 11/06/2013 12:38, Capi Tali wrote:
> Actually I found this thread similar to what I asked:
> http://www.eclipse.org/forums/index.php/m/668407/
> According to that, I understand that with the actual version of OCL,
> we can not declare new objects but only new collections and tuples.
> Could you confirm on this point? I think the Stereotypes of Profiles
> are good solutions for this problem in UML. However, the extension
> mechanism support of domain-specific languages is very limited.
> Best regards,
>
Re: Opening UML meta-model using oclInEcore editor [message #1062923 is a reply to message #1062918] Tue, 11 June 2013 12:06 Go to previous message
Capi Tali is currently offline Capi Tali
Messages: 38
Registered: February 2012
Member
Many thanks.
Previous Topic:Loading UML-Model with papyrus-profile applied
Next Topic:UML profile with OCL constraints on stereotypes
Goto Forum:
  


Current Time: Sun Oct 26 02:03:42 GMT 2014

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

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