Activating container() support in OCL*Delegates and OCLConsole [message #666838] |
Sat, 23 April 2011 00:08 |
|
I use the container relationship intentionally in one of my ecore models to enforce a well-formedness rule.The structure is of the form A contains 1 B and A contains 1 C. I need to navigate from B and C to A to express some additional WFR. I would like to use the property for it, but it is not available in OCL.
What do I know about this issue?
- I can add a derived reference and implement it in Java. This means I need to introduce a technical artifact into the model to work around an infrastructure issue.
- I can convert the composition to references and then use opposed references. That means I have to restructure my model to work around an infrastructure issue.
- The problem can be solved by having the OCL infrastructure configured for properties of EOBJECT, as shown in the FAQ:How do I invoke methods such as eContainer(), eContents(), eGet()?
I have three questions:
- Can the OCL*Delegates be configured to accept the additional properties of EOBJECT, as described in the FAQ?
- Can the OCL Console that I use for type-checking be configured to accept the additional properties of EOBJECT, as described in the FAQ?
- If not, where and how do these components need to be patched to allow this behaviour?
Help is appreciated, as I like OCL and would like to promote it in practice, but this issue is a blocker on my project, and I will have to scrap OCL use if I cannot get it to work.
|
|
|
Re: Activating container() support in OCL*Delegates and OCLConsole [message #666842 is a reply to message #666838] |
Sat, 23 April 2011 05:34 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Joern
Under what timescales is this a blocker?
The Indigo release has much more comprehensive support for the Xtext
editors with an Xtext-based OCL Console, an extensible modelled OCL
Standard Library and a UML-derived highly OMG compliant pivot model
representation hiding the eccentricities of Ecore and UML.
eContainer() should never have been visible in Eclipse OCL.
container() should never be visible in OMG OCL; it's a MOF operation and
MOF is not part of thge UML package merge.
The modelled library for Indigo M6 therefore has oclContainer() and
oclContents() which might eventually make it into OMG OCL. No further
action required to use them.
This functionality is all part of a prototype resolving some major
mostly behind-the-scenes problems in the OCL specification. It is
therefore part of the Examples and Editors optional feature. It is
planned to move it from examples to core functionality for Juno.
To make the functionality available for the old console probably just
requires a one/two line (menu-driven) options zap when the OCL facade is
created. But you'll also hit the problem that the old console has no
Load Resource... for Complete OCL.
Hope you can wait for Indigo (June release, M6 now, M7 two weeks).
[For the specific problem of opposites, you may add oppositeRoleName
annotations to your Ecore model so that OCL can use the missing names. ]
Regards
Ed Willink
On 23/04/2011 01:08, Joern Guy Suess wrote:
> I use the container relationship intentionally in one of my ecore
> models to enforce a well-formedness rule.The structure is of the form
> A contains 1 B and A contains 1 C. I need to navigate from B and C to
> A to express some additional WFR. I would like to use the container()
> property for it, but it is not available in OCL.
>
> What do I know about this issue?
>
> I can add a derived reference and implement it in Java. This means I
> need to introduce a technical artifact into the model to work around
> an infrastructure issue. x(
> I can convert the composition to references and then use opposed
> references. That means I have to restructure my model to work around
> an infrastructure issue. x(
> The problem can be solved by having the OCL infrastructure configured
> for properties of EOBJECT, as shown in the
> FAQ:http://wiki.eclipse.org/MDT/OCL/FAQ#How_do_I_invoke_meth ods_such_as_eContainer.28.29.2C_eContents.28.29.2C_eGet.28.2 9.3F
>
>
> I have three questions:
>
> Can the OCL*Delegates be configured to accept the additional
> properties of EOBJECT, as described in the FAQ?
> Can the OCL Console that I use for type-checking be configured to
> accept the additional properties of EOBJECT, as described in the FAQ?
> If not, where and how do these components need to be patched to allow
> this behaviour?
>
>
> Help is appreciated, as I like OCL and would like to promote it in
> practice, but this issue is a blocker on my project, and I will have
> to scrap OCL use if I cannot get it to work.
|
|
|
Re: Activating container() support in OCL*Delegates and OCLConsole [message #667130 is a reply to message #666842] |
Tue, 26 April 2011 23:42 |
|
Hi Ed,
Thanks for the detailed information. Let's hope that the oclContainer() operation makes its way into the specification. I know how slowly it can move. Some of the input from the UML conference in SF is still on the tbd list, as far as I can see
My deadline is a week away. I wanted to use OCL to drive the backing model of a simulator. I will have to go with one of the hacks. I cannot justify diverting much time to the infrastructure. I will investigate the annotation and see if that solves the issue.
Looking forward to the next release. It is good to see that OCL is getting some standard integrated tooling.
BTW: Is anyone considering an editor for OCL documents? I think they would be fantastic to write stage validation in. One could write a document for each stage, register as an extension point and then get step by step validation. Link a resource to the invariant name and you have multi-lingual validator, without writing a single line of code. How good is that?
I will post an update here on how things develop.
Best wishes,
Joern Guy Suess
|
|
|
|
Powered by
FUDForum. Page generated in 0.02587 seconds