Writing STAX tasks for Rational Quality Manager

STAX is a simple XML language that can be used to write automation code. The automation code is executed on a central STAX server and can use STAF commands to interact with test machines.
Refer to the STAX Service User's Guide at http://staf.sourceforge.net/current/STAX/staxug.html for detailed information about how to use and write STAX commands.
A task is considered to be a single piece of automation. It has a title and a list of arguments. Each task corresponds to a single STAX XML file located in the staxPath configured in the integration_config.xml file.
  1. The STAX files in the staxPath folder must have the following format:
    • <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE stax SYSTEM "stax.dtd">
      <stax>
      	<defaultcall function="myTask"/>
      	
      	<function name="myTask" scope="local">
      		<function-prolog>My Task Title</function-prolog>
      		
      		<function-epilog>
      			This is a description of My Task.
      		</function-epilog>
      		
      		<function-list-args>
      			<function-required-arg name="target">The target machine</function-required-arg>
      			<function-optional-arg name="MyArg1" default="'default1'">The first arg description</function-optional-arg>
      			<function-optional-arg name="MyArg2" default="'default2'">The second arg description</function-optional-arg>
      		</function-list-args>
      		
      		<sequence>
      			<!-- Rest of the automation code here -->
      
      			<return>0</return>
      		</sequence>
      	</function>
      </stax>
  2. The STAX file must specify the <defaultCall> element, pointing to the main function of the task. The XML file can contain multiple functions, but only the defaultcall is executed by IBM® Rational® Quality Manager.
  3. The default function must specify the <function-prolog> element, which must contain a short title for the task that displays in the user interface.
  4. The default function can optionally specify the <function-epilog> element that contains a detailed description of the task. This value is not currently used in the user interface but might be used in the future.
  5. The default function must specify the <function-list-args> element.
  6. Rational Quality Manager always passes the hostname of the target machine as the first argument. The first argument in <function-list-args> must be:
    • <function-required-arg name="target">The target machine</function-required-arg>
  7. You can specify additional arguments by using <function-optional-arg> elements. Use these instead of <function-required-arg> (even if the argument is required) because they allow a default value to be specified. This default value is displayed in the user interface. The default attribute must be a python string (enclosed in single quotes):
    • <function-optional-arg name="MyArg2" default="'default2'">The second arg description</function-optional-arg>
  8. The final element of the task should be a <return> element that returns 0 for pass, or non-zero for fail.

Feedback