Few blocks in the Anylogic Process Modeling Library like "Source" have actions like "On exit" and "On at exit". What is the difference between the two?
I was trying to create a simple flow of:
source -> SelectOutput -> Service -> Sink
The agent being created by source block has a Boolean property "is_vip".
When I assigned agent.is_vip to true or false in the "on exit" action of the source, the routing did not work, but when I moved the logic to "on at exit" of the source block, the routing started working.
>Solution :
There is no question here, but you are correct and that is the difference between the boxes. OnAtExit is evaluated before an agent exits the block. OnExit is evaluated after it left.
If a downstream block like SelectOutput depends on some upstream changes, they will not be registered if done in upstream OnExit as the agent is already in the SelectOutput block.
Always safer to use OnAtExit