Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to extend OCL standard library in Papyrus
How to extend OCL standard library in Papyrus [message #1714685] Sun, 15 November 2015 20:07 Go to next message
waseem anwar is currently offline waseem anwarFriend
Messages: 4
Registered: November 2015
Junior Member
Hello.

I want to add some functions (just prototype) in oclAny such that Papyrus OCL editor should not give any syntax error while typing that customized functions. I have nothing to do with OCL validation. My only concern is syntax support in Papyrus editor for few new operations with header definition in standard OCL library (oclAny). My question is two fold: 1) What is the simplest way to achieve this ? 2) I know it is possible to customize standard OCL library through Xtext editor (CompleteOCL) but how to use such OCL std. lib extension to support the syntax of new functions in papyrus OCL editor ?
I have good Java programming background but new to OCL and Papyrus. Therefore, i need the valuable suggestions of domain experts to select the right path.

Re: How to extend OCL standard library in Papyrus [message #1714786 is a reply to message #1714685] Mon, 16 November 2015 16:43 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi<br>
<br>
Once <br>
<pre><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=408215">https://bugs.eclipse.org/bugs/show_bug.cgi?id=408215</a></pre>
is fixed, you could define your added functions in a Complete OCL
document, but you would have to manually load it using
OCL-&gt;Load each edit session.<br>
<br>
-----<br>
<br>
Perhaps some form of Complete OCL import is required....<br>
<br>
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=482313">https://bugs.eclipse.org/bugs/show_bug.cgi?id=482313</a> raised.<br>
<br>
-----<br>
<br>
If you define a <a class="moz-txt-link-rfc2396E" href="http://www.eclipse.org/ocl/2015/Library">"http://www.eclipse.org/ocl/2015/Library"</a> Package,
with an OclAny Class, and useful OCL-bodied Operations, it should
work. But it has never been tried.<br>
<br>
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=482314">https://bugs.eclipse.org/bugs/show_bug.cgi?id=482314</a> raised.<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
<br>
<br>
<br>
On 16/11/2015 14:54, waseem anwar wrote:<br>
</div>
<blockquote cite="mid:n2cqn3$88v$1@xxxxxxxxe.org" type="cite">Hello.
<br>
<br>
I want to add some functions (just prototype) in oclAny such that
Papyrus OCL editor should not give any syntax error while typing
that customized functions. I have nothing to do with OCL
validation. My only concern is syntax support in Papyrus editor
for few new operations with header definition in standard OCL
library (oclAny). My question is two fold: 1) What is the simplest
way to achieve this ? 2) I know it is possible to customize
standard OCL library through Xtext editor (CompleteOCL) but how to
use such OCL std. lib extension to support the syntax of new
functions in  papyrus OCL editor ? I have good Java programming
background but new to OCL and Papyrus. Therefore, i need the
valuable suggestions of domain experts to select the right path. <br>
<br>
</blockquote>
<br>
</body>
</html>
Re: How to extend OCL standard library in Papyrus [message #1714808 is a reply to message #1714786] Mon, 16 November 2015 21:30 Go to previous messageGo to next message
waseem anwar is currently offline waseem anwarFriend
Messages: 4
Registered: November 2015
Junior Member
Dear Ed Willink

Thanks for your quick and productive reply. Basically, you suggest two approaches with possible limitations. Please suggest which one is more appropriate and realistic in your opinion. Actually I am developing eclipse based open source MDA framework. I have already customize papyrus editor to provide modeling support in my framework. I am currently working on model transformation tool. My only concern is syntax support in Papyrus OCL editor for my customized functions in oclAny class. Please note that i have nothing to do with validation of my customize OCL functions. I am generating source code through XMI file which is used for validation. Therefore, i am not interested in any OCL validation features provided in papyrus. I need simple and realistic solution to avoid syntax error (red underline) in papyrus OCL editor for my customized functions in oclAny class. Your valuable comments in this regard will be highly appreciable.

regards
Re: How to extend OCL standard library in Papyrus [message #1714853 is a reply to message #1714808] Tue, 17 November 2015 10:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

If you are really just interested in M2M, I am not clear why you are
worrying about Papyrus.

There are many tools using M2M with Ecore and the OCL support for Ecore
is much stronger.

Papyrus/UML adds significant difficulties by using a specification
language that is not directly implementable and for which the
implementation approaches are rather suspect.

I suggest you ask a question regarding what you really want to do rather
than why a particular solution approach has dug you a deep hole.

If you are using OclAny, you might consider using the OCL to java code
generator as part of your solution. If you are interested in M2M you
might consider using the more relevant QVTi to Java code generator.

Regards

Ed Willink



On 16/11/2015 21:30, waseem anwar wrote:
> Dear Ed Willink
>
> Thanks for your quick and productive reply. Basically, you suggest two
> approaches with possible limitations. Please suggest which one is
> more appropriate and realistic in your opinion. Actually I am
> developing eclipse based open source MDA framework. I have already
> customize papyrus editor to provide modeling support in my framework.
> I am currently working on model transformation tool. My only concern
> is syntax support in Papyrus OCL editor for my customized functions in
> oclAny class. Please note that i have nothing to do with validation of
> my customize OCL functions. I am generating source code through XMI
> file which is used for validation. Therefore, i am not interested in
> any OCL validation features provided in papyrus. I need simple and
> realistic solution to avoid syntax error (red underline) in papyrus
> OCL editor for my customized functions in oclAny class. Your valuable
> comments in this regard will be highly appreciable.
>
> regards
Re: How to extend OCL standard library in Papyrus [message #1714946 is a reply to message #1714853] Tue, 17 November 2015 20:08 Go to previous messageGo to next message
waseem anwar is currently offline waseem anwarFriend
Messages: 4
Registered: November 2015
Junior Member
Dear Ed Willink

Thanks for your early response. I think it is necessary to first describe my requirements. First of all, i am working to develop a complete MDA platform for embedded systems that includes: 1) Modeling tool 2) Transformation Engine and 3) Simulation. In my modeling approach, i have proposed few new functions in OCL standard library (OCLAny) so that end-user should be able to write constraints in UML / SYSML models through my proposed OCL extension. For OCL extension, i have used Xtext editor to customize standard OCL library. Now come to the first step i.e. Modeling tool. I have to include modeling tool in my framework so that end-user should be able to model requirements. I have selected Papyrus because it is open source and can be customized as per requirements. I cannot select other modeling tools like magic draw, RSA etc. due to their proprietary licenses. Furthermore, I cannot use GMT to develop my own modeling tool because it is very time-consuming. Consequently, i have selected Papyrus as a best choice and customize it for my framework. At the moment, papyrus is working fine in my framework to provide modeling facilities in UML and SYSML profiles. However, when it comes to write constraints through my proposed OCL extension, Papyrus OCL editor give syntax error because it cannot recognize my extended OCL functions. I just want to resolve syntax error issue for my new OCL functions because i do not need any OCL validation features. At this stage, I already done a lot of work on papyrus. I just want to know how to load complete OCL document in Papyrus such that my customized OCL functions should be recognize by Papyrus OCL editor (just syntax). As my only concern is syntax support, Is there any other way (may be without loading completeOCL) in papyrus to achieve that ? I don't want to ask end-users to write OCL constraints in separate file because it will increase complexity. I hope now you can understand the exact situation that why i am stick with papyrus and why i am only interested in syntax support for my customized OCL functions.
looking for your reply

