3

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?

Tim Meyer
  • 12,210
  • 8
  • 64
  • 97
  • You can not show _anything_ in one diagram. Split it into several significant scenarios and show each separately. That't the only way you can show it. The above would be _sunny day_ then add one with concurrent editing where one overwrites the changes of another editor etc. – qwerty_so Sep 09 '22 at 19:31
  • Additionally you would likely use state machines for the document so you can show how concurrent editing is possible (which can be difficult to no limits). – qwerty_so Sep 10 '22 at 17:32
  • Though I first upvoted this question I now see that there is no simple answer to it. Collaborative work is simply complex and you can not give a concise answer which is why I now vote for closing the question as too broad. – qwerty_so Sep 10 '22 at 17:42

2 Answers2

1

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.
Christophe
  • 68,716
  • 7
  • 72
  • 138
  • I was indeed thinking of the users agreeing to the whole content in the end, so e.g. maybe every user writes a chapter but will validate the other chapters as well, I could have been more clear on that. The idea of modelling a single combined cycle and using that one level above as a parallel activity, or in a parallel activity, sounds promising, I'll try and see if I can work with that. – Tim Meyer Sep 12 '22 at 06:54
0

This is not really an answer, but too long for a comment. The issue is with your question itself.


Assume you have some content and two people edit it in parallel to correct typos at two different places. That could be handled trivially. But now assume the content has a contradiction that needs to be fixed. Say you have a statement A in the beginning and a conclusion with not A. Now you have two editors. This first will fix it to have overall A meaning and the second one will change it to be overall not A. There you have a clash.

There are lots of ways to handle that. And that's the point. You have to define these ways. Like you can build a car one by one sequentially, there is also a way to parallelize the build. But only according to strict rules. Without you simply end with a mess.

So what is the conclusion? Be clear on what you want to do and what your goal is. Only then start to deal with details. Not vice versa.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • While you are right for a manufacturing process, think about something like Confluence (or any other Wiki): They did in fact not define the way of collaboration; they just allowed several users to edit the same page, see what the others are typing, and added a publish button that anyone can press at any given time. If one user does that, that state of the content is published, but the others are still in editing mode. That means the users define themselves how they want to collaborate. Our case is actually similar, since the output is data, rather than a product to be sold. – Tim Meyer Sep 12 '22 at 09:11
  • Well, if they allow that, it will lead to simply a mess. Two editors competing to each other will not produce meaningful results. They need to communicate and agree upon what has to be done. I only worked a short time with Confluence (and I did not like it). Luckily I did not run into such a competition probably because at a time I was the only editor. In any case if that is allowed it should be dumped for worst design. – qwerty_so Sep 12 '22 at 11:21
  • I've successfully used the collaborative editing feature of Confluence with up to six people: Imagine it like a white board with six people standing around, and everyone has a pen. Of course you need to moderate such a meeting, but there are ways to do that, and it can be efficient, dependent on the moderator. – Tim Meyer Sep 12 '22 at 13:43
  • There you go. You need a moderator. Model his role and you are done. – qwerty_so Sep 12 '22 at 16:50