Search code examples
architectureumlmodelingactivity-diagram

How to visualize collaborative activities in an UML activity diagram?


I'm currently stuck on modelling an activity diagram for a workflow which happens in a collaborative way by many users. It is somewhat comparable to multiple users editing and validating the same Confluence Page at the same time so I decided to use this as an example which is easy to understand.

The workflow for a single user would look like this:

The user edits a page (complex activity in my case), publishes it, then performs some kind of validation (another complex activity) on the published page. If unsatisfied, the user goes back to editing the page and repeats this cycle until satisfied.

Activity Diagram

Now imagine the collaborative version of it like this (this is a horrible workflow of course, but imagine you would have to model it anyway):

Several users edit the same page collaboratively, and at any point, one of the users can publish the current contents and start validating what has been edited so far. The other users will however stay in the editing step and might edit further content while the first user is validating. The "states" of the various users are independent from each other, so user 1 could start validating, then users 2 and 3 could publish changes and start validating as well while user 1 goes back to editing, during which user 4 publishes changes etc. The workflow will only end once all users have decided they don't want any further changes.

This leads to the question: How would I have to change the diagram to express the collaborative workflow I described here? Is the whole activity diagram a <<parallel>> expansion region? Do I add a synchronisation point at the end? Is it an <<iterative>> region instead? Or are the inner activities parallel, but not the whole workflow?


Solution

  • If all the Example edit/validate cycles are independent, i.e. a user edits the page to make his/her changes and validate his/her changes independently, your current representation would be fine, since the workflow would start and end for each user independently.

    If you wand to explicitly document that several users may start these activities in parallel, you need an "enclosing" activity diagram that shows the multi-user context without breaking the individual cycles. This activity would have a CallBehavioraction that calls Example the edit/validate cycle activity. To show the concurrency situation, you would indeed use an expansion region, or, better, the shorthand notation:

    enter image description here

    The little star seems like a type, but it means in fact that there are multiple concurrent executions of the activity:

    (UML 2.5.1 specs, page 483): (...) instead of using a mode keyword, a “*” is placed in the upper right-hand corner of the symbol (this is intended to indicate “multiple execution.” The notation maps to an expansion region containing the CallBehaviorAction (as in Figure 16.50) with mode=parallel.

    (Note: the missing closing parentheses in the quote is a typo in the specs).

    If the edit/validate cycles are not that independent, for example if the validation would validate not only the local changes, but also the changes made by the others, it would be more complex:

    • First, you'd need to somehow explicit the collaborative editing or the merging of the changes with the others.
    • Then, if this revised model would allow to consider each "combined cycle" independently per user, the best is to use the same approach as above. But if not, you'd need to enclose it an expansion region. I have to admit that it's not clear to me if its mode should then be parallel or stream.
    • You'd then also need to clarify if a change by another user after the validation would require users having already validated to revalidate without having made any change. This might require a further enhancement of your initial cycle.