Advanced Customization > Info*Engine User’s Guide > Task Webject Reference > Group Webjects > Subset-Group
  
Subset-Group
DESCRIPTION
Uses pattern matching on single or multiple parameters to see if a string matches a specified pattern as a whole or to see if a substring within a string matches a specified pattern. Matching is done using regular expressions (part of the POSIX Standard). Case can be ignored.
SYNTAX
<ie:webject name="Subset-Group" type="GRP">
  <ie:param name="CASE_IGNORE" data="[TRUE | FALSE]"/>
  <ie:param name="CLASS" data="class"/>
  <ie:param name="FILTER" data="string_pattern"/>
  <ie:param name="FILTER_MODE" data="[MATCH | NOMATCH]"/>
  <ie:param name="FILTER_TYPE" data="[IE | REGEXP]"/>
  <ie:param name="GROUP_IN" data="input_group_name"/>
  <ie:param name="GROUP_OUT" data=" output_group_name"/>
</ie:webject>
PARAMETERS
Required
Select
Optional
FILTER
CASE_IGNORE
GROUP_IN
CLASS
GROUP_OUT
FILTER_MODE
FILTER_TYPE
CASE_IGNORE
Acts as a flag for case. If TRUE is specified, case is ignored when searching for matches. 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 parameter is “Unknown-Class-Name.” This parameter is optional.
FILTER
Specifies the pattern to which a string or substring must match. The set of wildcard characters you can include in the pattern is determined by the type of filter you specify. For additional information, see the FILTER_TYPE parameter description.
This parameter is required.
FILTER_MODE
Specifies whether to pass the values that match the specified pattern or the values that do not match the specified pattern. Valid values are MATCH and NOMATCH. The default for this parameter is MATCH. This parameter is optional.
FILTER_TYPE
Specifies the type of filter to use in pattern matching. Valid values are IE for Info*Engine or REGEXP for regular expressions.
If IE is specified, the following characters are translated into the corresponding regular expressions:
IE
Regular Expression
?
.
*
.*
pattern
^pattern$
After the translation from IE characters to regular expressions is complete, then pattern matching is performed.
The IE characters listed in the previous table can be used when the required pattern is a relatively simple pattern. If a more complex pattern is required, specify REGEXP as the value for the FILTER_TYPE parameter and include the required regular expression in the FILTER parameter pattern.
The default for this parameter is IE. This parameter is optional.
GROUP_IN
Specifies the group from which to select a particular subset. This parameter is required.
GROUP_OUT
Specifies the name of the output group into which the subset is stored. This parameter is required.
EXAMPLE
The following example uses pattern matching to see if a string matches a specified pattern as a whole or to see if a substring within a string matches a specified pattern. The first Subset-Group webject passes items which match the specified FILTER, placing those items in an output group named “matched”. The second Subset-Group webject passes items which do not match the specified FILTER, placing those items in a output group named “nomatch”.
<%@page language="java" session="false"%>
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core"
                                               prefix="ie"%>

<!-- Form a new group that is a subset of a group.-->

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

<ie:webject name="Subset-Group" type="GRP">
  <ie:param name="GROUP_IN" data="createdgroup"/>
  <ie:param name="FILTER" data="NAME='^J'"/>
  <ie:param name="FILTER_TYPE" data="REGEXP"/>
  <ie:param name="FILTER_MODE" data="MATCH"/>
  <ie:param name="CASE_IGNORE" data="TRUE"/>
  <ie:param name="CLASS" data="MATCHEDITEMS"/>
  <ie:param name="GROUP_OUT" data="matched"/>
</ie:webject>

<ie:webject name="Subset-Group" type="GRP">
  <ie:param name="GROUP_IN" data="createdgroup"/>
  <ie:param name="FILTER" data="NAME='^J'"/>
  <ie:param name="FILTER_TYPE" data="REGEXP"/>
  <ie:param name="FILTER_MODE" data="NOMATCH"/>
  <ie:param name="CASE_IGNORE" data="TRUE"/>
  <ie:param name="CLASS" data="NONMATCHEDITEMS"/>
  <ie:param name="GROUP_OUT" data="nomatch"/>
</ie:webject>

<ie:webject name="Return-Groups" type="GRP">
  <ie:param name="Group_in" data="matched"/>
  <ie:param name="Group_in" data="nomatch"/>
</ie:webject>