Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Identical model elements
Identical model elements [message #497105] Thu, 12 November 2009 14:20 Go to next message
pkojo is currently offline pkojo
Messages: 27
Registered: October 2009
Junior Member
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo





Re: Identical model elements [message #497788 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497805 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497809 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497810 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497825 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497826 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497832 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497839 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497849 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497852 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497857 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497860 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497864 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497865 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497885 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497906 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497912 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497925 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Re: Identical model elements [message #497941 is a reply to message #497105] Fri, 13 November 2009 12:24 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 802
Registered: July 2009
Senior Member
--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, pokojo,

Try something like this:

context uml::Model
def: findSimilarActors() : Set(Actor) =
Actor.allInstances()->select(a |
Actor.allInstances()->exists(b | a <> b and a.name =
b.name))

Then if you need the names, do:

getModel().findSimilarActors().name->asSet()

HTH,

Christian


On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:

> Hi,
>
> I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.
>
> context uml::Model
> inv: Actor.allInstances()->exists(a1,a2:Actor| a1<>a2 and a1.name= a2.name)
>
> It returns me true result, this means that two actor with same name are present in the model.
>
> now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.
>
> Thanks in advance,
> pokojo
>
>
>
>
>
>

--=-gJOW+6Xp9aobY2+HYucM
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, pokojo,<BR>
<BR>
Try something like this:<BR>
<BR>
context uml::Model<BR>
def: findSimilarActors() : Set(Actor) =<BR>
&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;select(a |<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Actor.allInstances()-&gt;exists(b | a &lt;&gt; b and a.name = b.name))<BR>
<BR>
Then if you need the names, do:<BR>
<BR>
&nbsp;&nbsp;&nbsp; getModel().findSimilarActors().name-&gt;asSet()<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-12 at 09:20 -0500, pkojo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,

I am a beginner and playing with the OCL, and trying to identify identical model elements using following query.

context uml::Model
inv: Actor.allInstances()-&gt;exists(a1,a2:Actor| a1&lt;&gt;a2 and a1.name= a2.name)

It returns me true result, this means that two actor with same name are present in the model.

now the next step , I want output that query should also show me the name of the identical actors, for this if I apply select operation on exists but it complains, any suggestion how can I get the value of those identical elements.

Thanks in advance,
pokojo






</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-gJOW+6Xp9aobY2+HYucM--
Previous Topic:OCL Query and Liflines
Next Topic:oclIsUndefined and empty String
Goto Forum:
  


Current Time: Fri Oct 24 20:46:31 GMT 2014

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

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