[go: up one dir, main page]

Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Vorto » Cross reference example(Cross reference example)
Cross reference example [message #1729015] Sat, 09 April 2016 13:51 Go to next message
Komaromi Mate is currently offline Komaromi MateFriend
Messages: 6
Registered: April 2016
Location: Hungary
Junior Member
Hey guys!

Im playing with this tool, and i want to try something interesting, but the Vorto refuses to help me, and i cant figure it out how can i make it. Can you help me, giving an example of code?

So, i want to create two Entity/Enum, whom has an attribute referring to each other. so for example:

Entity Alpha {
mandatory Attrib1 as Beta
}

and

Enitity Beta {
mandatory Attrib2 as Alpha
}

How does it work? How does it look like(imports, usings)? I want to check the implemented generators, how they defend this kind of reference and not going into infinite loop, when they generate stuff.

I also interested this kind of reference in the function blocks. Can you help me?

Best regards,
Math
Re: Cross reference example [message #1729079 is a reply to message #1729015] Mon, 11 April 2016 02:17 Go to previous messageGo to next message
Alexander Edelmann is currently offline Alexander EdelmannFriend
Messages: 39
Registered: January 2015
Member
Hi Math,
The toolset does not forbid cyclic dependencies which could potentially lead to a stackoverflow exception during generation, like in your case. This is a current limitation of the example generators not checking cyclic references.
Also, function blocks cannot reference other function blocks at the moment.
What use case do you have in mind to implement with Vorto which requires cyclic dependency?
Cheers, Alex
Re: Cross reference example [message #1729095 is a reply to message #1729079] Mon, 11 April 2016 07:35 Go to previous messageGo to next message
Komaromi Mate is currently offline Komaromi MateFriend
Messages: 6
Registered: April 2016
Location: Hungary
Junior Member
Im trying to make a generic generator, what creates SQL tables from the modell, so my problem is, when i create tables, multiple tables can be created for the same entity. I walk trough the infomodells, the referred functionblocks and lastly the referred Entities and Enums. But this issue comes to my mind when i checked some example codes, and it contains entities with referred entities. So one way its possible, but two-way is forbidden?
Re: Cross reference example [message #1729098 is a reply to message #1729095] Mon, 11 April 2016 07:57 Go to previous messageGo to next message
Olaf Weinmann is currently offline Olaf WeinmannFriend
Messages: 29
Registered: May 2015
Junior Member
Hello Math,

from a moddeling perspective we do not permit that. So please create two entities and drag and drop them to each other in the "DataType Models"-Perspective. I assume that most of the existing code generators will not work with that cyclic dependency. This is something that we should have in mind and find a solution for it. But for your use-case and your specific code generator this should be possible.

Let us know if this helps! Are you going to contribute the new code generator to the Vorto project?

Cheers,

Olaf
Re: Cross reference example [message #1729104 is a reply to message #1729098] Mon, 11 April 2016 08:51 Go to previous messageGo to next message
Komaromi Mate is currently offline Komaromi MateFriend
Messages: 6
Registered: April 2016
Location: Hungary
Junior Member
Hey!

I will check it today later but for the first blink i have to say, if i drop one entity to the other in the DataType Perspective, it creates a reference (Ive tried it already). But what i want is an actual attribute of the Entity(like how i explained in the topic opener), couse during the code generation, i walk trough the properties of the elements. I guess now this kind of reference is forbidden, but correct me.

I havent make my decision about the contrubution, first of all it must be a useful, working generator, to make sense of sharing Smile
Re: Cross reference example [message #1729109 is a reply to message #1729104] Mon, 11 April 2016 09:11 Go to previous messageGo to next message
Olaf Weinmann is currently offline Olaf WeinmannFriend
Messages: 29
Registered: May 2015
Junior Member
The reference that you are describing in your initial question is possible. The way you are modelling entity alpha and entity beta is correct. You only need to make sure that in entity alpha the entity beta is imported by means of a corresponding "using" statement. A corresponding "using" statement must also be available in entity beta for importing the entity alpha.

Let us know if this approach solved your issue.

Cheers,

Olaf

Re: Cross reference example [message #1729246 is a reply to message #1729109] Tue, 12 April 2016 11:47 Go to previous messageGo to next message
Komaromi Mate is currently offline Komaromi MateFriend
Messages: 6
Registered: April 2016
Location: Hungary
Junior Member
Thanks the help, i can finally make this example! The good thing is my generator doesnt goes crazy with this type of infinite loop, but the bad thing is it doesnt even recognize it like a Entity property. i have to do some work with it, and hopefully i can fix it. Thanks the help!
Re: Cross reference example [message #1729347 is a reply to message #1729246] Wed, 13 April 2016 09:39 Go to previous messageGo to next message
Olaf Weinmann is currently offline Olaf WeinmannFriend
Messages: 29
Registered: May 2015
Junior Member
You are welcome! Let us know if you have further questions! Smile
Re: Cross reference example [message #1729840 is a reply to message #1729347] Tue, 19 April 2016 12:47 Go to previous messageGo to next message
Komaromi Mate is currently offline Komaromi MateFriend
Messages: 6
Registered: April 2016
Location: Hungary
Junior Member
Finally i solved to force my generator working perfectly. Thanks for the help, but i have another question.
Its a bit different topic, but i hope that you wouldnt mind if i ask it here Smile So...

I want to make my generator a bit generic, so after the rightclick->generate order, somehow you can manipulate the sort of database, language of the generated code, etc. Is there any option, to provide a bunch of variations, parameters to the user, during the code generation?

Thanks for the help in advance!

Best regards,
Math

[Updated on: Tue, 19 April 2016 12:47]

Report message to a moderator

Re: Cross reference example [message #1733603 is a reply to message #1729840] Mon, 30 May 2016 11:38 Go to previous messageGo to next message
Olaf Weinmann is currently offline Olaf WeinmannFriend
Messages: 29
Registered: May 2015
Junior Member
Hi Math,

this is currently not supported. We have a related Issue: https://github.com/eclipse/vorto/issues/98
Would you be interested in adding your requirements to that issue?

Thanks,

Olaf
Re: Cross reference example [message #1733894 is a reply to message #1729840] Wed, 01 June 2016 21:47 Go to previous message
Marcus Munzert is currently offline Marcus MunzertFriend
Messages: 10
Registered: August 2012
Location: Freiburg, Germany
Junior Member
Hi Math,

I have just read your question regarding the provisioning of parameters for your Generator. Our Virtual Developer Platform allows you to define such parameters for generators that run on it. Also, in relation to Vorto, Virtual Developer lets you ...

  • deploy and execute existing Vorto generators (we are currently working on a proof of this by doing it for one of the exmple generators of Vorto)
  • develop generators that access the Vorto model repository remotely, through their REST-API
  • develop generators that consume Vorto models in form of a set of model files


Cheers,
Marcus


CEO and President
Generative Software GmbH
Cornelia-Schlosser-Allee 15
79111 Freiburg
Germany

www.generative-software.de
Phone: +49 761 1562051
Fax: +49 761 7043098

www.virtual-developer.com
The efficient use of software development
Previous Topic:ThingWorx Example Generator Problems
Next Topic:Multimedia model
Goto Forum:
  


Current Time: Thu Dec 12 16:45:50 GMT 2024

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

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

Back to the top