Defining Flows

Overview

Several flows can be defined in the configuration file. Each defined flow can be associated to a test. Flows are dynamically built when needed. This means that if two consecutive tests use the same flow, the execution of the second test will not trigger the creation of the flow, but will use the existing modules.

In each flow, the following must be defined:
  • all the modules to instanciate (eventually giving their attributes)

  • how these modules are linked

Validators

Special predefined modules must be used as a validation point for the Messages. These modules are instances of provtest::MessageValidator, are defined to detect the port number on which a Message has been output. They can be put anywhere in the flow.

If the "forward" attribute of a validator is set to "true", the Message will be forwarded to port 1. If not, the Message will not be forwarded.

Sample

<flow name="flow1">
		<mod name="valq" type="::provpp::ValidationQ" >
		<description>The module purpose</description>
			<attr name="cfg_hiLimit" value="100"/>
			<attr name="cfg_lowLimit" value="10"/>
		</mod>
		<mod name="GoodPort" type="::provtest::MessageValidator"/>
		<mod name="CancelPort" type="::provtest::MessageValidator"/>
		<link source="valq" target="GoodPort" portnum="1"/>
		<link source="valq" target="CancelPort" portnum="2"/>
	</flow>

In this sample, one flow is defined.Its name is "flow1" (name attribute's value).

This flow defines :
  • one custom module:
    • named "valq" (this attribute will be set as the OSAStreams::Module::runtimeName)

    • of type "::provpp::ValidationQ" (IDLos type)

    • its "cfg_hiLimit" attribute set to the value "100"

    • its "cfg_lowLimit" attribute set to the value "10"

  • two predefined modules of type "::provtest::MessageValidator" named "GoodPort" and "CancelPort"

  • that the module named "valq" is linked to the module named "GoodPort" using port 1

  • that the module named "valq" is linked to the module named "CancelPort" using port 2

Module Referencing

When a flow is instantiated, modules are created and referenced in the provtest environment using the scope of the current test. This allow users to directly access the module with its unscoped name in any test.

For instance in the following test, the module "GoodPort" is referenced as "test_flow@@GoodPort".

<flow name="flow1">
		<mod name="GoodPort" type="::provtest::MessageValidator"/>
	</flow>
<test name="test_flow">
		<flow>flow1<flow>
	</test>