use generator script with decomposition |
Post Reply |
Author | ||
edward22243
Major Contributor Joined: 19.Apr.2019 Points: 41 |
Post Options
Thanks(0)
Posted: 25.Sep.2020 at 11:05 |
|
I have two graphs.
Graph 1 = ProductFamily Graph 2 = Product Graph 1 has objects Product that is a decomposition of graph 2. Now I defined a MERL script for graph2 and I want in graph 1 to traverse all Products and call the MERL script foreach product. However, since I defined the script in graph2 I cannot see it. Do I have to copy the script to Graph 1? or is there a smarter way to use this script?
|
||
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Post Options
Thanks(0)
|
|
Do you mean you have two Graph TYPES, rather than two Graphs (instances of the same type)? I'll guess so, and also that the Product graph type is a decomposition of the Product object type in the ProductFamily graph type.
Generators are defined for a graph type. The default display in the Generator Editor shows the call hierarchy of generators in the selected graph type. You just need your generator to navigate to the decomposition graph, and then any sub-generator you call will be looked up in the decomposition graph type. Let's call the generators ProductFamilyGenerator and ProductGenerator. E.g. in ProductFamily:
and in the decomposition graph type, Product:
|
||
edward22243
Major Contributor Joined: 19.Apr.2019 Points: 41 |
Post Options
Thanks(0)
|
|
Indeed two Graph types, my bad. And the Product graph type is a decomposition of the Product objecttype in ProductFamily graph type.
I used the same foreach-structure as you showed but I called a report instead of a function and that did not work. Changing the report to a function did the trick. Thank you |
||
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Post Options
Thanks(0)
|
|
Great, glad to hear you got it sorted. There are two syntaxes, both for calling sub-generators:
ProductGenerator() or subreport 'ProductGenerator' run Changing between them wouldn't change whether it works, so probably it was some other typo that was the real cause. Both can supply arguments; only the latter allows you to build up the name of the sub-generator at run-time.
Edited by stevek - 25.Sep.2020 at 16:54 |
||
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 |