|
Re: Is nsURI for Pivot Package elements mandatory? [message #1268411 is a reply to message #1268402] |
Mon, 10 March 2014 13:18 |
Ed Willink Messages: 7671 Registered: July 2009 |
Senior Member |
|
|
HI
UML used to have no URIs which required Tag fudges. UML does now have URIs.
Ecore has always had URIs that you could omit until you get an NPE in
genmodel.
OCL (the pivot prototype for OCL 2.5) uses URIs as the mechanism to
determine when Complete OCL packages are merged or not; same URI, same
logical Package. The URI is just an identifier so any character sequence
should do. Conventionally, as with java packages you should avoid
clashes with other users by following a hierarchical scope such as
http://www.soyatec.com/...
in the hope that non-soyatec.com applications will not use soyatec.com
prefixes. How you allocate names within the soyatec.com namespace is for
you and your IT to decide.
Regards
Ed Willink
On 10/03/2014 13:05, Felix Dorner wrote:
> Hi,
>
> As opposed to UML/Ecore, our concept of 'Package' doesn't have an
> nsURI attribute. I transform our Package elements into Pivot Package
> elements, but don't set the nsURI attribute. Now I have assertion
> errors in the packageserver.assertSamePackage.
>
> Just to test, I generate a random uri for each pivot package and the
> errors go away. I still need to look deeper at the code to try finding
> out what the manager is all about...
>
> Is nsURI a mandatory attribute? If so, are there any assumptions on
> how these uris look like? (E.g. hierarchical, with package names as
> segments).
>
>
>
> Thanks,
> Felix
|
|
|
|
Re: Is nsURI for Pivot Package elements mandatory? [message #1269238 is a reply to message #1268402] |
Tue, 11 March 2014 15:20 |
Felix Dorner Messages: 295 Registered: March 2012 |
Senior Member |
|
|
Hi,
On 10/03/2014 14:05, Felix Dorner wrote:
> As opposed to UML/Ecore, our concept of 'Package' doesn't have an nsURI
> attribute. I transform our Package elements into Pivot Package elements,
> but don't set the nsURI attribute. Now I have assertion errors in the
> packageserver.assertSamePackage.
I now generate an URI string for all packages in the model, but I think
I found something fishy:
In CompleteOCLCSContainmentVisitor.refreshContextPackage(), the name of
the Pivot package is taken literally from the name of the CSPackage,
lines 274:276. If the CSPackage name is an escaped id (_'package'), the
parent PackageServer doesn't find it in the packageServers map (since
that uses the _unescaped_ name as the key), and tries to register a new
NestedPackageServer for the same package (same as in 'same URI'), which
triggers the AssertionError.
Is there a helper to unescape the package name? Should I report a bug?
Felix
|
|
|
Re: Is nsURI for Pivot Package elements mandatory? [message #1269250 is a reply to message #1269238] |
Tue, 11 March 2014 15:38 |
Ed Willink Messages: 7671 Registered: July 2009 |
Senior Member |
|
|
Hi
The name escaping should occur between the Complete OCL source text and
the CS model, where arbitrary character sequences are permitted as
names. The only exception is legacy support for simple underscore
prefixes where double lookups are sometimes performed.
See
org.eclipse.ocl.examples.xtext.essentialocl.services.EssentialOCLValueConverterService$AbstractIDConverter.
If you have a bug please raise a Bugzilla with a repro.
Regards
Ed Willink
On 11/03/2014 15:20, Felix Dorner wrote:
> Hi,
>
> On 10/03/2014 14:05, Felix Dorner wrote:
>
>> As opposed to UML/Ecore, our concept of 'Package' doesn't have an nsURI
>> attribute. I transform our Package elements into Pivot Package elements,
>> but don't set the nsURI attribute. Now I have assertion errors in the
>> packageserver.assertSamePackage.
>
> I now generate an URI string for all packages in the model, but I
> think I found something fishy:
>
> In CompleteOCLCSContainmentVisitor.refreshContextPackage(), the name
> of the Pivot package is taken literally from the name of the
> CSPackage, lines 274:276. If the CSPackage name is an escaped id
> (_'package'), the parent PackageServer doesn't find it in the
> packageServers map (since that uses the _unescaped_ name as the key),
> and tries to register a new NestedPackageServer for the same package
> (same as in 'same URI'), which triggers the AssertionError.
>
> Is there a helper to unescape the package name? Should I report a bug?
>
> Felix
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03871 seconds