For information about XES schema see these pages.
Loop
This can represent 'while', 'do-while','for' , and 'enhanced for' types of loop.
Depending on which of these (on the value of code) depends on the selection of preCondition, postCondition, initialiser and step as follows:
- for has preCondition, initialiser and step.
- while has preCondition.
- do-while has postCondition.
XES represents all these as one type 'loop' because all the loop constructs are equivalent in many ways. For instance, 'for' can be implemented using 'while' by implementing the initialiser and step separately, or 'while' can be implemented using 'for' by leaving initialiser and step empty.
The subnodes may include the following:
- preCondition
- postCondition
- initialiser
- step
- loop statements (multiple statements must be grouped in a block)
- comments
Since it is not possible to tell from the subnodes which type of loop it is we must use the 'code' attribute to determine the meaning of the subnodes as follows:
If code = "while" then the subnodes are:
- preCondition
- loopBlock
If code = "do" then the subnodes are:
- loopBlock
- postCondition
If code = "for" then the subnodes are:
- preCondition
- initialiser
- step
- loopBlock
If code = "extfor" then the subnodes are:
- array or container to be iterated over.
- loopBlock
In this enhanced for case there are two additional attributes:
- name="i"
- type="int"
In addition to these subnodes there may be any number of comments at any place.