Community
Participate
Working Groups
The stream parser allows actions to be taken once tokenization has reached the end of the stream using the "test" element. Test elements are applied in turn, and each can contain an "else" clause to reverse the sense of the test. However, there is no way to deal with the situation where none of the tests match, but an action still needs to be taken. For example, job states might be represented by the symbols A, B, ..., Z, but only the first few (say, A, B, and C) carry any useful information, but the remaining symbols all effectively mean the same thing. In the current XML, it would be necessary to enumerate all symbols, making the XML somewhat unwieldy. It would be clearer if there was an "else" or "default" element to handle this situation. The "else" element would only be run if none of the test elements (or their else elements) succeeded: <stdout-parser delim="\n"> <target ref="@jobId"> <match> <expression>jobid:[\d]+:state:([A-Z]+):slots:[\d]+:num procs:[\d]+</expression> <set field="value"> <entry valueGroup="1"/> </set> </match> <test op="EQ"> <value>#value</value> <value>A</value> <set field="value"> <entry value="RUNNING"/> </set> </test> <test op="EQ"> <value>#value</value> <value>B</value> <set field="value"> <entry value="SUSPENDED"/> </set> </test> <test op="EQ"> <value>#value</value> <value>C</value> <set field="value"> <entry value="COMPLETED"/> </set> </test> <else> <set field="value"> <entry value="COMPLETED"/> </set> </else> </target> </stdout-parser>
Done. Committed to 5_0 and HEAD.