I am going through the tutorial for Model simulation of Enterprise Architect. In the Dynamic Simulations, under section of CreateObject, it says that the Output action pin stores the created object and can be passed via an object flow to another action. The attributes of the created object can be then accessed in the destination action. See EA Help and
Breakpoint 1: A CreateObject Action creates an Object ´cb´ and the local variable
Breakpoint 2: The created object passed to Action3
via an object flow in action pins, the control is passed with control flow.
However, as you can see that the object cb
is nowhere to be seen in Action3
. I would really appreciate if someone can help me in this and explain how it works.
So, I tried a lot of things to do this. And I somehow figured out a way to do part of it. So here is the answer.
Pre-Requisite: A class with a few attributes and operation. Along with the behavior of the operation to be performed. Like in the below example, following is the behavior defined for add operation.
Steps:
NOTE: The object "cb" is still nowhere to be seen. However, an object is definitely created with a unique id as shown in the above code snippet. A part of the question still remains unanswered is the role of action pins.