BridgeGate™


Tutorial 5: Data Validation

Table of Contents

Using Data Validation

Introduction

BridgeGate has robust 'Rules-Based Processing' abilities, allowing it to handle virtually all of the requirements your data formats will have. Rules are broken down into 3 different groups in BridgeGate TEI:

Record Rules

Records have 3 rules available:

Field Rules

Fields have rules available:

Situations Field Rules

There are 5 types of Situation Field Rules:

In keeping with the Tutorials to this point, we will use the same Inbound Template for all of this Tutorial, and use different Outbound Templates for each type of Rule. The data for this Tutorial will be more complex. We will be using a DELIMITED Record Segment, NM1.

Here is an example Record of the inbound data we will be using:

NM1|1P|1|JONES|MARCUS|||MD|34|111223333

Getting Started

Remember, the completed Samples for this Tutorial are located in the Sample Account, in the Samples5 Workflow Group. It is recommended you create your Samples for this Tutorial under a new Workflow Group named MySample5. Start this Tutorial by starting your BridgeGate Workbench. Login, using the proper credentials. Upon successful login, you'll see the Home page.

Creating the Inbound Template

To open our Inbound Template, click on the Manage Inbound Templates button in the toolbar:

Creating a New Workflow Group

If not already selected, select the Samples Account from the drop down at the top of the Home page screen. Do not select the Workflow Group Sample5, instead click on 'New' and create a new Workflow Group named 'MySample5'. This new Workflow Group will appear in the list.

Defining the Inbound Template

Right mouse click in the Inbound Templates window, or pick the drop down.

This time, pick New Template Wizard.

Select 'Create an Empty Template'. Name this Template 'MySample5Inbound', named after the completed Inbound Template for this Tutorial, 'Sample5Inbound'.

After entering the name and clicking 'Ok', the Inbound Template Screen automatically opens as shown below:

As you remember from our sample data above, we are using a DELIMITED Segment NM1, consisting of 12 Fields. Let's create those now. Select the Body tab in the Records tree, right mouse click or use the drop down, and pick 'New Record.'

After adding 'New Record', the Unnamed Record is displayed.

Repeat the process described above, only this time, click on 'New Field'. The new unnamed Field is then displayed:

Create 11 more Fields in this manner, then, select the UNNAMED0 Record from the tree to the right. The screen for the Record is displayed again below. Notice all 12 Fields in the tree as well:

Change the Record name from 'UNNAMED0' to 'NM1".

For the Record Mappings section, click in the Record Mapping Conditions window and delete the selected Record Mapping. When an inbound data format only has a single Record Type, no mapping is needed to determine what kind of Record each Record is in the data, since they are all the same type.

Adding Record Rules

Rules are added to the Inbound Template, but you tell BridgeGate™ what to do if the Rules are broken on the Outbound Template. To establish rules, click on the Data Validation tab.

Set the Minimum Loops to 0, and Maximum Loops to 0, which tells BridgeGate™ that we do not want to use the Minimum or Maximum Loops validation.

Right mouse clicking in the Situational Field Rules window and selecting New Situational Field Rule can set situational Field rules.

Situational Field Rules include the following: Required, Conditional, Exclusion, List Conditional, and Pairing. Pick a Rule Type from the Rule Type drop down.

For instance, we can set a rule to state that Field 1 is required by picking the Required Rule type and checking the Unnamed1 field.

For each of the 12 Fields, add the following Names/Descriptions:

Field Map Name Description

1st Field Segment Type Segment Type
2nd Field NM101 Entity ID Code
3rd Field NM102 Entity Type Qualifier
4th Field NM103 Name Last/Organization
5th Field NM104 Name First
6th Field NM105 Name Middle
7th Field NM106 Name Prefix
8th Field NM107 Name Suffix
9th Field NM108 ID Code Qualifier
10th Field NM109 ID Code
11th Field NM110 Entity Relationship Code
12th Field NM111 Entity ID Code

Under Template Properties in the lower left hand corner of the screen, set the data type to DELIMTED and Set the Record delimter to 'CRLF' and field delimter to '|'

Click the Save button on the Toolbar, and close the Inbound Template for now.

Creating the First Outbound Template: Using Record Rules

From the Toolbar, click on the Outbound Template Builder icon:

Create a new Outbound Template' and name this Outbound Template 'MySample5RecordRulesOutbound'.

The newly created Outbound Template is opened as shown below in the Manage Outbound Template Screen:

We'll make this Outbound Template's data type XML. Set the Inbound Dependencies.

Select 'NM1' as the Loop Record and call the XML Element Name, Names.

Let's get started on the Outbound Field Mappings. To make this Tutorial simpler, we'll map each field across to the Outbound Template in the same order. Toggle the Drag and Drop' and select all the fields by holding down the 'crtl' key while right-clicking each field with the mouse. Then drag all of the fields over, at one time dropping them onto the Element labeled Names.

A dialog opens requesting confirmation that you want the fields inserted either inside or after the current field. In our case answer 'NO' so that the field is inserted immediately after the current field. Answer the same for each field's confirmation.

The result will look as follows:

Click on NAMES RECORD in the Target Layout tree, and open the 'Element Properties' tab for it from the Source Layout tree on the left side. Change the XML Element Name to 'NM1', and set the Inbound Record Name to NM1.

Click Save icon from the Toolbar for this Outbound Template, but leave it open. Then open the Test Template Screen and enter the following data:

NM1|1P|1|FLINTSTONE|FRED|||JR|34|111223333||
NM1|1P|1|FLINTSTONE|WILMA||||34|321654987||

Select the mysample5 Workflow Group and the mysample5inbound and mysample5recordrulesoutbound templates. Finally click the 'Test Translation' button and receive results that look as follows :

Now, go back to the Inbound Template and set the Loops in the Data Validation to 6.

Return to the Test Templates, and enter the following data:

NM1|1P|1|FLINTSTONE|FRED|||JR|34|111223333||
NM1|1P|1|FLINTSTONE|WILMA||||34|321654987||
NM1|1P|1|RUBBLE|BARNEY|||JR|34|347741141||
NM1|1P|1|RUBBLE|BETTY||||34|380445123||

This time, we get an error reporting that we have not reached the minimum number of loops:

Click the Save icon to save your work.

This concludes the Sample 5 Tutorial.