|
Re: mutual calling relationship [message #1841481 is a reply to message #1841436] |
Tue, 18 May 2021 16:03 |
|
It is not directly clear to me how the different RE!MessageEnd and RE!CallMessage elements should relate to each other: they are created according to different logic in the Task2Interaction rule., and the code used to "find" related target elements in Task2MessageEndS and Task2CallMessages simply seems to fetch all elements generated by the other rule (which is impossible).
In any case, you cannot navigate the target model, so you cannot find elements generated by other rules without using ATL's tracing mechanism. If you're able to use unique lazy rules, you can just invoke the rule multiple times on the same input element, and it will always return the same output element. Whenever you need to access the output element, you just invoke the unique lazy rule again on its corresponding input element and capture the return value. Caveat: in the case of bidirectional dependencies between two target elements, you MUST generate them from the same (unique) lazy rule, or you will trigger an infinite loop.
If you can specify a global condition for when certain output elements should be created ("for all ..."), you can use ATL's normal matched rules. Matched rules allow you to work with bidirectional dependencies between output elements spread across different rules via implicit source-to-target element tracing.
Is there a specific reason why you chose to use lazy rules instead of normal rules?
Cheers,
Dennis
|
|
|
Powered by
FUDForum. Page generated in 0.02158 seconds