Attribute "continuousLineHandling" (Cargo-IMP)

There are rare cases in which you have to deal with two consecutive and different(!) continuous lines. As you already know, if the parser finds a continuous line, it will search for a sibling node (unless you use the special repeating case, which you cannot use anyway, since it can only deal with continuous lines of the same structure). Once that sibling node is found and entered, it will be repeated over and over again for following continuous lines. Of course, that is not what we want if we have to deal with different kinds of continuous lines.

images/download/attachments/189463637/CargoIMP_7-version-1-modificationdate-1738737616027-api-v2.png


Example:


The screenshot above shows a segment 5 that allows a repeat 5.2-5.8, which means since 5.2 is a slant and 5.8 is a CRLF, that you will get continuous lines in a repeat case. Unfortunately, as you can see, segment 6 also starts with a slant and thereby effectively is a continuous line as well. How could you distinguish those two continuous lines with the technical means so far? The answer is - it is impossible.

A solution is the continuous line handling. It is defined in the message header (like the condition attribute was):


<message id="AAA" version="2" continuousLineHandling="true">


The continuous line itself is defined like a segment and additionally contains an attribute node that is used to assign the identified continuous line to a node in the source structure with the exact same name (without the index suffix).


<segment id="regex:^[A-Za-z]$" node="Movement_Priority">

If the parser finds a continuous line and the regex above matches the line, the parser will not assign that line to a sibling node, but will instead assign it to node Movement_Priority.

Important note: Be aware that in the continuous line handling mode the special repeating case will not work. You will have to find a different solution for problems you would otherwise have solved with that technique. Use repeat nodes (as already shown earlier) or the continuous line handling mode itself to deal with the problem, since the special repeating case does not do anything else than dealing with continuous lines.