0

UML specification says:

If multiple tokens are offered at the same time, then the tokens are offered in the same order as if they had been offered one at a time from the source

I want to know "what situation is tried to be described"?

  • one source to one target?
  • one source to multiple targets?
  • multiple source to multiple targets?
  • multiple source to one target?

Also does above quote says "tokens always are offered to the target one by one even if they are offered from source at the same time"?

1 Answer 1

1

What is it about ?

The quote is from section 15.2.3.3, which explains that there are two kind of activity edges. More precisely, it is about ObjectFlow edges. These passes objects as tokens.

One of the main differences, between an object flow and a normal control flow in the activity model, is that you may use object nodes (see section 15.4.3.1,). These show which kind of object is created and can accumulate (due to synchronisation constraints) object tokens generated by a source.

So what does it mean ?

If multiple tokens are offered at the same time, then the tokens are offered in the same order as if they had been offered one at a time from the source

is to be understood as:

Even if there's an object node in-between that could accumulate several tokens generated by a source, the object tokens are passed to the target one by one as if they were coming directly from the source and in their initial order.

Example of why it's important

Here is an example of use. In the midle of the linked example diagram, you can see 2 object nodes (product key and C2V key) that are connected to a join node, which is connected to an activate product activity.

Possible scenarios:

  • Imagine you have a request activation. The flow works smoothly on both sides of the diagram, and the two required object tokens are ready at the gate: both of them will be passed together to the activate product activity. (By the way, this is different from the usual control flow edges where 2 tokens would be consumed as input but only one token would produced as output of the gate).
  • Now imagine 2 consecutive request activation. Suppose now that the customer side works ultra-fast and immediately produces their C2V key: none of them can pass the gate because no product key is available. In consequence, both tokens will wait. Then, the order management processes the first request, and produce a first product key. Thanks to the importance sentence that you've quoted you can be assured that this first product key will be processed together with the first C2V key, and not with a random one that would be ready but would be related to another request.
2
  • Thank you for your reply. Also although it is in about ObjectFlows; but I think that can describe something like I asked before: "stackoverflow.com/q/52241688/1043882". Is it true? Sep 16, 2018 at 17:32
  • 1
    Yes. In the other question the context doesn't allow to see if it's about ControlFlow or ObjectFlow. The answer that the very knowledgeable Killian provided is focused on the input part of the join, which is the same for both flows. There would be a difference on the outgoing tokens of the join. In the object flow, just one (anonymous) control token would be passed to the next node. With the object flow, both objects would be passed (see first scenario of my example).
    – Christophe
    Sep 16, 2018 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.