Search code examples
umlactivity-diagram

Is an activity calling action in an activity considered finished only when the called activity terminates and reaches its activity end node?


Assuming we have two activities; activity_1 and activity_2 with an action (action_A) present in activity_1 that invokes activity_2, is action_A considered done/finished only when the invoked activity_2 terminates and reaches its activity end node? Or is action_A considered done once it starts activity_2 and both activities run independently (activity_1 continues running while activity_2 runs as well)?


Solution

  • If I well understand your action is a call action

    From the formal/17-12-05 § 16.3.3.1 page 451 : a CallAction may result in either a synchronous or asynchronous Behavior invocation, either directly or through an Operation call.

    • If the call is synchronous ( isSynchronous =true), then the execution of the Action does not complete until the execution of the invoked Behavior completes, normally or otherwise. (If the Behavior execution does not complete normally but, instead, raises an exception, then that exception is propagated out of the CallAction, (see sub clauses 15.5.3 and 16.13 on exceptions and how they are handled).

    • If the call is asynchronous ( isSynchronous =false), then the execution of the Action completes as soon as the Behavior has been invoked. When an asynchronous call is complete, execution of the Behavior containing the CallAction proceeds independently of and concurrently with the execution of the invoked Behavior, including the handling of any exceptional conditions that occur while the Behavior is executing.

    is action_A considered done/finished only when the invoked activity_2 terminates and reaches its activity end node?

    yes if the call is synchronous ( more the case of an exception )

    Or is action_A considered done once it starts activity_2 and both activities run independently (activity_1 continues running while activity_2 runs as well)

    in that case the call is asynchronous so the execution of the action completes as soon as the activity_2 has been invoked without waiting the end of the activity_2