Search code examples
sequence-diagramplantumlstate-diagram

PlantUml sequence diagram to state diagram


Is there any way to convert a sequence diagram into a state diagram automatically? I have searched on google about how to do it, but unfortunately I haven't found anything yet.

Thank you very much in advance. Best regards.


Solution

  • A sequence diagram shows a workflow for an overall system, typically with several involved objects (or actors) and the interactions between them.

    A state diagram shows a finite number of possible states for a single object or an overall system and the possible transitions between these states.

    (see also this discussion)

    Now you could assume that each interaction in the state diagam corresponds to a state transition and construct a state diagram based on this (or possibly have it constructed by an automatic conversion mechanism). However, I do not see not much added value in doing so, because you would end up showing the same aspects that have already been modeled. It would be more interesting to complement the interactions by showing some more information such as the internal states of the participating objects.

    So a state diagram in place of an existing sequence diagram should not be necessary, and a state diagram in addition to a sequence diagram should also add some additional content (which makes it difficult, if not impossible, to develop an automatism for this).