T

integrate soil rate

[before planting date]

[before planting date]

[post planting date]J/

^ integrate plant ^

[plant matured]

Figure 6-10. Example of an activity diagram.

Some activities will be executed only if some condition is satisfied. In UML, the graphical representation of a condition is referred to as decision. As an example, the activity calculate plant rate will be executed only if the decision post planting date is satisfied. The decision post planting date is satisfied if the current date is later than the planting date (i.e., the plant is of a certain age). An activity diagram always ends with an ending state (or final state).

Activity diagrams can be used to show concurrent activities, (i.e., activities that occur at the same time). As an example, let us consider the scenario of simulating two plants (plantA and plantB) that are competing for the same resources (water, soil nutrients, solar radiation, etc.) shown in Figure 6-11. Activities initialize weather and initialize soil are executed sequentially. As the simulation of both plants will occur concurrently, then a horizontal synchronization bar (or concurrent fork) is used to express concurrency. Activities that represent the initialization and the simulation for plantA and plantB will be executed within different flows of control that occur at the same time. A concurrent fork has one incoming transition and two or more outgoing transitions. After the concurrent activities are terminated, the flow of control joins the sequential execution at the concurrent join point. A concurrent join may have two or more incoming transitions and one outgoing transition.

Figure 6-11. Example of concurrent processing of activities.
0 0

Post a comment