Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL query creation fails when using UML profile
OCL query creation fails when using UML profile [message #1715211] Fri, 20 November 2015 09:36
Jens Bürger is currently offline Jens BürgerFriend
Messages: 55
Registered: October 2012
Member
Hello everyone,

I have UML models using UML profiles, for example a state machine and annotations at transitions. I want to evaluate OCL conditions programmatically using the pivot implementation.
As discussed in this thread, this should work and indeed does actually work in the OCL Xtext console.
But programmatically, evaluating "ordinary" queries like
Transition.allInstances()
does work fine, but as soon as the profile element is involved, even creation of the query fails:
Query (for example):

Transition.allInstances().extension_ensureRole->excluding(null).role

Beginning of the stack trace:
org.eclipse.ocl.pivot.utilities.SemanticException: The 'UML::StateMachine' constraint is invalid: 'Transition.allInstances().extension_ensureRole->excluding(null).role'
1: Unresolved Property 'Set(UML::Transition[*|1])::extension_ensureRole'
	at org.eclipse.ocl.pivot.utilities.PivotUtil.checkResourceErrors(PivotUtil.java:144)
	at org.eclipse.ocl.pivot.internal.context.AbstractParserContext.parse(AbstractParserContext.java:154)
	at org.eclipse.ocl.pivot.internal.helper.OCLHelperImpl.createQuery(OCLHelperImpl.java:145)
...

So, this is the same error as we had in the abovementioned thread bevor the fix to the OCL implementation.

I am using Eclipse Mars .1 and the OCL pivot implementation (1.0.1.v20150907-1007) .

Eclipse project containing source code, test model and UML profile is attached.
  • Attachment: ocltest.zip
    (Size: 11.90KB, Downloaded 183 times)
Previous Topic:Let statements for collection of collections
Next Topic:How to use Pivot OCL thread-safely?
Goto Forum:
  


Current Time: Thu Apr 25 21:38:03 GMT 2024

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

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

Back to the top