41
The Procedure Builder definition file
For general information about the Procedure Builder, please see chapter chapter 18.
41.1
Placeholders

In the definition of procedures, packages and even in the nodes of the procedures, you can use placeholders. The following table shows all placeholders and their meaning:

Placeholder Description
<COMPID> The ID of the component
<COMPNAME> The name of the component
<COMPFEATURE> The feature of the component
<COMPCLASS> The class of the component
<CURRENTVALUE> The current value of the component, e.g. the text of a text-field or the current selection of a combo-box etc.
<CURRENTENABLEDSTATE> The current enabled state of the component
<CURRENTSELECTEDSTATE> The current selectable state of the component
<CURRENTEDITABLESTATE> The current editable state of the component
<PCOMPID> The component-id of the parent component
<PCOMPNAME> The name of the parent component
<PCOMPFEATURE> The feature of the parent component
<PCOMPCLASS> The class of the parent component
<GPCOMPID> The component-id of the grandparent component
<GPCOMPNAME> The name of the grandparent component
<GPCOMPFEATURE> The feature of the grandparent component
<GPCOMPCLASS> The class of the grandparent component
Table 41.1:  Placeholders for component procedures

For procedures of container or composite components you can also use placeholders for the child-components. Please see following table for those additional variables:

Variable Description
<CCOMPID> The ID of the child-component
<CCOMPNAME> The name of the child-component
<CCOMPFEATURE> The feature of the child-component
<CCOMPCLASS> The class of the child-component
<CCURRENTVALUE> The current value of the child-component, e.g. the text of a text-field or the current selection of a combo-box etc.
<CCURRENTENABLEDSTATE> The current enabled state of the child-component
<CCURRENTSELECTEDSTATE> The current selectable state of the child-component
<CCURRENTEDITABLESTATE> The current editable state of the child-component
Table 41.2:  Additional placeholders for container procedures
41.2
Conditions for Package and Procedure Definition

You can influence the creation of packages and procedures via using the 'comment' attribute of the 'Package' or 'Procedure' node.

Comment-Attribute Description
@NOTINHERIT If this value is set, then this package or procedure is only defined for the exact class and not for its descendants.
@FORCHILDREN If you define procedures for container procedures, you can set this value to tell QF-Test to create those procedures for calling the child-components' procedures.
@EXCEPT Specifies, whether the package or the procedure should be defined for a certain class or not. This construct might be useful, if you define a package or procedure for an abstract class and the procedures should not be created for all of its descendants.
@CONDITION Specifies a dedicated condition for creating packages or procedures. You can define conditions as Jython, Groovy or regular expression. Please see below for further details.
@SWTSTYLE Evaluate the style attribute of a given SWT-button. This SWT specific attribute got required, because SWT distinguishes between check-boxes, buttons or radio-buttons only through the style attribute. For SWT-buttons you can define something like @SWTSTYLE=PUSH or @SWTSTYLE=RADIO for radio buttons.
@SUBITEM This value is only valid for menu actions up-to-now. If this flag is set, then the according package or procedure will be created for sub-items on the second level of a menu only.
Table 41.3:  Comment attributes for procedure creation
41.3
Interpretation of the Component Hierarchy

It might be interesting to make use of the component-hierarchy in the package structure. This approach allows the tester to locate the component-specific procedures quite easy. If you want to create component-hierarchy packages, you can use two placeholders in the package-names:

Hierarchy-Placeholder Description
<HIERARCHY> Create packages for the full component-hierarchy.
<IHIERARCHY> Create packages only for interesting components in the component-hierarchy. An interesting component is a component with a feature.
Table 41.4:  Hierarchy placeholders
3.4+41.4
Details about the @CONDITION tag

Using the @CONDITION tag allows you to configure, whether a dedicated node should be created or not during creation time.

Such conditions might be used to check a certain name or for appearance of a dedicated letter in the feature. If this condition is not fulfilled, the node won't be created. You can use all known placeholders, e.g. <COMPID> or <CCOMPNAME>.

Value of Condition Meaning
@CONDITION jython "<COMPFEATURE>".startswith("abc") Here we define a Jython condition, which will create the according node, if the feature of the current component starts with 'abc'. It is possible to use any string or comparing method of Jython.
@CONDITION groovy "<COMPFEATURE>".startsWith("abc") Here we define a Groovy condition, which will create the according node, if the feature of the current component starts with 'abc'. It is possible to use any string or comparing method of Groovy.
@CONDITION regexp "<COMPFEATURE>" =~ "abc.*" Here we define a regular expression, which will create the according node, if the feature of the current component starts with 'abc'. It is possible to use all capabilities of Java regular expressions.
@CONDITION regexp "<COMPFEATURE>" !~ "abc.*" Here we define a regular expression condition, which will create the according node, if the feature of the current component does not start with 'abc'. It is possible to use all capabilities of Java regular expressions.
Table 41.5:  Samples for the @CONDITION tag

If you need more than one row, you have to use a '\` at the end of the first row.