Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Generating code with OCL constraints etc.. in it
Generating code with OCL constraints etc.. in it [message #227580] Mon, 27 July 2009 16:44 Go to next message
RefuX Zanzeebarr is currently offline RefuX Zanzeebarr
Messages: 51
Registered: July 2009
Member
No to sure if this is the correct place to post, please redirect me if
I'm wrong.

I'm working on a project in RSA 7.5.1 and defining OCL constraints
there. I'm wanting to generate Java code that has these constraints in
it. Currently I'm mucking about with creating an EMF Gen Model from a
UML 2.1 export of the RSA emx file.
The gen model looks OK as far as I can tell... However when I generate
the model code, I just get a bunch of "TODO: implement this method" in
the code :(

I've done some digging around, looks like the couple of guides I've
found recommend turning on dynamic templates in the gen model and
creating custom JET templates that insert the ocl constraints into the code.

I'm just wondering is this the current 'best' way to do this? I would of
expected that there would be a canned solution to this problem? i.e. The
OCL project provide a set of templates for EMF->Model generation....

Any clarification the state of things will no doubt be quite enlightening :)
Re: Generating code with OCL constraints etc.. in it [message #249409 is a reply to message #227580] Mon, 27 July 2009 17:12 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi RefuX,

You may want to have a look at the OCL section at the bottom of the
following:
http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2_files/frame.htm

Regards,
- James

"RefuX" <refux@hotmail.com> wrote in message
news:h4l3ju$j39$1@build.eclipse.org...
> No to sure if this is the correct place to post, please redirect me if I'm
> wrong.
>
> I'm working on a project in RSA 7.5.1 and defining OCL constraints there.
> I'm wanting to generate Java code that has these constraints in it.
> Currently I'm mucking about with creating an EMF Gen Model from a UML 2.1
> export of the RSA emx file.
> The gen model looks OK as far as I can tell... However when I generate the
> model code, I just get a bunch of "TODO: implement this method" in the
> code :(
>
> I've done some digging around, looks like the couple of guides I've found
> recommend turning on dynamic templates in the gen model and creating
> custom JET templates that insert the ocl constraints into the code.
>
> I'm just wondering is this the current 'best' way to do this? I would of
> expected that there would be a canned solution to this problem? i.e. The
> OCL project provide a set of templates for EMF->Model generation....
>
> Any clarification the state of things will no doubt be quite enlightening
> :)
Re: Generating code with OCL constraints etc.. in it [message #319279 is a reply to message #249409] Mon, 27 July 2009 21:54 Go to previous message
RefuX Zanzeebarr is currently offline RefuX Zanzeebarr
Messages: 51
Registered: July 2009
Member
Thank you!

Was just needing to set 'Operation Bodies' to Process on the EMF Gen
Model UML import.

I also updated my UML model to use ECORE data types
( http://sdqweb.ipd.uka.de/wiki/Creating_EMF-Models_with_RSA#U sing_ECORE_data_types),
so I could switch some of my 'primitive' data types to ecore ones.
Generated like a charm, not a red x in sight.

Haven't actually tried creating instances of the objects yet, but it
looks good :)

James Bruck wrote:
> Hi RefuX,
>
> You may want to have a look at the OCL section at the bottom of the
> following:
> http://www.eclipse.org/modeling/mdt/uml2/docs/presentations/ EclipseCon2008_LongTalk_NewFeaturesOfUML2_files/frame.htm
>
> Regards,
> - James
>
> "RefuX" <refux@hotmail.com> wrote in message
> news:h4l3ju$j39$1@build.eclipse.org...
>> No to sure if this is the correct place to post, please redirect me if I'm
>> wrong.
>>
>> I'm working on a project in RSA 7.5.1 and defining OCL constraints there.
>> I'm wanting to generate Java code that has these constraints in it.
>> Currently I'm mucking about with creating an EMF Gen Model from a UML 2.1
>> export of the RSA emx file.
>> The gen model looks OK as far as I can tell... However when I generate the
>> model code, I just get a bunch of "TODO: implement this method" in the
>> code :(
>>
>> I've done some digging around, looks like the couple of guides I've found
>> recommend turning on dynamic templates in the gen model and creating
>> custom JET templates that insert the ocl constraints into the code.
>>
>> I'm just wondering is this the current 'best' way to do this? I would of
>> expected that there would be a canned solution to this problem? i.e. The
>> OCL project provide a set of templates for EMF->Model generation....
>>
>> Any clarification the state of things will no doubt be quite enlightening
>> :)
>
>
Previous Topic:validate enumartion litrerals ocl
Next Topic:UML OCL and Date
Goto Forum:
  


Current Time: Sat Aug 30 00:42:58 EDT 2014

Powered by FUDForum. Page generated in 0.02084 seconds