Question

After two hours reading/searching in about examples and usages of selection behavior of object flows, I guess that selects all tokens which satisfy a criteria (like a query) and this can change order of tokens as specification in 15.2.3.4 Object Flows says:

If a selection Behavior is specified, then it is used to offer a token from a source ObjectNode to the ObjectFlow, rather than using the ObjectNode’s ordering.

But also above section says:

Whenever a new token is offered to the ObjectFlow, or an offer is withdrawn, the selection Behavior is invoked with the values from all the object tokens currently being offered to the ObjectFlow passed to the Behavior input Parameter. The selection Behavior should then select one of the input values and produce it as output

What I understand from second quote is:

  • it only be invoked when a new token is offered or an offer is withdrawn (so not be invoked when a previously stored token is accepted)
  • if multiple tokens are stored, it only selects one token (instead of all tokens which satisfy criteria) even if there are more tokens that satisfy condition. For example in this situation only one candidate will be accepted:

enter image description here

Are above bullets true?(I think those are incorrect; but those are my understand of second quote) Also what is the meaning of offer is withdrawn in second quote?

Was it helpful?

Solution

The «selection» introduces a semantic that allows to restricts the tokens of the ObjectFlow or change their order. So the specification shall be read, having both cases in mind.

The standard shows in figure 15.16 an example in which «selection» is used to specify that Orders offered should be shipped by order of priority.

Your first bullet is correct. Nothing is said about the stored token. And we do not need to care. Let's take the shipping order example. Suppose I have a set of Order tokens waiting that match the selection criteria. When the shipping consumes a new Order, the selection must ensure that the token provided has the highest priority. We don't know if the Orders that are already accepted are kept in a sorted fashion (could be done at the offering) or if they are ordered at consumption.

Your second bullet is incorrect. The selection behavior selects only one token for its output. This means that it provides them one by one. It doesn't say that the others are discarded. So in your example, if several candidates would match the criteria, all of them would be interviewed. If the interpretation of the standard would be as restrictive as you imagined, the order shipping example would not work because the modelled system would not ship by order of priority but only the highest priority of each bunch of orders.

Licensed under: CC-BY-SA with attribution
scroll top