Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » RE: IProviderOperationExecutor execute method
RE: IProviderOperationExecutor execute method [message #59269] Thu, 17 July 2008 09:55 Go to next message
Mark Melia is currently offline Mark Melia
Messages: 142
Registered: July 2009
Senior Member
Hi,

I had been messing around with the validation examples and with the help
of Christian I was able to get an OCL to be validated against my EMF
model. I got this working on a previous version on eclipse, and now trying
to get it working on the new version. I notice some of the code has been
updated, for example I am the class
org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService,
the IProviderOperationExecutor execute action has changed and now gives a
return type 'T', which was previously void. Does anybody have any idea of
why this changed and what T is?

public IValidator newValidator(EvaluationMode mode) {
assert mode != null && !mode.isNull();

IProviderOperationExecutor executor = new IProviderOperationExecutor() {
public void execute(IProviderOperation op) { < --ERROR - VOID NOT
COMPATIABLE
MyModelValidationService.this.execute(op);
}};

if (mode == EvaluationMode.BATCH) {
return new BatchValidator(executor);
} else if (mode == EvaluationMode.LIVE) {
return new LiveValidator(executor);
} else {
throw new IllegalArgumentException();
}
}

I hope this makes sense - thanks for your help,
Mark
RE: IProviderOperationExecutor execute method [message #59295 is a reply to message #59269] Thu, 17 July 2008 10:13 Go to previous messageGo to next message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

--=-ccFWNL/8FWgwBuoOszlP
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Mark,

This is one of those examples of the caveat against implementing or
using internal API :-D

The 1.2 release of this component adopts J2SE 5.0, including the
genericity capability. The return type T is a type parameter of the
IProviderOperation, constrained to be some kind of collection of some
kind of IModelConstraint type.

The IProviderOperation and IProviderOperationExecutor interfaces both
are internal API. Does our example demonstrate implementation/usage of
these internal APIs?

cW


On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:

> Hi,
>
> I had been messing around with the validation examples and with the help
> of Christian I was able to get an OCL to be validated against my EMF
> model. I got this working on a previous version on eclipse, and now trying
> to get it working on the new version. I notice some of the code has been
> updated, for example I am the class
> org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService,
> the IProviderOperationExecutor execute action has changed and now gives a
> return type 'T', which was previously void. Does anybody have any idea of
> why this changed and what T is?
>
> public IValidator newValidator(EvaluationMode mode) {
> assert mode != null && !mode.isNull();
>
> IProviderOperationExecutor executor = new IProviderOperationExecutor() {
> public void execute(IProviderOperation op) { < --ERROR - VOID NOT
> COMPATIABLE
> MyModelValidationService.this.execute(op);
> }};
>
> if (mode == EvaluationMode.BATCH) {
> return new BatchValidator(executor);
> } else if (mode == EvaluationMode.LIVE) {
> return new LiveValidator(executor);
> } else {
> throw new IllegalArgumentException();
> }
> }
>
> I hope this makes sense - thanks for your help,
> Mark
>

--=-ccFWNL/8FWgwBuoOszlP
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.16.0">
</HEAD>
<BODY>
Hi, Mark,<BR>
<BR>
This is one of those examples of the caveat against implementing or using internal API&nbsp; :-D<BR>
<BR>
The 1.2 release of this component adopts J2SE 5.0, including the genericity capability.&nbsp; The return type T is a type parameter of the IProviderOperation, constrained to be some kind of collection of some kind of IModelConstraint type.<BR>
<BR>
The IProviderOperation and IProviderOperationExecutor interfaces both are internal API.&nbsp; Does our example demonstrate implementation/usage of these internal APIs?<BR>
<BR>
cW<BR>
<BR>
<BR>
On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi,</FONT>

<FONT COLOR="#000000">I had been messing around with the validation examples and with the help </FONT>
<FONT COLOR="#000000">of Christian I was able to get an OCL to be validated against my EMF </FONT>
<FONT COLOR="#000000">model. I got this working on a previous version on eclipse, and now trying </FONT>
<FONT COLOR="#000000">to get it working on the new version. I notice some of the code has been </FONT>
<FONT COLOR="#000000">updated, for example I am the class </FONT>
<FONT COLOR="#000000"> org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService, </FONT>
<FONT COLOR="#000000">the IProviderOperationExecutor execute action has changed and now gives a </FONT>
<FONT COLOR="#000000">return type 'T', which was previously void. Does anybody have any idea of </FONT>
<FONT COLOR="#000000">why this changed and what T is?</FONT>

<FONT COLOR="#000000">public IValidator newValidator(EvaluationMode mode) {</FONT>
<FONT COLOR="#000000"> assert mode != null &amp;&amp; !mode.isNull();</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> IProviderOperationExecutor executor = new IProviderOperationExecutor() {</FONT>
<FONT COLOR="#000000"> public void execute(IProviderOperation op) { &lt; --ERROR - VOID NOT </FONT>
<FONT COLOR="#000000">COMPATIABLE </FONT>
<FONT COLOR="#000000"> MyModelValidationService.this.execute(op);</FONT>
<FONT COLOR="#000000"> }};</FONT>
<FONT COLOR="#000000"> </FONT>
<FONT COLOR="#000000"> if (mode == EvaluationMode.BATCH) {</FONT>
<FONT COLOR="#000000"> return new BatchValidator(executor);</FONT>
<FONT COLOR="#000000"> } else if (mode == EvaluationMode.LIVE) {</FONT>
<FONT COLOR="#000000"> return new LiveValidator(executor);</FONT>
<FONT COLOR="#000000"> } else {</FONT>
<FONT COLOR="#000000"> throw new IllegalArgumentException();</FONT>
<FONT COLOR="#000000"> }</FONT>
<FONT COLOR="#000000"> }</FONT>

<FONT COLOR="#000000">I hope this makes sense - thanks for your help,</FONT>
<FONT COLOR="#000000">Mark</FONT>

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

--=-ccFWNL/8FWgwBuoOszlP--
Re: IProviderOperationExecutor execute method [message #59318 is a reply to message #59295] Thu, 17 July 2008 10:35 Go to previous messageGo to next message
Mark Melia is currently offline Mark Melia
Messages: 142
Registered: July 2009
Senior Member
Hey Christian,

How are you, I annoyed you with this problem some time ago and you helped
me get it up and running - thanks for helping me again :)

The example does seem to be useing interfaces. Basically what we have done
is extend your example from org.eclipse.emf.validation.examples.general to
work in with our GMF project. Our GMF project has been updated, and so has
the Eclipse landscape so I was trying to get the OCL validation of models
to work again.

Perhaps there is a better way of doing this now? I was looking for a
update to this example, but the download manger has changed and I cant
find any OCL validation examples - is there any around?

Any help would be much appricated.

Mark


Christian W. Damus wrote:

> Hi, Mark,

> This is one of those examples of the caveat against implementing or
> using internal API :-D

> The 1.2 release of this component adopts J2SE 5.0, including the
> genericity capability. The return type T is a type parameter of the
> IProviderOperation, constrained to be some kind of collection of some
> kind of IModelConstraint type.

> The IProviderOperation and IProviderOperationExecutor interfaces both
> are internal API. Does our example demonstrate implementation/usage of
> these internal APIs?

> cW


> On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:

>> Hi,
>>
>> I had been messing around with the validation examples and with the help
>> of Christian I was able to get an OCL to be validated against my EMF
>> model. I got this working on a previous version on eclipse, and now trying
>> to get it working on the new version. I notice some of the code has been
>> updated, for example I am the class
>>
org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService,
>> the IProviderOperationExecutor execute action has changed and now gives a
>> return type 'T', which was previously void. Does anybody have any idea of
>> why this changed and what T is?
>>
>> public IValidator newValidator(EvaluationMode mode) {
>> assert mode != null && !mode.isNull();
>>
>> IProviderOperationExecutor executor = new IProviderOperationExecutor() {
>> public void execute(IProviderOperation op) { < --ERROR - VOID NOT
>> COMPATIABLE
>> MyModelValidationService.this.execute(op);
>> }};
>>
>> if (mode == EvaluationMode.BATCH) {
>> return new BatchValidator(executor);
>> } else if (mode == EvaluationMode.LIVE) {
>> return new LiveValidator(executor);
>> } else {
>> throw new IllegalArgumentException();
>> }
>> }
>>
>> I hope this makes sense - thanks for your help,
>> Mark
>>
Re: IProviderOperationExecutor execute method [message #59343 is a reply to message #59318] Thu, 17 July 2008 21:18 Go to previous message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

--=-ludr1XHsT4d3mHp2EpQZ
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Mark,

Annoyed? Nah. You're a regular contributor in the newsgroups, and
welcome.

Yes. An example that demonstrates how to violate the API rules would
seem like a bad idea, but I don't see an example that does this. It
would appear that you dreamt the whole thing. :-P I don't even see a
reason why you should want to implement your own validation service.

The OCL validation example should still be there ... if you installed
the EMF Validation Framework SDK, that is. Look for it in the "File ->
New -> Example..." menu, in the "EMF Validation Framework Plug-ins"
category. It has a new example demonstrating how to create a dynamic
constraint provider; the example loads OCL constraints from a *.ocl
document.

Cheers,

Christian


On Thu, 2008-07-17 at 14:35 +0000, Mark Melia wrote:

> Hey Christian,
>
> How are you, I annoyed you with this problem some time ago and you helped
> me get it up and running - thanks for helping me again :)
>
> The example does seem to be useing interfaces. Basically what we have done
> is extend your example from org.eclipse.emf.validation.examples.general to
> work in with our GMF project. Our GMF project has been updated, and so has
> the Eclipse landscape so I was trying to get the OCL validation of models
> to work again.
>
> Perhaps there is a better way of doing this now? I was looking for a
> update to this example, but the download manger has changed and I cant
> find any OCL validation examples - is there any around?
>
> Any help would be much appricated.
>
> Mark
>
>
> Christian W. Damus wrote:
>
> > Hi, Mark,
>
> > This is one of those examples of the caveat against implementing or
> > using internal API :-D
>
> > The 1.2 release of this component adopts J2SE 5.0, including the
> > genericity capability. The return type T is a type parameter of the
> > IProviderOperation, constrained to be some kind of collection of some
> > kind of IModelConstraint type.
>
> > The IProviderOperation and IProviderOperationExecutor interfaces both
> > are internal API. Does our example demonstrate implementation/usage of
> > these internal APIs?
>
> > cW
>
>
> > On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:
>
> >> Hi,
> >>
> >> I had been messing around with the validation examples and with the help
> >> of Christian I was able to get an OCL to be validated against my EMF
> >> model. I got this working on a previous version on eclipse, and now trying
> >> to get it working on the new version. I notice some of the code has been
> >> updated, for example I am the class
> >>
> org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService,
> >> the IProviderOperationExecutor execute action has changed and now gives a
> >> return type 'T', which was previously void. Does anybody have any idea of
> >> why this changed and what T is?
> >>
> >> public IValidator newValidator(EvaluationMode mode) {
> >> assert mode != null && !mode.isNull();
> >>
> >> IProviderOperationExecutor executor = new IProviderOperationExecutor() {
> >> public void execute(IProviderOperation op) { < --ERROR - VOID NOT
> >> COMPATIABLE
> >> MyModelValidationService.this.execute(op);
> >> }};
> >>
> >> if (mode == EvaluationMode.BATCH) {
> >> return new BatchValidator(executor);
> >> } else if (mode == EvaluationMode.LIVE) {
> >> return new LiveValidator(executor);
> >> } else {
> >> throw new IllegalArgumentException();
> >> }
> >> }
> >>
> >> I hope this makes sense - thanks for your help,
> >> Mark
> >>
>
>

--=-ludr1XHsT4d3mHp2EpQZ
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.16.0">
</HEAD>
<BODY>
Hi, Mark,<BR>
<BR>
Annoyed?&nbsp; Nah.&nbsp; You're a regular contributor in the newsgroups, and welcome.<BR>
<BR>
Yes.&nbsp; An example that demonstrates how to violate the API rules would seem like a bad idea, but I don't see an example that does this.&nbsp; It would appear that you dreamt the whole thing.&nbsp; :-P&nbsp;&nbsp; I don't even see a reason why you should want to implement your own validation service.<BR>
<BR>
The OCL validation example should still be there ... if you installed the EMF Validation Framework SDK, that is.&nbsp; Look for it in the &quot;File -&gt; New -&gt; Example...&quot; menu, in the &quot;EMF Validation Framework Plug-ins&quot; category.&nbsp; It has a new example demonstrating how to create a dynamic constraint provider; the example loads OCL constraints from a *.ocl document.<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2008-07-17 at 14:35 +0000, Mark Melia wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hey Christian,</FONT>

<FONT COLOR="#000000">How are you, I annoyed you with this problem some time ago and you helped </FONT>
<FONT COLOR="#000000">me get it up and running - thanks for helping me again :)</FONT>

<FONT COLOR="#000000">The example does seem to be useing interfaces. Basically what we have done </FONT>
<FONT COLOR="#000000">is extend your example from org.eclipse.emf.validation.examples.general to </FONT>
<FONT COLOR="#000000">work in with our GMF project. Our GMF project has been updated, and so has </FONT>
<FONT COLOR="#000000">the Eclipse landscape so I was trying to get the OCL validation of models </FONT>
<FONT COLOR="#000000">to work again.</FONT>

<FONT COLOR="#000000">Perhaps there is a better way of doing this now? I was looking for a </FONT>
<FONT COLOR="#000000">update to this example, but the download manger has changed and I cant </FONT>
<FONT COLOR="#000000">find any OCL validation examples - is there any around?</FONT>

<FONT COLOR="#000000">Any help would be much appricated.</FONT>

<FONT COLOR="#000000">Mark</FONT>


<FONT COLOR="#000000">Christian W. Damus wrote:</FONT>

<FONT COLOR="#000000">&gt; Hi, Mark,</FONT>

<FONT COLOR="#000000">&gt; This is one of those examples of the caveat against implementing or</FONT>
<FONT COLOR="#000000">&gt; using internal API :-D</FONT>

<FONT COLOR="#000000">&gt; The 1.2 release of this component adopts J2SE 5.0, including the</FONT>
<FONT COLOR="#000000">&gt; genericity capability. The return type T is a type parameter of the</FONT>
<FONT COLOR="#000000">&gt; IProviderOperation, constrained to be some kind of collection of some</FONT>
<FONT COLOR="#000000">&gt; kind of IModelConstraint type.</FONT>

<FONT COLOR="#000000">&gt; The IProviderOperation and IProviderOperationExecutor interfaces both</FONT>
<FONT COLOR="#000000">&gt; are internal API. Does our example demonstrate implementation/usage of</FONT>
<FONT COLOR="#000000">&gt; these internal APIs?</FONT>

<FONT COLOR="#000000">&gt; cW</FONT>


<FONT COLOR="#000000">&gt; On Thu, 2008-07-17 at 13:55 +0000, Mark Melia wrote:</FONT>

<FONT COLOR="#000000">&gt;&gt; Hi,</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; I had been messing around with the validation examples and with the help </FONT>
<FONT COLOR="#000000">&gt;&gt; of Christian I was able to get an OCL to be validated against my EMF </FONT>
<FONT COLOR="#000000">&gt;&gt; model. I got this working on a previous version on eclipse, and now trying </FONT>
<FONT COLOR="#000000">&gt;&gt; to get it working on the new version. I notice some of the code has been </FONT>
<FONT COLOR="#000000">&gt;&gt; updated, for example I am the class </FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000"> org.eclipse.emf.validation.examples.general.actions.MyModelV alidationService, </FONT>
<FONT COLOR="#000000">&gt;&gt; the IProviderOperationExecutor execute action has changed and now gives a </FONT>
<FONT COLOR="#000000">&gt;&gt; return type 'T', which was previously void. Does anybody have any idea of </FONT>
<FONT COLOR="#000000">&gt;&gt; why this changed and what T is?</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; public IValidator newValidator(EvaluationMode mode) {</FONT>
<FONT COLOR="#000000">&gt;&gt; assert mode != null &amp;&amp; !mode.isNull();</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; IProviderOperationExecutor executor = new IProviderOperationExecutor() {</FONT>
<FONT COLOR="#000000">&gt;&gt; public void execute(IProviderOperation op) { &lt; --ERROR - VOID NOT </FONT>
<FONT COLOR="#000000">&gt;&gt; COMPATIABLE </FONT>
<FONT COLOR="#000000">&gt;&gt; MyModelValidationService.this.execute(op);</FONT>
<FONT COLOR="#000000">&gt;&gt; }};</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; if (mode == EvaluationMode.BATCH) {</FONT>
<FONT COLOR="#000000">&gt;&gt; return new BatchValidator(executor);</FONT>
<FONT COLOR="#000000">&gt;&gt; } else if (mode == EvaluationMode.LIVE) {</FONT>
<FONT COLOR="#000000">&gt;&gt; return new LiveValidator(executor);</FONT>
<FONT COLOR="#000000">&gt;&gt; } else {</FONT>
<FONT COLOR="#000000">&gt;&gt; throw new IllegalArgumentException();</FONT>
<FONT COLOR="#000000">&gt;&gt; }</FONT>
<FONT COLOR="#000000">&gt;&gt; }</FONT>
<FONT COLOR="#000000">&gt;&gt; </FONT>
<FONT COLOR="#000000">&gt;&gt; I hope this makes sense - thanks for your help,</FONT>
<FONT COLOR="#000000">&gt;&gt; Mark</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>


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

--=-ludr1XHsT4d3mHp2EpQZ--
Previous Topic:[Announce] MDT OCL 1.2.1 M200807161339 is available
Next Topic:Question about <<definition>> stereotype
Goto Forum:
  


Current Time: Wed Aug 20 10:48:11 EDT 2014

Powered by FUDForum. Page generated in 0.06831 seconds