Hi,
What could be the cause that a PostCreate event is not being evaluated/executed ? I've got a child rule with a postcreateself method in it's design and this method is executed when I manually add this child to a node in the modeltree. This child is also used a lot in other higherlevel designs as a childrule, and here the event is not fired.
If I execute via the console the postcreateself() method, I get a return value, something like this :
{{:Action, :createDynamicRule, :Part, Root.Unit_1.LW1, :Name, :Vertikalen, :formula, "{Root.Unit_1.LW1.Deur_1.LinkerKoker}"}}
So it looks like the implementation of the eventhandler contains no errors. Am I overlooking something ?
Cheers,
Mark
Solved! Go to Solution.
Solved by Jon.Balgley. Go to Solution.
Hi Mark,
Though I am not an ETO expert, my gut feeling is that each higher level design should have thier own PostCreateSelf() child rule, and then refchain in your PostCreateSelf() of higher level design should change accordinly to address wrapped children.
Regards,
-Ishwar N
Hi,
Correct me when I'm wrong. Apparantly the event is only triggered when I dynamically add a child (via the UI) and not when the child is added via the 'normal' design rules.
Cheers,
Mark
Sorry for not replying sooner.
Yes, you are correct, it only applies to newly-created dynamic rules. PostCreateSelf is intended to be an event that tells you when the dynamic child rule has been added, so you can add or remove or modify any related rules at that time.
There is some other rule ("onCreate", I think) which is called every time any part is instantiated. But it is difficult or impossible to use reliably, since you cannot predict when a Child rule will be unbound and re-evaluated.