Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353105 - [JABX] Enhancement to the stream parser "target-type" element
Summary: [JABX] Enhancement to the stream parser "target-type" element
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RM (show other bugs)
Version: 5.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-26 09:29 EDT by Greg Watson CLA
Modified: 2011-08-01 21:09 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Watson CLA 2011-07-26 09:29:30 EDT
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>
Comment 1 Albert L. Rossi CLA 2011-08-01 21:09:04 EDT
Done.  Committed to 5_0 and HEAD.