Environment: Cameo Enterprise Architecture + Simulation Toolkit, versions 2022x, 2024x & 2026x
Here is an odd problem I encountered when making an Activity to demonstrate a few things. I wanted to assemble an array of integers in one Action and deal with its members one-by-one in another part of the Activity. This is the sort of thing Expansion Regions are for.
It seems that when you launch one Activity via another Activity, then Decision Nodes inside Expansion Regions misbehave. (There are all kinds of reasons you might want to do this in a non-trivial system.)
The problem manifests as follows: the Decision Node in the Expansion Region chooses its exit Activity Edge programmatically via a script expression in the edge's Guard, but when the containing Activity is invoked by another Activity, the Decision Node ignores the Guard's script and posts a yes/no dialog with the text of the script instead. If the Activity is launched (simulation) directly, everything works as expected. If the Decision Node and its related Actions are extracted from the Expansion Region (and it's fed individual integers), then the logic works as expected.
I've attached the model MDZIP for community examination, and four short videos to illustrate the issue:
- Works: The decision logic, launched directly (illustrates just the programmatic Decision Node)
- Works: The decision logic, launched indirectly
- Works: The decision logic within an Expansion Region, launched directly (illustrates intended operation)
- Fails: The decision logic within an Expansion Region, launched indirectly (what I originally wanted to demonstrate)
I have done hours of research and experimentation to try to locate the problem, and I am glad to have been able to reduce it to a reproducible form. It will take someone who knows Cameo & Simulation Toolkit innards to take this further.
My original model was more interesting. You can see it in the "More Interesting Model" graphic. 🙂
CameoActivityExpansion RegionDecision Node2022x2024x2026x Simulation
Expansion Region Issue.mdzip
Works, Decision Logic, Launched Directly
Works, Decision Logic, Launched Indirectly
Works, Expansion Region with Decision Logic, Launched Directly
Fails, Expansion Region with Decision Logic, Launched Indirectly
More Interesting Model
More Interesting Model, Closed Loop Version
