Rational Developer for System z, Version 7.6

Interpretation of cycles

When a cycle is detected on the activity diagram, we know that the body of the cycle will comprise these nodes. But it is not enough to state that this cycle represents a COBOL loop. In other words, cycle is not equivalent to loop.

Here are some low level explanations about the translations of cycles in the UML-to-COBOL process. Understanding the rationale of the transformation process may help you better design your activity diagram.

For example, Figure 1 shows an infinite loop (WHILE TRUE):

Figure 1. Infinite loop
A Read and Write loop has a test in between.

In this diagram, there is a loop that contains the "Read resource" node, the decision node and the "WriteResource2" node. The second branch of the decision node, which leads to an End Node, needs to be considered by the transformation process: the test is part of the loop and so are all of its branches. All the branches of a decision node that are located within a loop need to be taken into account and the corresponding code placed inside the loop.

An UNTIL loop is shown in Figure 2.

Figure 2. UNTIL loop
A Read loop continues or ends based on a test.

In this diagram, we have a loop between the Read Resource node and the decision node. This is a case where one extremity of the loop is a decision node, and it is interpreted as an until loop; the decision node here defines the condition to stay or exit the loop.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)