Filtering based on the presence of required attributes

You can filter bases on the presence of required attributes.

Description

To enable a UCCnetMessageReceive collaboration object to filter Catalogue Item Notifications for the presence of attributes required by UCCnet, create an external text file and list those UCCnetGBO_envelope business object attributes that must be present and not contain NULL or BLANK values. Specify the path and name of this file in the UCCnetMessageReceive collaboration object's REQUIRED_ATTRIBUTE_FILE configuration property.
This external text file can contain one of the following:
  • A simple list of the fully qualified attributes in the UCCnetXSD_envelope_notification child business object of the UCCnetGBO_envelope business object that must be present (one attribute per line).
  • Complex filters that conditionally specify the list of attributes.
The first line of the file determines whether simple or complex filtering is performed. If the first line contains a single fully qualified business object attribute name, simple filtering is performed on the rest of the attributes listed in the file. If the first line of the file contains a separator of FILTER or FIELDS, complex filtering is assumed.

To provide complex filtering, the file must contain any number of sections, each section containing FILTER and FIELDS subsections. "Filterless" FIELDS subsections can also be included.

Each FILTER subsection filters on one or more business object attributes. A FILTER subsection contains the following:
  • A fully qualified business object attribute name on a single line.
  • On the next single line, a comma-delimited list of valid values for the attribute.
  • If filtering on multiple attributes, on the next single line, a value of AND.
  • On the next single line, another fully qualified attribute name.
  • On the next single line, a comma-delimited list of valid values for that attribute.
Any number of attributes can be filtered in this way.

Each FILTER subsection must be followed by a FIELDS subsection. A FIELDS subsection must contain the required attributes for the filter above it, each attribute on a separate single line. A FIELDS subsection can be followed by a FILTER subsection, another FIELDS subsection without a filter, or an optional END separator at the end of the file. If a FIELDS subsection is specified without a FILTER subsection in front of it, the list of attributes in that FIELDS subsection is always required.

Flow

The UCCnetMessageReceive collaboration object reads through the text file examining the first line. If the line contains a fully qualified business object attribute name, the collaboration object checks all attributes named in the specified file. If any of the listed attributes are missing from the business object or are present in the business object but missing data, the collaboration object logs the business object and handles it according to the value specified in its FILTER_FAIL_RESPONSE configuration property.

If the first line of the file contains a FILTER or FIELDS separator, the collaboration object reads the file until it finds a FILTER subsection that is satisfied by the attribute values contained in the business object being processed. The collaboration object then checks all attributes in the business object against the list of attributes included in the FIELDS subsection related to the satisfied filter. If any of the attributes in the FIELDS subsection are missing from the business object or are present in the business object but missing data, the collaboration object logs the business object and handles it according to the value specified in its FILTER_FAIL_RESPONSE configuration property.

If no file is specified in the REQUIRED_ATTRIBUTE_FILE property, or if no attributes are indicated within the file, all items are accepted for further processing by the collaboration object.

Sample

An example file that demonstrates complex filtering and its interpretation follow:
FILTER notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.  \ 
tradeItemInformation.informationProviderOfTradeItem.informationProvider.gln
00011112222333 
AND 
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.  \ 
tradeItemUnitDescriptor 
CASE,PALLET 
FIELDS notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.  \ 
tradeItemInformation.tradingPartnerNeutralTradeItemInformation.   \ 
tradeItemMeasurements.netWeight
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.   \
tradeItemInformation.tradingPartnerNeutralTradeItemInformation.   \ 
tradeItemMeasurements.grossWeight
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.  \ 
tradeItemInformation.tradingPartnerNeutralTradeItemInformation.   \ 
tradeItemMeasurements.height
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.\ 
tradeItemInformation.tradingPartnerNeutralTradeItemInformation.   \ 
tradeItemMeasurements.width
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.\ 
tradeItemInformation.tradingPartnerNeutralTradeItemInformation.   \ 
tradeItemMeasurements.depth
FILTER 
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.  \ 
tradeItemInformation.informationProviderOfTradeItem.informationProvider.gln
00011112222333 
AND 
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.  \ 
tradeItemUnitDescriptor 
BASE_UNIT_OR_EACH 
FIELDS 
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.  \ 
tradeItemInformation.tradingPartnerNeutralTradeItemInformation.   \ 
tradeItemMeasurements.netWeight
notificationDetail.catalogueItemNotification.catalogueItem.tradeItem.  \ 
tradeItemInformation.tradingPartnerNeutralTradeItemInformation.   \ 
tradeItemMeasurements.grossWeight
END

Explanation

The collaboration object checks if the business object being processed has a gln attribute value of 00011112222333 and a tradeItemUnitDescriptor attribute value of CASE or PALLET. If it doesn't, the collaboration proceeds to the next FILTER. If it does, the collaboration object then checks if the business object being processed contains the attributes netWeight, grossWeight, height, width, and depth, and that these attributes are not NULL or BLANK. If the business object passes this filter, collaboration object processing continues. If any of the attributes in the FIELDS subsection are missing from the business object or are present in the business object but missing data, the collaboration object logs the business object and handles it according to the value specified in its FILTER_FAIL_RESPONSE configuration property.

If these first filter conditions were not satisfied, the collaboration object proceeds to the next FILTER subsection. It checks if the business object has a gln value of 00011112222333 and a tradeItemUnitDescriptor attribute value of BASE_UNIT_OR_EACH. If it does, the collaboration object then checks if the business object being processed contains the attributes netWeight and grossWeight, and that these attributes are not NULL or BLANK. If the business object passes this filter, collaboration object processing continues. If any of the attributes in the FIELDS subsection are missing from the business object or are present in the business object but missing data, the collaboration object logs the business object and handles it according to the value specified in its FILTER_FAIL_RESPONSE configuration property.

Parent topic: Filtering publication requests (Catalogue Item Notifications)