MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Bind the sub-generator and related component
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bind the sub-generator and related component

 Post Reply Post Reply
Author
Message
fuyyy021 View Drop Down
Member
Member


Joined: 23.Mar.2021
Location: Australia
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote fuyyy021 Quote  Post ReplyReply Direct Link To This Post Topic: Bind the sub-generator and related component
    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
Back to Top
jpt View Drop Down
MetaCase
MetaCase
Avatar

Joined: 25.Mar.2008
Points: 239
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpt Quote  Post ReplyReply Direct Link To This Post Posted: 23.Mar.2021 at 21:22

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.

Back to Top
fuyyy021 View Drop Down
Member
Member


Joined: 23.Mar.2021
Location: Australia
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote fuyyy021 Quote  Post ReplyReply Direct Link To This Post Posted: 23.Mar.2021 at 21:37
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.
Back to Top
jpt View Drop Down
MetaCase
MetaCase
Avatar

Joined: 25.Mar.2008
Points: 239
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpt Quote  Post ReplyReply Direct Link To This Post Posted: 23.Mar.2021 at 22:39
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.

Back to Top
fuyyy021 View Drop Down
Member
Member


Joined: 23.Mar.2021
Location: Australia
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote fuyyy021 Quote  Post ReplyReply Direct Link To This Post Posted: 23.Mar.2021 at 23:00
Thanks for your reply. It's very helpful. I will check the manual and test it.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.063 seconds.