Skip to main content



      Home
Home » Modeling » UML2 » EMF validation constraint target for Stereotype changes
EMF validation constraint target for Stereotype changes [message #475865] Fri, 14 September 2007 04:29 Go to next message
Eclipse UserFriend
Hi,

I'm trying to create EMF validation constraints for Stereotype-related
domain-specific rules, for example a live validation to check if the just
applied Stereotype is correct, or a live validation to check the
correctness of the value entered in the Stereotype property for a UML
Element for example. I can't seem to get the live validation to trigger,
need some help on defining the target class, event and feature, or maybe
point me to the reference material for the available options.

Thanks,
Francis
Re: EMF validation constraint target for Stereotype changes [message #475887 is a reply to message #475865] Fri, 14 September 2007 07:00 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------000602030702000106080303
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Francis,

You've looked at the help which is also available online?
<http://help.eclipse.org/help33/index.jsp>

http://help.eclipse.org/help33/index.jsp
http://help.eclipse.org/help33/nav/25



Francis wrote:
> Hi,
>
> I'm trying to create EMF validation constraints for Stereotype-related
> domain-specific rules, for example a live validation to check if the
> just applied Stereotype is correct, or a live validation to check the
> correctness of the value entered in the Stereotype property for a UML
> Element for example. I can't seem to get the live validation to
> trigger, need some help on defining the target class, event and
> feature, or maybe point me to the reference material for the available
> options.
>
> Thanks,
> Francis
>
>


--------------000602030702000106080303
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Francis,<br>
<br>
You've looked at the help which is also available online?<a
href="http://help.eclipse.org/help33/index.jsp"><br>
</a>
<blockquote><a href="http://help.eclipse.org/help33/index.jsp">http://help.eclipse.org/help33/index.jsp</a><br>
<a href="http://help.eclipse.org/help33/nav/25">http://help.eclipse.org/help33/nav/25</a><br>
</blockquote>
<br>
<br>
Francis wrote:
<blockquote
cite="mid:dc0b7db01b52a3075394e59391faa9b0$1@www.eclipse.org"
type="cite">Hi,
<br>
<br>
I'm trying to create EMF validation constraints for Stereotype-related
domain-specific rules, for example a live validation to check if the
just applied Stereotype is correct, or a live validation to check the
correctness of the value entered in the Stereotype property for a UML
Element for example. I can't seem to get the live validation to
trigger, need some help on defining the target class, event and
feature, or maybe point me to the reference material for the available
options.
<br>
<br>
Thanks,
<br>
Francis
<br>
<br>
<br>
</blockquote>
<br>
</body>
</html>

--------------000602030702000106080303--
Re: EMF validation constraint target for Stereotype changes [message #475888 is a reply to message #475887] Fri, 14 September 2007 07:53 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Ed, but yes I already looked at the online help. I think I already
have the target class set correctly since my constraint works on batch
mode (constraint for validating the value of the stereotype property), but
I'm not sure about the feature name to use:
<target class="Activity">
<event name="Set">
<feature name="???"/>
</event>
<event name="Unset">
<feature name="???"/>
</event>
</target>

Ed Merks wrote:

> Francis,

> You've looked at the help which is also available online?
> <http://help.eclipse.org/help33/index.jsp>

> http://help.eclipse.org/help33/index.jsp
> http://help.eclipse.org/help33/nav/25



> Francis wrote:
>> Hi,
>>
>> I'm trying to create EMF validation constraints for Stereotype-related
>> domain-specific rules, for example a live validation to check if the
>> just applied Stereotype is correct, or a live validation to check the
>> correctness of the value entered in the Stereotype property for a UML
>> Element for example. I can't seem to get the live validation to
>> trigger, need some help on defining the target class, event and
>> feature, or maybe point me to the reference material for the available
>> options.
>>
>> Thanks,
>> Francis
>>
>>
Re: EMF validation constraint target for Stereotype changes [message #475889 is a reply to message #475888] Fri, 14 September 2007 08:36 Go to previous messageGo to next message
Eclipse UserFriend
Francis,

I would imagine you'd use one of the features visible in the Activity
class hierarchy, i.e, the name of one of the features returned by
UML2Package.Literals.ACTIVITY.getEAllStructuralFeatures().


Francis wrote:
> Thanks Ed, but yes I already looked at the online help. I think I
> already have the target class set correctly since my constraint works
> on batch mode (constraint for validating the value of the stereotype
> property), but I'm not sure about the feature name to use:
> <target class="Activity">
> <event name="Set">
> <feature name="???"/>
> </event>
> <event name="Unset">
> <feature name="???"/>
> </event>
> </target>
>
> Ed Merks wrote:
>
>> Francis,
>
>> You've looked at the help which is also available online?
>> <http://help.eclipse.org/help33/index.jsp>
>
>> http://help.eclipse.org/help33/index.jsp
>> http://help.eclipse.org/help33/nav/25
>
>
>
>> Francis wrote:
>>> Hi,
>>>
>>> I'm trying to create EMF validation constraints for
>>> Stereotype-related domain-specific rules, for example a live
>>> validation to check if the just applied Stereotype is correct, or a
>>> live validation to check the correctness of the value entered in the
>>> Stereotype property for a UML Element for example. I can't seem to
>>> get the live validation to trigger, need some help on defining the
>>> target class, event and feature, or maybe point me to the reference
>>> material for the available options.
>>>
>>> Thanks,
>>> Francis
>>>
>>>
>
>
Re: EMF validation constraint target for Stereotype changes [message #475893 is a reply to message #475889] Fri, 14 September 2007 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Ed, Francis,

It's not quite that simple when dealing with UML. The problem is, that
there is no change to a UML model element when a stereotype is applied to
it or when some property of a stereotype is changed. The stereotype
application is a new object in the contents of the resource which
references the element to which it is applied, not vice-versa. A UML
element only knows the stereotype applications that it has by
reverse-references in the CacheAdapter (which is an
ECrossReferenceAdapter).

What I would suggest is to use the new-in-1.1
org.eclipse.emf.validation.eventTypes extension point to define proxy
notifications for UML elements when stereotypes are applied to them:

http://help.eclipse.org/help33/topic/org.eclipse.emf.validat ion.doc/references/overview/customNotifications.html

On this extension point, you can contribute a "notification generator" that
the live validator invokes to analyze the list of Notifications being
validated, to fabricate custom notifications at a more abstract level or
whatever your application needs. Then, you can target constraints on these
new notifications in the usual way.

Using this mechanism, you can supply the "stereotype applied/unapplied"
notifications that otherwise wouldn't exist.

HTH,

Christian


Ed Merks wrote:

> Francis,
>
> I would imagine you'd use one of the features visible in the Activity
> class hierarchy, i.e, the name of one of the features returned by
> UML2Package.Literals.ACTIVITY.getEAllStructuralFeatures().
>
>
> Francis wrote:
>> Thanks Ed, but yes I already looked at the online help. I think I
>> already have the target class set correctly since my constraint works
>> on batch mode (constraint for validating the value of the stereotype
>> property), but I'm not sure about the feature name to use:
>> <target class="Activity">
>> <event name="Set">
>> <feature name="???"/>
>> </event>
>> <event name="Unset">
>> <feature name="???"/>
>> </event>
>> </target>
>>

------8<------
Re: EMF validation constraint target for Stereotype changes [message #475898 is a reply to message #475893] Fri, 14 September 2007 11:36 Go to previous message
Eclipse UserFriend
Thanks Christian. This is a very interesting feature, but unfortunately,
I'm using a product that still uses emf validation 1.0.1. I may have to
wait till the next upgrade. But, that's good to know, thanks.

Francis
Re: EMF validation constraint target for Stereotype changes [message #624757 is a reply to message #475865] Fri, 14 September 2007 07:00 Go to previous message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------000602030702000106080303
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Francis,

You've looked at the help which is also available online?
<http://help.eclipse.org/help33/index.jsp>

http://help.eclipse.org/help33/index.jsp
http://help.eclipse.org/help33/nav/25



Francis wrote:
> Hi,
>
> I'm trying to create EMF validation constraints for Stereotype-related
> domain-specific rules, for example a live validation to check if the
> just applied Stereotype is correct, or a live validation to check the
> correctness of the value entered in the Stereotype property for a UML
> Element for example. I can't seem to get the live validation to
> trigger, need some help on defining the target class, event and
> feature, or maybe point me to the reference material for the available
> options.
>
> Thanks,
> Francis
>
>


--------------000602030702000106080303
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Francis,<br>
<br>
You've looked at the help which is also available online?<a
href="http://help.eclipse.org/help33/index.jsp"><br>
</a>
<blockquote><a href="http://help.eclipse.org/help33/index.jsp">http://help.eclipse.org/help33/index.jsp</a><br>
<a href="http://help.eclipse.org/help33/nav/25">http://help.eclipse.org/help33/nav/25</a><br>
</blockquote>
<br>
<br>
Francis wrote:
<blockquote
cite="mid:dc0b7db01b52a3075394e59391faa9b0$1@www.eclipse.org"
type="cite">Hi,
<br>
<br>
I'm trying to create EMF validation constraints for Stereotype-related
domain-specific rules, for example a live validation to check if the
just applied Stereotype is correct, or a live validation to check the
correctness of the value entered in the Stereotype property for a UML
Element for example. I can't seem to get the live validation to
trigger, need some help on defining the target class, event and
feature, or maybe point me to the reference material for the available
options.
<br>
<br>
Thanks,
<br>
Francis
<br>
<br>
<br>
</blockquote>
<br>
</body>
</html>

--------------000602030702000106080303--
Re: EMF validation constraint target for Stereotype changes [message #624758 is a reply to message #475887] Fri, 14 September 2007 07:53 Go to previous message
Eclipse UserFriend
Thanks Ed, but yes I already looked at the online help. I think I already
have the target class set correctly since my constraint works on batch
mode (constraint for validating the value of the stereotype property), but
I'm not sure about the feature name to use:
<target class="Activity">
<event name="Set">
<feature name="???"/>
</event>
<event name="Unset">
<feature name="???"/>
</event>
</target>

Ed Merks wrote:

> Francis,

> You've looked at the help which is also available online?
> <http://help.eclipse.org/help33/index.jsp>

> http://help.eclipse.org/help33/index.jsp
> http://help.eclipse.org/help33/nav/25



> Francis wrote:
>> Hi,
>>
>> I'm trying to create EMF validation constraints for Stereotype-related
>> domain-specific rules, for example a live validation to check if the
>> just applied Stereotype is correct, or a live validation to check the
>> correctness of the value entered in the Stereotype property for a UML
>> Element for example. I can't seem to get the live validation to
>> trigger, need some help on defining the target class, event and
>> feature, or maybe point me to the reference material for the available
>> options.
>>
>> Thanks,
>> Francis
>>
>>
Re: EMF validation constraint target for Stereotype changes [message #624759 is a reply to message #475888] Fri, 14 September 2007 08:36 Go to previous message
Eclipse UserFriend
Francis,

I would imagine you'd use one of the features visible in the Activity
class hierarchy, i.e, the name of one of the features returned by
UML2Package.Literals.ACTIVITY.getEAllStructuralFeatures().


Francis wrote:
> Thanks Ed, but yes I already looked at the online help. I think I
> already have the target class set correctly since my constraint works
> on batch mode (constraint for validating the value of the stereotype
> property), but I'm not sure about the feature name to use:
> <target class="Activity">
> <event name="Set">
> <feature name="???"/>
> </event>
> <event name="Unset">
> <feature name="???"/>
> </event>
> </target>
>
> Ed Merks wrote:
>
>> Francis,
>
>> You've looked at the help which is also available online?
>> <http://help.eclipse.org/help33/index.jsp>
>
>> http://help.eclipse.org/help33/index.jsp
>> http://help.eclipse.org/help33/nav/25
>
>
>
>> Francis wrote:
>>> Hi,
>>>
>>> I'm trying to create EMF validation constraints for
>>> Stereotype-related domain-specific rules, for example a live
>>> validation to check if the just applied Stereotype is correct, or a
>>> live validation to check the correctness of the value entered in the
>>> Stereotype property for a UML Element for example. I can't seem to
>>> get the live validation to trigger, need some help on defining the
>>> target class, event and feature, or maybe point me to the reference
>>> material for the available options.
>>>
>>> Thanks,
>>> Francis
>>>
>>>
>
>
Re: EMF validation constraint target for Stereotype changes [message #624785 is a reply to message #475889] Fri, 14 September 2007 09:45 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Ed, Francis,

It's not quite that simple when dealing with UML. The problem is, that
there is no change to a UML model element when a stereotype is applied to
it or when some property of a stereotype is changed. The stereotype
application is a new object in the contents of the resource which
references the element to which it is applied, not vice-versa. A UML
element only knows the stereotype applications that it has by
reverse-references in the CacheAdapter (which is an
ECrossReferenceAdapter).

What I would suggest is to use the new-in-1.1
org.eclipse.emf.validation.eventTypes extension point to define proxy
notifications for UML elements when stereotypes are applied to them:

http://help.eclipse.org/help33/topic/org.eclipse.emf.validat ion.doc/references/overview/customNotifications.html

On this extension point, you can contribute a "notification generator" that
the live validator invokes to analyze the list of Notifications being
validated, to fabricate custom notifications at a more abstract level or
whatever your application needs. Then, you can target constraints on these
new notifications in the usual way.

Using this mechanism, you can supply the "stereotype applied/unapplied"
notifications that otherwise wouldn't exist.

HTH,

Christian


Ed Merks wrote:

> Francis,
>
> I would imagine you'd use one of the features visible in the Activity
> class hierarchy, i.e, the name of one of the features returned by
> UML2Package.Literals.ACTIVITY.getEAllStructuralFeatures().
>
>
> Francis wrote:
>> Thanks Ed, but yes I already looked at the online help. I think I
>> already have the target class set correctly since my constraint works
>> on batch mode (constraint for validating the value of the stereotype
>> property), but I'm not sure about the feature name to use:
>> <target class="Activity">
>> <event name="Set">
>> <feature name="???"/>
>> </event>
>> <event name="Unset">
>> <feature name="???"/>
>> </event>
>> </target>
>>

------8<------
Re: EMF validation constraint target for Stereotype changes [message #624790 is a reply to message #475893] Fri, 14 September 2007 11:36 Go to previous message
Eclipse UserFriend
Thanks Christian. This is a very interesting feature, but unfortunately,
I'm using a product that still uses emf validation 1.0.1. I may have to
wait till the next upgrade. But, that's good to know, thanks.

Francis
Previous Topic:add a value to package
Next Topic:[Announce] new article available.
Goto Forum:
  


Current Time: Sat Aug 30 17:13:57 EDT 2025

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

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

Back to the top