Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL rules
OCL rules [message #768532] Tue, 20 December 2011 10:23 Go to next message
yashine Missing name is currently offline yashine Missing nameFriend
Messages: 12
Registered: June 2011
Junior Member
Hi,
I am using Eclipse Indigo to develop an ecore meta-model with OCL (oclinecore) that works good, but I would like to know how can I escape some rules for example:

I have 3 invariants Rule1 , Rule2, Rule3 with different contexts.

I would like to check Rule1 and then if it is wrong I don't want to chek Rules 2 and 3 else I check rule 2 and 3

Regards.
Re: OCL rules [message #768542 is a reply to message #768532] Tue, 20 December 2011 10:31 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi yashine

You need to introduce some form of 'if' guard.

You need to factor out Rule1 as an operation e.g. rule1isValid()

so that the real Rule 1 just invokes it it and the other rules use it as
an if predicate.

Regards

Ed Willink


On 20/12/2011 10:23, yashine wrote:
> Hi, I am using Eclipse Indigo to develop an ecore meta-model with OCL
> (oclinecore) that works good, but I would like to know how can I
> escape some rules for example:
>
> I have 3 invariants Rule1 , Rule2, Rule3 with different contexts.
>
> I would like to check Rule1 and then if it is wrong I don't want to
> chek Rules 2 and 3 else I check rule 2 and 3
>
> Regards.
Re: OCL rules [message #768601 is a reply to message #768542] Tue, 20 December 2011 12:54 Go to previous messageGo to next message
yashine Missing name is currently offline yashine Missing nameFriend
Messages: 12
Registered: June 2011
Junior Member
Hi ED,
thank you for this response but I still have a problem because the 3 rules are in 3 different contexts and there is any relation between these contexts. So I can't call rule1IsValid() operation which is in class1 from Rule2 invariant which is in class2.

Regards

Yashine
Re: OCL rules [message #768625 is a reply to message #768542] Tue, 20 December 2011 13:43 Go to previous messageGo to next message
yashine Missing name is currently offline yashine Missing nameFriend
Messages: 12
Registered: June 2011
Junior Member
Hi ED,
thank you for this response but I still have a problem because the 3 rules are in 3 different contexts and there is any relation between these contexts. So I can't call rule1IsValid() operation which is in class1 from Rule2 invariant which is in class2.

Regards

Yashine
Re: OCL rules [message #768718 is a reply to message #768601] Tue, 20 December 2011 16:48 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I was wondering whether OCL could have some kind of ? guard similar to
QVTo and Acceleo to support your requirement.

But, I really don't see how the problem can be solved without some
common (possibly global) context to communicate the relevant success of
rule1 for interrogation by rule2 and rule3. Perhaps you should consider
how a tool or even a Java program might actually solve your problem,
then you'll be probably be able work out how to configure your OCL rules
to support your solution.

Regards

Ed Willink

On 20/12/2011 12:54, yashine wrote:
> Hi ED,
> thank you for this response but I still have a problem because the 3
> rules are in 3 different contexts and there is any relation between
> these contexts. So I can't call rule1IsValid() operation which is in
> class1 from Rule2 invariant which is in class2.
>
> Regards
>
> Yashine
Re: OCL rules [message #769135 is a reply to message #768718] Wed, 21 December 2011 13:09 Go to previous message
yashine Missing name is currently offline yashine Missing nameFriend
Messages: 12
Registered: June 2011
Junior Member
Hi ED,
OK thank you for your answers.

Regards
Previous Topic:Ecore2OCLInEcore problem referencing Classes in subpackages
Next Topic:OCL Table
Goto Forum:
  


Current Time: Thu Apr 18 02:43:58 GMT 2024

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

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

Back to the top