1

ハイ

これを UML アクティビティ図でどのように説明できますか?

最新 (earliest_start_date、最早 (latest_start_date、start_date))

つまり、latest_start_date と start_date から最も早いものを選択し、以前の決定の結果より遅い場合は、 Early_start_date を使用します。ダイヤモンドで試してみましたが、もう少し必要だと思います。

あなたが私を助けてくれることを願っています

ありがとう。

4

1 に答える 1

1

The most complicate part is that decision nodes pass along to the chosen edge the token (i.e. "value") that they received, then you need to make explicit that the value has changed depending on which branch was executed. If you are modelling start_date as an object flow (where the value of start_date flows through the diagram) and earliest_start_date and latest_start_date are in-scope variables or constants, you may represent the operation as:

enter image description here

(Note that I assumed that earliest<latest in order to simplify the branches) The upper "diamond" is a decision node. One of the three branches is selected, depending on the branch (i.e. condition) that is given between brackets for each edge. The lower diamond is a merge node (where the alternative execution paths meet). In the notation of the guards I assumed that the < operator is applicable to the type of start_date.

Another approach is writing a transformation that represents the operation. In this case the input of ActionState2 will be the result of the transformation, where start_date is the output of ActionState1.

enter image description here

A third approach is writing the operation as a postcondition of the action where such calculation is performed (i.e. a Constraint with stereotype «postcondition»attached to the action).

If Latest and Earliest are defined as functions in your model, the postcondition is:

result = Latest (earliest_start_date, 
                  Earliest (latest_start_date, start_date))

enter image description here

If the type of start_date defines min and max, the postcondition may be written as:

result = min(Set{latest_start_date, 
             max(Set{earliest_start_date,start_date})});

(i.e. the minimum value of a set composed by a) the latest_start_date, b) the maximum value of set composed by the earliest_start_date and the start_date.

If the < operator is defined for the type of start_date, the postcondition is:

result = if start_date<earliest_start_date 
            then earliest_start_date 
            else 
              if start_data>latest_start_date 
                then latest_start_date 
                else start_date
              endif
          endif

You may also represent it as a ConditionalNode (a structured activity node that chooses one among some number of alternatives), but there is no standard notation defined for ConditionalNodes.

于 2013-02-27T16:20:38.810 に答える