Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Class with any operation with more of one parameter(Class with any operation with more of one parameter)
Class with any operation with more of one parameter [message #639642] Wed, 17 November 2010 05:23 Go to next message
olafo987  is currently offline olafo987
Messages: 13
Registered: November 2010
Junior Member
Hi

How I can determine if one Class have some operation with more of one parameter?.

if in my model UML I have the following classes:

ContractService
public delecteContract(pContract : Contract, pCustomer costumer) : Contract
______

TypeContractservice
addTypeContr(pTypeContract : TypeContract) : TypeContract
deleteTypeCont(pTypeContract : TypeContract) : TypeContract
_____

I should find only ContractService

Thanks
Re: Class with any operation with more of one parameter [message #639669 is a reply to message #639642] Wed, 17 November 2010 07:15 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1622
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070602010404020307080104
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

Please prefix your post subjects with the name of the tool you're using.
Is that XPand, Acceleo, Jet? Your message doesn't mention any hint
towards this.

If you're using Acceleo, you could use the following (starting from a
package):
[package.packagedElements->filter(Class)->select(ownedOperations- >select(parameters->size()
> 1)->notEmpty())/]

There are less convoluted means depending on where exactly you wish to
filter these classes, but that's the whole thing.

Laurent Goubet
Obeo

On 17/11/2010 11:23, olafo987 wrote:
> Hi
>
> How I can determine if one Class have some operation with more of one
> parameter?.
> if in my model UML I have the following classes:
>
> ContractService
> public delecteContract(pContract : Contract, pCustomer costumer) : Contract
> ______
>
> TypeContractservice
> addTypeContr(pTypeContract : TypeContract) : TypeContract
> deleteTypeCont(pTypeContract : TypeContract) : TypeContract
> _____
>
> I should find only ContractService
>
> Thanks


--------------070602010404020307080104
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------070602010404020307080104--
Re: Class with any operation with more of one parameter [message #640337 is a reply to message #639642] Sat, 20 November 2010 15:00 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

In OCL as in many other things you proceed in stages

First select all relevant classes; allInstances if you don't have
anything better,
the select all operations
then count parameters
then compare the count with 1

Regards

Ed Willink


On 17/11/2010 10:23, olafo987 wrote:
> Hi
>
> How I can determine if one Class have some operation with more of one
> parameter?.
> if in my model UML I have the following classes:
>
> ContractService
> public delecteContract(pContract : Contract, pCustomer costumer) :
> Contract
> ______
>
> TypeContractservice
> addTypeContr(pTypeContract : TypeContract) : TypeContract
> deleteTypeCont(pTypeContract : TypeContract) : TypeContract
> _____
>
> I should find only ContractService
>
> Thanks
Previous Topic:[Acceleo 3 - ocl] a "loop" question
Next Topic:[Acceleo 3] Iteration over the types of a model
Goto Forum:
  


Current Time: Thu Jul 31 19:54:08 EDT 2014

Powered by FUDForum. Page generated in 0.03580 seconds