Advanced Customization > Info*Engine User’s Guide > Task Webject Reference > Group Webjects > Union-Groups
  
Union-Groups
DESCRIPTION
Identifies the union of two groups and places the results in a new group. For example, group A contains the elements u, v, and x, and group B contains the elements x, y, and z. The Union-Groups webject identifies the elements in either group A or group B or both and uses the results to form group C. Group C, in this example, would contain the elements u, v, x, y, and z.
SYNTAX
<ie:webject name="Union-Groups" type="GRP">
  <ie:param name="CASE_IGNORE" data="[ TRUE | FALSE]"/>
  <ie:param name="CLASS" data=" class"/>
  <ie:param name="COMPARISON" data="[ALPHA | NUMERIC]"/>
  <ie:param name="GROUP_IN" data="input_groups"/>
  <ie:param name="GROUP_OUT" data="output_group_name"/>
  <ie:param name="SORTBY" data="attribute"/>
  <ie:param name="SORTED" data="[ASC | DESC]"/>
  <ie:param name="UNIONBY" data="attribute"/>
</ie:webject>
PARAMETERS
Required
Select
Optional
GROUP_IN
CASE_IGNORE
GROUP_OUT
CLASS
UNIONBY
COMPARISON
SORTBY
SORTED
CASE_IGNORE
Acts as a flag for case. If TRUE is specified, case is ignored. If FALSE is specified, then case is significant. The default for this parameter is FALSE. This parameter is optional.
CLASS
Specifies the type of the objects contained in the output group named by the GROUP_OUT parameter. For example if a webject specifies CLASS=MyClassName and GROUP_OUT=data_1, then the XML representation of the output group contains the following tags:
<MyClassName NAME="data_1" TYPE="Object" STATUS="0">
</MyClassName>
The default for this optional parameter is “Unknown-Class-Name.”
COMPARISON
Describes how to compare the two groups: either ALPHA for an alphanumeric comparison or NUMERIC for a strictly numeric comparison. The default for this parameter is ALPHA. This parameter is optional.
GROUP_IN
Specifies the names of the two groups to be used in computing a union.
To specify two group names, you can include two lines with different values for the GROUP_IN parameter. For example:
<ie:param name="GROUP_IN" data="group1"/>
<ie:param name="GROUP_IN" data="group2"/>
This parameter is required.
GROUP_OUT
Specifies the name of the results of computing the union of the two groups. This parameter is required.
SORTBY
Specifies the name of the attribute on which the sorting is done. If you do not include this parameter, the results are not sorted. This parameter is optional.
SORTED
Determines how values in the resulting group are sorted. The attribute named in the SORTBY parameter determines which values are sorted. Specify ASC to sort in ascending order or specify DESC to sort in descending order. The default for this parameter is ASC. This parameter is optional.
UNIONBY
Identifies the field or column name to be used for comparison. This parameter is required.
EXAMPLE
The following example finds the union of the two specified input groups by the NAME attribute, compares them alphabetically and places them in an output group named “results”:
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
                                               prefix="ie"%>

<!-- Form a new group from the Union of multiple groups -->

<ie:task uri="com/company/CreateGroup.xml"/>
<ie:task uri="com/company/CreateGroupA.xml"/>

<ie:webject name="Union-Groups" type="GRP">
  <ie:param name="GROUP_IN" data="createdgroup"/>
  <ie:param name="GROUP_IN" data="createdgroupa"/>
  <ie:param name="UNIONBY" data="NAME"/>
  <ie:param name="COMPARISON" data="ALPHA"/>
  <ie:param name="GROUP_OUT" data="results"/>
  <ie:param name="CLASS" data="ALLEMPLOYEES"/>
</ie:webject>