Scripting Output

Motivation

Mechanics

A pipe segment named Write_Script is added to the Pipeline before the Execute Segment. So every command is handed to this segment before it is executed. The main reason for this position is the fact that we want to reproduce programm errors and programm exceptions which cause OpenCAGE to crash. So we need the data used for execution of a command.

The Write_Script segment translates every command and its paramter pot Parameter Pot (PP)(see the Section called Parameter Pot (PP) in Chapter 10) into XML, appending to the tree of previously serialized commands and writes all to disk.

Because a intensive use of OpenCAGE will produce much data. The file where every command is serialized in, can grow extremly. This is due to the problem appending data to a xml-structure without parsing it entirely.

Limitations

The Cancel of a command is not yet detected (execution of a command is the next pipe segment), so every started command is serialized.

A possibility to implement the detection of aborted commands: Serialize the data immediately after the execution. But in this case data of a crashed command will be lost.

A more complex alternative is to split up the the process of serializing into 2 parts: A part before execution which makes a temporary copy of the command which will be executed to disk and if a case of success appends it to the commands which are already serialized and hanging in memory.