Persistent Groups
Agroupispersistentif thegroup mapping rulethat defines it has a
Apersistent groupthat is not the last group in theg-stackwill not be destroyed when its correspondingmapping rulede-activates.
Note:A group mapping rule defined under the
When apersistent groupis popped from theg-stackit can persist inside otherg-stackgroups. The
Theparent-groupof apersistent groupis thegroupthat will be at the top of theg-stackwhen thepersistent groupis popped. Thebase-groupis thegroupthat is at the base of theg-stack; it is the firstgrouppushed into the stack; it is thegroupconstructed from the activation of agroup mapping rulethat was defined under the
FME features that are constructed byfeature mapping ruleswill enter all thegroupsthat are in theg-stackfrom the top until the bottom of the stack. If agroupin the stack haspersistent groups, then the features will first enter thepersistent groupsbefore entering into thegroup’s ownattribute setsandpipelines.
The following example shows whypersistent groupsare sometimes needed.
group_persist.xml
C-23 Z-Edifice 580ld-3
We want to map each
group_persist.xmp
<!-- The group is constructed and pushed into the g-stack when the group-property start-tag is read, when the end-tag is read, then the group is popped from the g-stack. The group is not destroyed, it will persist in its parent-group, in this case it is the group that is constructed in the group-map above. We make this group persist, since otherwise this group is destroyed when the group-property element end-tag is read so that this group attribute set will not be attached to any feature.--> <persist/>
The two documents above make the XML Reader output the following FME features:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Feature Type: `member-290' Attribute: `location' has value `Z-Edifice' Attribute: `op-code' has value `580ld-3' Attribute: `section' has value `C-23' Attribute: `xml_type' has value `xml_no_geom' Geometry Type: Unknown (0) =========================================================================== +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Feature Type: `member-350' Attribute: `location' has value `Z-Edifice' Attribute: `op-code' has value `580ld-3' Attribute: `section' has value `C-23' Attribute: `xml_type' has value `xml_no_geom' Geometry Type: Unknown (0) =========================================================================== +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Feature Type: `member-300' Attribute: `location' has value `Z-Edifice' Attribute: `op-code' has value `580ld-3' Attribute: `section' has value `C-23' Attribute: `xml_type' has value `xml_no_geom' Geometry Type: Unknown (0) ===========================================================================
Agroupactually contains two places where it may adoptpersistent groups. By default thegroupadopts apersistent groupin its low-priority list, the
Agroupwill always process FME features through its high-prioritypersistent groupsbefore the low-priority ones. The valid values for thepriorityattribute arelowandhigh, withlowbeing the default value.
For example, the followinggroup mapping ruledefines apersistent groupto persist in its parent group high-priority list:
<persist in=”parent-group” priority=”high”/> ...