Issue with muliple activations

0 votes
asked Mar 1, 2023 in Question / help by Davy

I have the following setup:

    @startuml
    !pragma teoz true

    participant Application
    participant interface
    box "Module"
    participant submodule_1
    participant submodule_n
    end box

    group function1
    Application -> interface ++: command(params)

    interface -> submodule_1 ++: command(params)
    & interface -> submodule_n++

    interface <- submodule_1: ack

    end
    @enduml

dus results in the following sequence diagram. The command is a broadcast as such all submodules should activate at the same time. So far all my attempts to get it to activate on the same time end up in the second submodule activating slightly earlier. Is there anyway to handle this correctly?

PlantUML diagram

//www.plantuml.com/plantuml/png/TP11oeCm48NtSuhvNVoq11TkfHHxW9wXZ35Ag9c4E87IqpTsOuIwoUAzZ_U5wHQXACdDy1SYJOvGZ7-Zn6G0Ggwije5Oy1R2R3M9zRpBBOk98sa3lNzXTVT3casrGvRKks_yQ0vo1iC3vW60AVeKS4oiLrK3XHVhwwP3fLhKtZdYuHGeablE05kTsSBxa_x70voLAgSkTJdL8kadh1-6BZ_vT1y0

2 Answers

0 votes
answered Mar 6, 2023 by anonymous
 
Best answer

The following workaround achieves the desired outcome

Include the message [command(params)] in the extended invocation as follows

    @startuml
    !pragma teoz true

    participant Application
    participant interface
    box "Module"
    participant submodule_1
    participant submodule_n
    end box

    group function1
    Application -> interface ++: command(params)

    interface -> submodule_1 ++: command(params)
    & interface -> submodule_n ++ : command(params)

    interface <- submodule_1: ack

    end
    @enduml

commented Mar 6, 2023 by Davy
Yes this worked. Thank you for your help
0 votes
answered Mar 1, 2023 by Todd Musheno (2,680 points)
Sequence diagrams are intended to show... well the sequence of things.

You are talking about activation, so what you are saying is you have one process (interface) that creates 2 other processes (sub1, and n) and that process does both of those things at the same time...

I get you might not know from code what happens first, but if (interface) is a single process, it can only do a single thing at a time...

I would suggest adding an anchor to both creation cases, and indicate that its possible in any order...

You also may be really wanting a timing diagram instead... not sure your exact scenario, but it sounds like you may be using the wrong diagram type for your needs.
commented Mar 1, 2023 by Davy

the processes here are split by communication protocols through uart the submodules are end notes on this uart interface. The protocol running over the uart interface allows for a broadcast to happen as such a command that is send only ones but received by multiple end points at the same time (more or less). Not that this is mainly a least working example of what my issue is the eventually sequence diagram is more extended. The issue I am facing is that when the broadcast gets to submodule_n it starts the process before the 'broadcast command' reaches it.

In the extended version of this sequence diagram there is a mix of broadcasts, and command that only reach a specific 'submodule' which is a device on a uart bus. I want this diagram to indicate the sequence of commands that need to be send to perform a specific task that being 'function 1'.


 

...