Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » oclxmi with ocl:///-URLs fails to load
oclxmi with ocl:///-URLs fails to load [message #1222032] Thu, 19 December 2013 07:58 Go to next message
Bastian Mising name is currently offline Bastian Mising nameFriend
Messages: 4
Registered: July 2009
Junior Member
Good Morning!

I came across some pairs of models, consisting of ecore and oclxmi files.
However, I’m wondering how to actually open the oclxmi file – I always get
the error 'java.net.MalformedURLException: unknown protocol: ocl', which
occurs on clicking nodes specified by tags like '<eType
xsi:type="ocl.ecore:OrderedSetType"
href="ocl:///oclenv.ecore#/1/OrderedSet(BOpParameter)"/>' in the oclxmi
file.
I've been trying to open the oclxmi file for nearly two days now...
Actually, I'd like to see the OCL expressions in the 'conventional'
notation.

What's the problem here? I guess it's some depencendy I'm mssing, right?
....or is there some basic misunderstanding of the file? I browsed the
tutorials, newsgroups and the web, but didn't find anything appropriate.

Thanks for helping!
Bastian
Re: oclxmi with ocl:///-URLs fails to load [message #1222091 is a reply to message #1222032] Thu, 19 December 2013 16:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You forgot to attach a demonstration project.
http://wiki.eclipse.org/OCL/ForumNetiquette

Regards

Ed Willink

On 19/12/2013 07:58, Bastian Ulke wrote:
> Good Morning!
>
> I came across some pairs of models, consisting of ecore and oclxmi
> files. However, I’m wondering how to actually open the oclxmi file – I
> always get the error 'java.net.MalformedURLException: unknown
> protocol: ocl', which occurs on clicking nodes specified by tags like
> '<eType xsi:type="ocl.ecore:OrderedSetType"
> href="ocl:///oclenv.ecore#/1/OrderedSet(BOpParameter)"/>' in the
> oclxmi file.
> I've been trying to open the oclxmi file for nearly two days now...
> Actually, I'd like to see the OCL expressions in the 'conventional'
> notation.
>
> What's the problem here? I guess it's some depencendy I'm mssing,
> right? ....or is there some basic misunderstanding of the file? I
> browsed the tutorials, newsgroups and the web, but didn't find
> anything appropriate.
>
> Thanks for helping!
> Bastian
Re: oclxmi with ocl:///-URLs fails to load [message #1222453 is a reply to message #1222091] Fri, 20 December 2013 13:10 Go to previous messageGo to next message
Bastian Mising name is currently offline Bastian Mising nameFriend
Messages: 4
Registered: July 2009
Junior Member
Sorry for that - you can find it attached to this message.
I'm actually wondring if the oclxmi files are supposed to be opened and
edited with some graphic editor. Am I right, that this is not the case?
  • Attachment: B.zip
    (Size: 3.10KB, Downloaded 136 times)
Re: oclxmi with ocl:///-URLs fails to load [message #1222474 is a reply to message #1222453] Fri, 20 December 2013 14:13 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I was surprised at the appearance of *.oclxmi, since my suspicion was
that it was more of a future intention once the problems of XMI
serialization for the OCL specification are resolved.

Perhaps it was used by the old IMP-based editor that migrated out of the
UMLX gtraphical project, but which has long since been superseded by the
Xtext editors in the OCL Examples and Editors add-on. These use a pivot
model to abstract away from Ecore/UML details. This is serializable and
at last loadable as *.oclas files. I chose 'Abstract Syntax' to avoid
the ambiguity as to whether it was the AS or CS in XMI and because the
oclxmi extension seems to be registered already.

Opening your file in the Sample Reflective Editor passes the acid test
that is loadable (apart from two containment validation bugs in 'your'
model).

One of the problems with OCL serialization as XMI arises in where to
contain synthesized types such as Set(String) and Tuple{name:String}.
The classic OCL with Ecore support creates these all as shared orphans
and requires the user of an OCL AST to reparent them. The
ocl:///oclenv.ecore#/1/OrderedSet(BOpParameter) is the consequence of a
failure to reparent the synthetic OrderedSet(BOpParameter) type before
saving. From the org.eclipse.ocl.AbstractTypeResolver code:

/**
* Creates the resource that persists my generated types.
Subclasses requiring
* persistence must override this default implementation, as it
creates a
* resource that does not support persistence and does not have a
useful URI.
* A subclass could even find some other resource, such as the model on
* which constraints are being parsed, if desired.
*
* @return the new resource
*/
protected Resource createResource() {
return new ResourceImpl(URI.createURI("ocl:///oclenv"));
//$NON-NLS-1$
}

(The Ecore and UML overrides are not helpful.)

The new pivot-based support creates an additional "$$" EPackage in which
all orphans are cloned prior to saving so that references to them can be
terminated locally. The equivalent junk URI is
http://www.eclipse.org/ocl/3.1.0/orphanage#... but it exists and is
provided as part of the saved file.

If you really want to play with OCL at the XMI level, I recommend that
you use the pivot-based support in the examples plugins. You can create
an XMI file by using the right button SaveAS within the Complete OCL
editor. The XMI is not yet stable, but it solves many of the problems.
For stability stick to OCL text interchange.

If you really want to see the original OCL, 59 lines of XMI is not hard
to reverse compile. But more realistically you want to track down the
bad production mechanism.

Regards

Ed Willink




On 20/12/2013 13:10, Bastian Ulke wrote:
> Sorry for that - you can find it attached to this message.
> I'm actually wondring if the oclxmi files are supposed to be opened
> and edited with some graphic editor. Am I right, that this is not the
> case?
Previous Topic:Transform OCL into some text
Next Topic:Using OCLHelper and OCL API... Simple working example !?
Goto Forum:
  


Current Time: Fri Apr 19 02:02:59 GMT 2024

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

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

Back to the top