Bind the sub-generator and related component |
Post Reply |
Author | |
fuyyy021
Member Joined: 23.Mar.2021 Location: Australia Points: 3 |
Post Options
Thanks(0)
Posted: 23.Mar.2021 at 16:02 |
Hi. Thanks for reading this message. I have a usage problem. I have read the manual and samples, but I have not found the answer. Now I have to use DSM to design a model to
generate the JavaScript code. I am not sure if I can bind the sub-generator and
related component. I mean when I drag a component and put it into the main
interface, the related sub-generator will be added automatically. Edited by ForumDBA - 23.Mar.2021 at 20:48 |
|
jpt
MetaCase Joined: 25.Mar.2008 Points: 239 |
Post Options
Thanks(0)
|
Not sure if
understood correctly the part on ”…the related
sub-generator will be added automatically”, but when the generator is executed,
it always operates in the context provided by the currently accessed model
element and its environment. Normally generators start based on a selected
graph (see Primer). If the graph
contains components they can be thus accessed e.g. with foreach .Component {} and if
there is interface element related it can be accessed with the above foreach e.g.
by do >().Interface command. |
|
fuyyy021
Member Joined: 23.Mar.2021 Location: Australia Points: 3 |
Post Options
Thanks(0)
|
Hi,
I mean can I link the code generator to the component as a property? Because now I need to design a tool for the people who do not know programming. They are just the experts in their own fields such as Finance. The result is that we pre-write code generators and link them to components, they can drag the components they need and put them into the main interface. After they put all components into the interface, they just need to click on the button to execute the code generator. And the browser will be opened and run the Javascript code. |
|
jpt
MetaCase Joined: 25.Mar.2008 Points: 239 |
Post Options
Thanks(0)
|
Yes, it is also possible to select a generator to be run based on a value given in a property. Example: ObjectType 'Component' has a PropertyType 'Output' which is a list of values to be selected by user. Possible list values could be 'code', 'test', 'doc'. There is then generators made with names code, test and doc accordingly. The generator for calling selected would be: foreach .Component; { subreport :Output; run } In case the componentX has value 'test' in Output property, it would call generator 'test' and so on. You may see a bit similar example in Watch tutorial: WatchFamily graph has a property 'Generation target platform' which is used to call different generators like C# or Java. Search in Generator Editor string :Generation target platform and you can see its usage. |
|
fuyyy021
Member Joined: 23.Mar.2021 Location: Australia Points: 3 |
Post Options
Thanks(0)
|
Thanks for your reply. It's very helpful. I will check the manual and test it.
|
|
Post Reply | |
Tweet |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |