Group Pipelines

A group may contain a sequence of FME factory pipelines that processes features entering it. A group mapping rule, that defines a group with pipelines, has an <apply-pipelines> element which contains a sequence of one or more <pipeline> elements.

Each <pipeline> element has a <file> element that specifies the location of the file containing the definition of an FME factory pipeline. The location of the file is specified with the <file> element’s name attribute. In addition, optional pipeline directives may be specified through the <directives> element. The name and value for each optional directive are specified through expression sequences.

<pipeline>
	<file name="theFeatureProcessingPipeline.fmi"/>
	<directives>
		<directive> 
		 <name> ... some expression sequence ... </name>
		 <value> ... some expression sequence ... </value>
		</directive>
		...
		<directive> ... </directive>
	</directives>
</pipeline>

Note: Note: The location of the pipeline file may be specified with an absolute or relative path. When the path is relative, then it is assumed that it is relative to the location of the xfMap document.

Each <pipeline> element may also contain an optional <condition> element (see section “group mapping rule - condition element”) that allows or prevents a feature from entering into the pipeline.

The following illustrates the usage of group pipelines. Consider the following input XML and xfMap documents:

group.xml

<?xml version=”1.0”?>
<group>
	<member id=”290”/>	
</group>

pipeline.xmp

<?xml version=”1.0”?>

<xfMap>
	<group-map>
		<mapping match=”group”>
			<!-- The group object contains one FME factory pipeline that is 
				defined in the pipeline.fmi file. This files is in the
				same folder as the pipeline.xmp xfMap. 
				The features construted in the feature mapping rule
				below will enter this group and its pipeline for
				further processing.-->
			<apply-pipelines>
				<pipeline>
					<!-- The section titled ‘condition element’ describes the
						function of this element as a filter that prevents or
						allows features entering the the pipeline. 
						Here only feature’s having an attribute call id
						with the value of 290 are allowed into the pipeline
						other features do not enter, they just by pass it. -->
					<condition feature=”@id=’290’”/>
					<file name=”pipeline.fmi”/>
				</pipeline>
			</apply-pipelines>
		</mapping>
	</group-map>

	<feature-map>
		<mapping match=”member”>
			<feature-type> <literal expr=”member”/> </feature-type>
			<attributes>
				<attribute>
					<name> <literal expr=”id”/> </name>
					<value> <extract expr=”@id”/> </value>
				</attribute>
			</attributes>
		</mapping>
	</feature-map>
</xfMap>

This is the FME factory defined in the pipeline.fmi file:

FACTORY_DEF * TeeFactory                  \
INPUT FEATURE_TYPE member                 \
OUTPUT FEATURE_TYPE member  isCopy false  \
OUTPUT FEATURE_TYPE member  isCopy true

The FME features output by the XML Reader are:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: `member'
Attribute: `id' has value `290'
Attribute: `isCopy' has value `false'
Attribute: `xml_type' has value `xml_no_geom'
Geometry Type: Unknown (0)
=======================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: `member'
Attribute: `id' has value `290'
Attribute: `isCopy' has value `true'
Attribute: `xml_type' has value `xml_no_geom'
Geometry Type: Unknown (0)
=======================================================================