regards
Re: How to extend OCL standard library in Papyrus [message #1714982 is a reply to message #1714946] Wed, 18 November 2015 09:42 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

The Papyrus Language/Body editor can be extended to support new languages. One option might be to use "Your OCL" Language rather than "OCL" and associate a custom editor to this language.

This might be a little bit overkill if you only need to support a few additional functions rather than entire new grammatical constructs, however.

Otherwise, I think that OCL itself can be extended with a different pivot model, but I'll let Ed explain this approach if he considers that relevant. And this might cause conflicts with actual OCL-based support for standard UML, too.

Regards,
Camille


Camille Letavernier
Re: How to extend OCL standard library in Papyrus [message #1714999 is a reply to message #1714946] Wed, 18 November 2015 11:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi<br>
<br>
Since you are leveraging Ecipse to provide your modeling tool, you
should offset the many savings that you get from re-use from some
costs through contributing back enhancements. You cannot expect to
get everything included added functionality for free.<br>
<br>
I provided you with three solutions that I might work on one day.
If you want solutions sooner, you need to contribute. All the
underlying functionality is there, it's just the inadequate
'import' that is a blocker.<br>
<br>
With regards to not imposing an extra file on your users, that is
misguided. If the users want 10 lines of OCL, fine embed it in the
UML. If the users want 1000 lines of OCL then an extra file is a
much much better solution. Both approaches should work.<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
<br>
<br>
On 17/11/2015 20:08, waseem anwar wrote:<br>
</div>
<blockquote cite="mid:n2g1gj$ju6$1@xxxxxxxxe.org" type="cite">Dear
Ed Willink
<br>
<br>
Thanks for your early response. I think it is necessary to first
describe my requirements. First of all, i am working to develop a
complete MDA platform for embedded systems that includes: 1)
Modeling tool 2) Transformation Engine and 3) Simulation. In my
modeling approach, i have proposed few new functions in OCL
standard library (OCLAny) so that end-user should be able to write
constraints in UML / SYSML models through my proposed OCL
extension. For OCL extension, i have used Xtext editor to
customize standard OCL library. Now come to the first step i.e.
Modeling tool. I have to include modeling tool in my framework so
that end-user should be able to model requirements. I have
selected Papyrus because it is open source and can be customized
as per requirements. I cannot select other modeling tools like
magic draw, RSA etc. due to their proprietary licenses.
Furthermore, I cannot use GMT to develop my own modeling tool
because it is very time-consuming. Consequently, i have selected
Papyrus as a best choice and customize it for my framework. At the
moment, papyrus is working fine in my framework to provide
modeling facilities in UML and SYSML profiles. However, when it
comes to write constraints through my proposed OCL extension,
Papyrus OCL editor give syntax error because it cannot recognize
my extended OCL functions. I just want to resolve syntax error
issue for my new OCL functions because i do not need any OCL
validation features. At this stage, I already done a lot of work
on papyrus. I just want to know how to load complete OCL document 
in Papyrus such that my customized OCL functions should be
recognize by Papyrus OCL editor (just syntax). As my only concern
is syntax support, Is there any other way (may be without loading
completeOCL) in papyrus to achieve that ? I don't want to ask
end-users to write OCL constraints in separate file because it
will increase complexity. I hope now you can understand the exact
situation that why i am stick with papyrus and why i am only
interested in syntax support for my customized OCL functions.
looking for your reply <br>
regards </blockquote>
<br>
</body>
</html>
Re: How to extend OCL standard library in Papyrus [message #1715279 is a reply to message #1714999] Fri, 20 November 2015 20:48 Go to previous message
waseem anwar is currently offline waseem anwarFriend
Messages: 4
Registered: November 2015
Junior Member
Dear Letavernier and Willink

I am thankful to both of you for your valuable comments. First of all, I am agree with Camille Letavernier that this is one possible solution but it is lengthy solution as i just need few customized functions in OCL. However, this solution is in my mind if I will not find any other simple solution.

For Ed Willink Comments, I just want to clear one thing that is I am not developing anything commercial by using all open source software's. In fact, our framework will also be open source and freely available for relevant students, researchers and practitioners. Currently, we are in scientific publications phase and we will provide the link of our framework soon.

So far, I have removed some additional features of papyrus to meet the particular requirement of my framework. Whenever, i add any new feature in papyrus or any other corresponding eclipse plugin, i will definitely share the details with you. In addition, I never expect all things for free without contributing. For example, I have developed my own transformation engine with a lot of efforts though i have used all open source M2M and M2T tools. Further, my frame work will also be freely available (open source).

Finally, I want to say that I have post my query here just to get the simplest and quick solution of my issue to save my time because all senior members of this forum are experts of the domain and very helpful. In fact, the provided comments are very valuable for me to find the solution of my problem.

regards
Previous Topic:Minor State Machine diagram bug
Next Topic:Error: Model content will not be shown
Goto Forum:
  


Current Time: Thu Mar 28 23:46:03 GMT 2024

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

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

Back to the top