This chapter provides an overview of the integration of Quality with third-party applications and discusses how to:
Use the Quality enterprise integration point (EIP).
Use EIP message data rules.
Use EIP data scenarios.
Troubleshoot EIPs.
Most companies that are implementing manufacturing or distribution systems use automated collection devices or systems to assist in quality inspection and control. Using PeopleSoft Integration Broker technology, you can pass the quality information collected from those devices to Quality.
Before a third-party application can integrate with Quality through Integration Broker technology (PeopleSoft Quality EIPs), you must:
Verify the installation of Quality.
Use the Installation Options - Installed Products page to verify that the application is installed.
Define several pieces of configuration information in Quality.
There are several pieces of information that you need to define in Quality before a third-party application can integrate with Quality.
Quality Function
The quality function determines which fields appear and are available for data collection or query on subsequent Quality pages and provides parenting for related process hierarchies and their associated streams. As part of the quality function, determine the trace and hierarchy fields that are common to the quality application or functional area, that is, what information is pertinent when collecting, storing, and reporting quality data.
When recording inspection data, hierarchy fields determine the process streams against which you collect sampling results, while trace fields track associated traceability information, such as the lot numbers. Hierarchy fields define the stream components that Quality uses to maintain control limits.
Traceability Set
Traceability sets identify trace field requirements during data collection against control plans. When you define a trace set, the system references the quality function to predefine the trace fields that are available for use. The system provides a comprehensive list of trace fields from which you can optionally select.
Attribute Groups
Use attribute groups to produce concise and relevant selection lists for quality users. Define the categories once, then future references to them appear in the selection criteria list.
Measurement Plan
Measurement plans define the characteristics and the sampling and charting criteria that you want to apply during data collection.
Control Plan
The control plan brings together measurement, traceability, control, and response activities for data collection.
Note. If Quality is not installed, you cannot view the buttons that transfer you to Quality data collection from Purchasing and Manufacturing.
See Also
Quality provides a single service operation that the system uses to collect quality control information from existing third-party systems. This service operation is Quality_Data_Submit.
PeopleSoft delivers the service operations in PeopleSoft Integration Broker with a default status of Inactive. You must activate each service operation before attempting to send or receive data from a third-party source or another PeopleSoft system, such as CRM.
To use the Quality EIP:
Setup the service operation within PeopleSoft Integration Broker and Enterprise Components:
Use the information in the table below and refer to the setup instructions in the PeopleSoft Enterprise Supply Chain Management Integration 9.0 PeopleBook, “Implementing Integrations” chapter, Setting Up Service Operations section.
Service Operation |
Direction and Type |
Handlers |
Chunking Available? |
Integrates With |
QUALITY_DATA_SUBMIT |
Inbound Asynchronous |
QualityDataSubmit |
No |
third-party system |
Post service operations in the format required by the Quality_Data_Submit service operation into the Quality_Data_Submit message queue using PeopleSoft Integration Broker.
The Subscription PeopleCode then analyzes the data in the service operation—control testing and alarm notification—and updates the results in the PeopleSoft database.
The system marks subgroups that have encountered simple processing errors, such as an acceptance limit violation, as errors and holds them in a queue to prevent them from adversely affecting control calculations. To correct these problems, use the data editor.
If the system cannot process the service operation, it stops the service operation queue and all service operation processing for that channel cease until the situation is corrected. These types of errors should be found and corrected during integration and should not be part of a production system.
Note. Just as you should never have two or more operators simultaneously entering data into the same process stream, you should never have two or more EIP processes simultaneously submitting data to the same process stream. This almost always results in invalid analysis and alarming.
See Also
Enterprise PeopleTools 8.48 PeopleBook: Integration Broker
Before you begin to configure and define the Quality EIPs, you should understand the data rules associated with the EIPs.
Every Sample Requires Its Own Traceability Entry
Except for defectives type characteristics (y defective out of n), every individual sample in the measurement plan requires its own traceability entry, even if all the entries are identical (the lot number is the same for all samples in the session). This means that the number of rows of traceability has to equal the maximum subgroup sample size of all the characteristics in the measurement plan that defines the session. Defectives type characteristics always count as one sample for traceability purposes regardless of the subgroup size.
In EIP terms, take the maximum of the QS_NVALUES for all the subgroups in the session, and that's the number of rows of traceability information that is required.
Examples
This table lists examples of measurement plans and the EIP requirements.
Characteristic |
Data Type |
Subgroup Size |
Comments |
Length |
Variables |
4 |
|
Width |
Variables |
5 |
Largest subgroup size. |
Bad units |
Defectives |
1000 |
Only counts as one row. |
Bad electrical |
Defectives |
0 |
Only counts as one row. |
Defects |
Defects |
4 |
Note. Defectives data types always count as one row regardless of subgroup size.
In this example, specify five rows of traceability for this session dataset, because the largest subgroup size is five.
Characteristic |
Data Type |
Subgroup Size |
Comments |
Length |
Variables |
4 |
|
Width |
Variables |
5 |
Largest subgroup size. |
Bad units |
Defectives |
1000 |
Only counts as one row. |
Bad electrical |
Defectives |
0 |
Only counts as one row. |
Defects |
Defects |
0 |
Variable subgroup size. |
Note. Defectives data types always count as one row regardless of subgroup size.
The same rule applies in this example. The number of rows of traceability for the session dataset is still equal to the largest subgroup size. Because the defects subgroup size is variable, the dataset reflects this. Now the number of required traceability rows is five except for those datasets where the defects sample size is greater than five. As a result, the number of traceability rows equals the defects sample size.
Variable and Defects Data Types Have a Maximum Sample Size
Variable and defects have a maximum sample size of 20.
Subgroup Completion Only Applies to Variables Data Type
A subgroup completion only applies to variables type characteristics with accept incomplete option set to Average.
Order and Entry of Subgroup Values is Important
Subgroup values must start at the beginning and be contiguous (no holes in the values). Readings must start at 1 and continue until there are no others. You cannot specify the second and third values without specifying the first value.
This is a valid example:
<QS_NVALUES>3</QS_NVALUES> <QS_VALUEREADING_1>1</QS_VALUEREADING_1> <QS_VALUEREADING_2>2</QS_VALUEREADING_2> <QS_VALUEREADING_3>3</QS_VALUEREADING_3> <QS_VALUEREADING_4></QS_VALUEREADING_4> . . . <QS_VALUEREADING_20></QS_VALUEREADING_20>
These are two invalid examples:
<QS_NVALUES>3</QS_NVALUES> <QS_VALUEREADING_1></QS_VALUEREADING_1> <QS_VALUEREADING_2>2</QS_VALUEREADING_2> <QS_VALUEREADING_3>3</QS_VALUEREADING_3> . . . <QS_VALUEREADING_20></QS_VALUEREADING_20>
Note. You cannot specify values 2 and 3 without specifying 1.
<QS_NVALUES>3</QS_NVALUES> <QS_VALUEREADING_1>1</QS_VALUEREADING_1> <QS_VALUEREADING_2></QS_VALUEREADING_2> <QS_VALUEREADING_3>3</QS_VALUEREADING_3> . . . <QS_VALUEREADING_20></QS_VALUEREADING_20>
Note. You cannot skip a value. In this example you cannot skip 2.
This is a valid averaging point example, however, QS_VALUEREADING_3 is to be interpreted as 0 that yields a different average:
<QS_NVALUES>3</QS_NVALUES> <QS_VALUEREADING_1>1</QS_VALUEREADING_1> <QS_VALUEREADING_2>2</QS_VALUEREADING_2> <QS_VALUEREADING_3></QS_VALUEREADING_3> . . . <QS_VALUEREADING_20></QS_VALUEREADING_20>
Be careful when it comes to averaging values associated with the subgroup. In this example, if you were calculating the average for a point calculation, it would be (1+2+0) / 3 = 1. QS_VALUEREADING_3 is interpreted as zero in this particular case.
If you change the QS_NVALUES to 2 and the subgroup size is still 3, with the accept incomplete option on, the average would be (1+2)/2 = 1.5. Therefore, the point calculation would be (1+2+1.5)/3 = 1.5. You can calculate a totally different outcome depending on how you enter the data for the EIP.
See Also
How you define the Quality measurement plans determines how you should define and structure the Quality EIPs. The simpler the plans, the easier to define subgroups using EIPs.
Note. Complex measurement plans are inherently more difficult to integrate, test, and validate. Plans that may be appropriate for manual data entry might be cumbersome or impractical in an EIP configuration.
This table lists information about the EIP scenarios:
Sample |
Traceability Item 1 |
Traceability Item 2 |
Characteristic 1 |
Characteristic 2 |
1 |
none |
none |
none |
none |
2 |
none |
none |
none |
none |
... |
none |
none |
none |
none |
This diagram illustrates the EIP data scenario:
EIP data scenario
Scenario #1
A simple measurement plan with two variables type characteristics.
Sample |
Lot Number |
Serial Number |
Length |
Width |
1 |
X02-00 |
SN-01 |
2.31 |
4.31 |
2 |
X02-00 |
SN-02 |
2.29 |
4.32 |
3 |
X02-00 |
SN-03 |
2.30 |
4.29 |
This diagram illustrates scenario #1:
Scenario #1
Scenario #2
A measurement plan containing variables type characteristics with one derived characteristic. In this scenario, the area characteristic is derived from the length and width characteristics.
Sample |
Lot Number |
Serial Number |
Length |
Width |
Area + |
1 |
X02-00 |
SN-01 |
2.31 |
4.31 |
none |
2 |
X02-00 |
SN-02 |
2.29 |
4.32 |
none |
3 |
X02-00 |
SN-03 |
2.30 |
4.29 |
none |
Scenario #2
Note. You must submit a QS_EIP_SGRP_SUB record for the derived area characteristic, because the system knows nothing about measurement plans. It only knows and understands process streams. For the system to calculate the areas for this session, it must be asked to do so.
Scenario # 3
A measurement plan that contains variables type characteristics with non-uniform subgroup sample sizes.
Sample |
Lot Number |
Serial Number |
Length |
Width |
1 |
X02-00 |
SN-01 |
2.31 |
4.31 |
2 |
X02-00 |
SN-02 |
2.29 |
4.32 |
3 |
X02-00 |
SN-03 |
2.30 |
4.29 |
4 |
X02-00 |
SN-04 |
none |
4.30 |
5 |
X02-00 |
SN-05 |
none |
4.31 |
Scenario #3
Scenario #4
A measurement plan with variables type characteristics with readings for one of the characteristics that is incomplete. In this scenario, length readings are incomplete.
Sample |
Lot Number |
Serial Number |
Length |
Width |
1 |
X02-00 |
SN-01 |
2.31 |
4.31 |
2 |
X02-00 |
SN-02 |
2.29 |
4.32 |
3 |
X02-00 |
SN-03 |
2.30 |
4.29 |
4 |
X02-00 |
SN-04 |
- |
4.30 |
5 |
X02-00 |
SN-05 |
- |
4.31 |
Scenario #4
Scenario #5
A simple defectives type sample where the subgroup size is fixed.
Sample |
Lot Number |
Bad Units |
1 |
X02-00 |
6.00 |
Scenario #5
Scenario #6
A defectives type sample where the subgroup sample size is variable.
Sample |
Lot Number |
Defective Units Subgroup Size |
Defective Units Bad Units |
1 |
X02-00 |
1000 |
2.00 |
Scenario #6
Scenario #7
A measurement plan with defectives categorized where the subgroup sample size is fixed at five. A sample might have one or more defects that qualify as making the item defective. In this scenario, there are five items, two of which are defective. In addition to noting the number of defective units, state the reason why they are defective.
Note. The data source determines whether the collection of defects constitutes a defective item.
Sample |
Lot Number |
Serial Number |
Defectives Defect |
Defectives Bad Units |
1 |
X02-00 |
SN-01 |
3 Scratches, Top, Left 1 Broken, Contact Pin, P4 |
2 |
2 |
X02-00 |
SN-02 |
No defects |
none |
3 |
X02-00 |
SN-03 |
No defects |
none |
4 |
X02-00 |
SN-04 |
No defects |
none |
5 |
X02-00 |
SN-05 |
1 Paint Smear, Bottom, Left |
none |
Scenario #7
Scenario #8
A measurement plan with defects data type characteristics where the subgroup sample size is fixed or variable.
Sample |
Lot Number |
Serial Number |
Physical Defects * |
1 |
X02-00 |
SN-01 |
3 Scratches, Top, Left 1 Blemishes, Bottom, Right |
2 |
X02-00 |
SN-02 |
1 Finish, Top, Right |
3 |
X02-00 |
SN-03 |
2 Scratches, Top, Left 1 Scratches, Top, Right 2 Scratches, Bottom, Right |
4 |
X02-00 |
SN-04 |
No defects |
5 |
X02-00 |
SN-05 |
1 Paint smear, Bottom, Left |
Note. * Physical Defects is a user-defined characteristic name and not a predefined type.
Scenario #8
Scenario #9
A measurement plan with two defects data type characteristics where the subgroup sample size is uniform.
Sample |
Lot Number |
Serial Number |
Physical Defects * |
Electrical Defects * |
1 |
X02-00 |
SN-01 |
3 Scratches, Top, Left 1 Blemishes, Bottom, Right |
1 Inoperative connector, pin, 3 |
2 |
X02-00 |
SN-02 |
1 Finish, Top, Right |
No defects |
3 |
X02-00 |
SN-03 |
2 Scratches, Top, Left 1 Scratches, Top, Right 2 Scratches, Bottom, Right |
No defects |
4 |
X02-00 |
SN-04 |
No defects |
1 Inoperative chip, 741OpAmp, 2 |
5 |
X02-00 |
SN-05 |
1 Paint Smear, Bottom, Left |
I Incorrect jumper, Jmp 2, Pins 2-3 |
Note. * Physical Defects and Electrical Defects are user-defined characteristic names and not predefined types.
Scenario #9
Scenario #10
A measurement plan with variables and defects data type characteristics with a uniform subgroup sample size of 5.
Sample |
Lot Number |
Serial Number |
Physical Defects * |
Length |
Width |
1 |
X02-00 |
SN-01 |
3 Scratches, Top, Left 1 Blemishes, Bottom, Right |
2.31 |
4.31 |
2 |
X02-00 |
SN-02 |
1 Finish, Top, Right |
2.29 |
4.32 |
3 |
X02-00 |
SN-03 |
2 Scratches, Top, Left 1 Scratches, Top, Right 2 Scratches, Bottom, Right |
2.30 |
4.29 |
4 |
X02-00 |
SN-04 |
No defects |
2.30 |
4.30 |
5 |
X02-00 |
SN-05 |
1 Paint smear, Bottom, Left |
2.31 |
4.31 |
Note. * Physical Defects is a user-defined characteristic name and not a predefined type.
Scenario #10
Scenario #11
A measurement plan with variables and defects data type characteristics and a non-uniform subgroup sample size.
Sample |
Lot Number |
Serial Number |
Physical Defects * |
Length |
Width |
1 |
X02-00 |
SN-01 |
3 Scratches, Top, Left 1 Blemishes, Bottom, Right |
2.31 |
4.31 |
2 |
X02-00 |
SN-02 |
1 Finish, Top, Right |
2.29 |
4.32 |
3 |
X02-00 |
SN-03 |
2 Scratches, Top, Left 1 Scratches, Top, Right 2 Scratches, Bottom, Right |
none |
4.29 |
4 |
X02-00 |
SN-04 |
none |
none |
4.30 |
5 |
X02-00 |
SN-05 |
none |
none |
4.31 |
Note. * Physical Defects is a user-defined characteristic name and not a predefined type.
Scenario #11
Scenario #12
A measurement plan with two defects and one defectives data type characteristics where the subgroup sample size is uniform.
Sample |
Lot Number |
Serial Number |
Physical Defects * |
Electrical Defects * |
Bad Units |
1 |
X02-00 |
SN-01 |
3 Scratches, Top, Left 1 Blemishes, Bottom, Right |
1 Inoperative connector, pin, 3 |
3 |
2 |
X02-00 |
SN-02 |
No defects |
No defects |
none |
3 |
X02-00 |
SN-03 |
No defects |
No defects |
none |
4 |
X02-00 |
SN-04 |
No defects |
1 Inoperative chip, 741OpAmp, 2 |
none |
5 |
X02-00 |
SN-05 |
1 Paint smear, Bottom, Left |
1 Incorrect jumper, Jmp 2, Pins 2-3 |
none |
Note. * Physical Defects and Electrical Defects are user-defined characteristic names and not predefined types.
Scenario #12
This section discusses how to:
Use structured query language (SQL).
Use and test PeopleSoft Application Engine programs.
Note. The stream IDs must be changed to reflect the configuration in the system. The stream ID sections that need to be changed are in italics.
Following are a series of sample SQL statements.
Validation SQL Statements
This sample code shows validation statements:
select PS_QS_STREAM8.STREAM_ID, PS_QS_STREAM8.QS_APP_CONTEXT FROM PS_QS_STREAM8,PS_QS_STREAM_ROOT,PS_QS_APP_DEF WHERE PS_QS_STREAM8.STREAM_ID >= 164 AND PS_QS_STREAM8.STREAM_ID <= 164 and PS_QS_STREAM8.STREAM_ROOT_ID = PS_QS_STREAM_ROOT.STREAM_ROOT_ID and PS_QS_APP_DEF.QS_APP_CONTEXT = PS_QS_STREAM_ROOT.QS_APP_CONTEXT ORDER BY STREAM_ID select PS_QS_STREAM8.STREAM_ID FROM PS_QS_STREAM8,PS_QS_STREAM_ROOT WHERE PS_QS_STREAM8.STREAM_ID >= 164 AND PS_QS_STREAM8.STREAM_ID <= 164 and PS_QS_STREAM8.STREAM_ROOT_ID = PS_QS_STREAM_ROOT.STREAM_ROOT_ID ORDER BY STREAM_ID select STREAM_ID, CLIM_STS_CD, CLIM_ID, STR_SGRP_CNT, STR_SGRP_SEQ, CUR_SGRP_SIZE, CUR_SPEC_VIO_CNT, CUR_PLOT_VALUE1, CUR_PLOT_VALUE2, RUN_MOMENT, TSWIN_BUFFER1, TSWIN_BUFFER2 FROM PS_QS_STREAM8 WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 select BUSINESS_UNIT, STREAM_ID, CLIM_ID, CLIM_STS_CD, CLIM_UPPER_X, CLIM_UX_IND, CLIM_MEAN_X, CLIM_MX_IND, CLIM_LOWER_X, CLIM_LX_IND, CLIM_UPPER_MRANGE, CLIM_UMRANGE_IND, CLIM_MEAN_RANGE, CLIM_MRANGE_IND, CLIM_LOWER_MRANGE, CLIM_LMRANGE_IND, CLIM_CRE_DTTM, CLIM_CRE_BY from PS_QS_CNTL_LIM_HIS WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 ORDER BY CLIM_ID select BUSINESS_UNIT, SESSN_ID, STREAM_ID, SESSN_STREAM_SEQ, SESSN_SGRP_SEQ, SESSN_STRM_STS, SESSN_SGRP_SIZE, MFDS_DATA_TYPE_CD, SESSN_ANLZ_READY, CLIM_ID, SPEC_ID, SRSLT_P1, SRSLT_P1_IND, SRSLT_P2, SRSLT_P2_IND, CLIM_STS_CD, SPEC_VIO_SW, QS_ANALYZER_STATUS, QS_ALARM_CNT, QS_NVALUES, QS_VALUEREADING_1, QS_VALUEREADING_2, QS_VALUEREADING_3, QS_VALUEREADING_4, QS_VALUEREADING_5, DISPATCH_FLAG, SESSN_SUBMIT_DTTM, SRSLT_CRE_DTTM, QS_ACTION_CNT, QS_CAUSE_CNT, QS_COMM_CNT, OPERATOR, QS_UAID from PS_QS_SUBGROUP WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 ORDER BY SESSN_ID select BUSINESS_UNIT, SESSN_ID, STREAM_ID, SAMPLE, TEST_SEQ, TEST_ID from PS_QS_SESSN_TEST8 WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 ORDER BY SESSN_ID
Generic SQL Statements
This sample code shows generic statements:
select STREAM_ID, CLIM_STS_CD, CLIM_ID, STR_SGRP_CNT, STR_SGRP_SEQ, CUR_SGRP_SIZE, CUR_SPEC_VIO_CNT, CUR_PLOT_VALUE1, CUR_PLOT_VALUE2, RUN_MOMENT, TSWIN_BUFFER1, TSWIN_BUFFER2 FROM PS_QS_STREAM8 WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 select * from PS_QS_CNTL_LIM_HIS WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 select PS_QS_SESSN_HDR8.* from PS_QS_SUBGROUP,PS_QS_SESSN_HDR8
WHERE STREAM_ID >= 164 AND STREAM_ID <= 164
AND PS_QS_SESSN_HDR8.SESSN_ID = PS_QS_SUBGROUP.SESSN_ID select PS_QS_SESSN_TRACE8.* from PS_QS_SUBGROUP,PS_QS_SESSN_TRACE8
WHERE STREAM_ID >= 164 AND STREAM_ID <= 164
AND PS_QS_SESSN_TRACE8.SESSN_ID = PS_QS_SUBGROUP.SESSN_ID select * from PS_QS_SUBGROUP WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 select * from PS_QS_SESSN_DFCT8 WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 select * from PS_QS_SESSN_TEST8 WHERE STREAM_ID >= 164 AND STREAM_ID <= 164
SQL to Reset Database Tables
This sample code shows statements to reset database tables:
update PS_QS_STREAM8 set CLIM_STS_CD = "NONE", CLIM_ID = "NONE", STR_SGRP_CNT = 0, STR_SGRP_SEQ = 0, CUR_SGRP_SIZE = 0, CUR_SPEC_VIO_CNT = 0, CUR_PLOT_VALUE1 = 0, CUR_PLOT_VALUE2 = 0, RUN_MOMENT = 0, TSWIN_BUFFER1 = "", TSWIN_BUFFER2 = "" WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 delete from PS_QS_SESSN_HDR8 WHERE SESSN_ID in (select SESSN_ID
from PS_QS_SUBGROUP where STREAM_ID >= 164 AND STREAM_ID <= 164) delete from PS_QS_SESSN_TRACE8 WHERE SESSN_ID in (select SESSN_ID
from PS_QS_SUBGROUP where STREAM_ID >= 164 AND STREAM_ID <= 164) delete from PS_QS_SESSN_DFCT8 WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 delete from PS_QS_CNTL_LIM_HIS WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 delete from PS_QS_SESSN_TEST8 WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 delete from PS_QS_SUBGROUP WHERE STREAM_ID >= 164 AND STREAM_ID <= 164
SQL to Retrieve Stream Information
This sample code shows statements to retrieve information:
select STREAM_ID, MFDS_ID, CLIM_STS_CD, STR_SGRP_CNT, STR_SGRP_SEQ, CLIM_ID, CUR_SGRP_SIZE, CUR_SPEC_VIO_CNT, CUR_PLOT_VALUE1, CUR_PLOT_VALUE2, RUN_MOMENT, TSWIN_BUFFER1, TSWIN_BUFFER2, SPEC_ID, SPEC_LSL, SPEC_LSL_IND, SPEC_USL, SPEC_USL_IND, SPEC_FACTOR1, SPEC_FACTOR1_IND, SPEC_FACTOR2, SPEC_FACTOR2_IND, MFDS_COLLECT_SW, MFDS_NAME, MFDS_SGRP_SIZE, MFDS_DATA_TYPE_CD, MFDS_LAL, MFDS_LAL_IND, MFDS_UAL, MFDS_UAL_IND, MFDS_INC_CD, MFDS_FORMULA, CHART_ID, PROC_ID, CLIM_UPPER_X, CLIM_UX_IND, CLIM_MEAN_X, CLIM_MX_IND, CLIM_LOWER_X, CLIM_LX_IND, CLIM_UPPER_MRANGE, CLIM_UMRANGE_IND, CLIM_MEAN_RANGE, CLIM_MRANGE_IND, CLIM_LOWER_MRANGE, CLIM_LMRANGE_IND FROM PS_QS_API_STR83_VW WHERE STREAM_ID >= 164 AND STREAM_ID <= 164 ORDER BY STREAM_ID
This is an example of a Application Engine program that reads an ASCII text file and posts a Quality EIP message. The following sample displays an input file for the Application Engine program:
/* Read source file and publish messages into EIP message queue. */ Local File &TestDataIn, &LogFileOut; Local string &LineIn, &LogMsg, &FilenameIn, &LogFilename; Local number &iRowSet, &WriteStatus, &nLinesIn, &nSessionGroups, &nSessions; Local number &nSubgroups, &nDefects, &nTraceSets, &iValue; Local number &iSession, &iSubgroup, &iDefect, &iTrace; /* record keys */ Local number &SessionGroupId, &SessionId, &StreamId; Local string &DataSource; /* record fields */ Local string &Fieldname, &Fieldvalue; Local Message &Message; Local Rowset &SessionGroupRs, &SessionRs, &SubgroupRs, &DefectRs, &TraceRs; Local Row &SessionGroupRow, &SessionRow, &SubgroupRow, &DefectRow, &TraceRow; Local Record &SessionGroupRec, &SessionRec, &SubgroupRec, &DefectRec, &TraceRec; Local datetime &SessionCreateDttm; /* end of declarations *****************************************************/ &nLinesIn = 0; &nSessionGroups = 0; &nSessions = 0; &nSubgroups = 0; &nDefects = 0; &nTraceSets = 0; &FilenameIn = "EIPTestDataIn.txt"; &LogFilename = "EIPTestDataIn.log"; &LogFileOut = GetFile(&LogFilename, "W", "A", %FilePath_Absolute); If (&LogFileOut.IsOpen = False) Then Return; End-If; &LogFileOut.WriteLine("Processing started " | %Datetime | ", [" | &FilenameIn | "]"); &LogFileOut.WriteLine(""); &TestDataIn = GetFile(&FilenameIn, "E", "A", %FilePath_Absolute); If (&TestDataIn.IsOpen = False) Then &LogMsg = "Unable to open input file [" | &FilenameIn | "]"; &LogFileOut.WriteLine(&LogMsg); &LogFileOut.Close(); Return; End-If; &Message = CreateMessage(Message.QUALITY_DATA_SUBMIT); If (&Message = Null) Then &LogMsg = "Unable to create message"; &LogFileOut.WriteLine(&LogMsg); &LogFileOut.Close(); Return; End-If; If (&Message.IsActive = False) Then &LogMsg = "Message is inactive"; &LogFileOut.WriteLine(&LogMsg); &LogFileOut.Close(); Return; End-If; &SessionGroupRs = &Message.GetRowset(); While &TestDataIn.ReadLine(&LineIn) &nLinesIn = &nLinesIn + 1; &LogMsg = "Processing line " | &nLinesIn | ", [" | &LineIn | "]"; &LogFileOut.WriteLine(&LogMsg); /* We need to do publish messages here... */ /* identify the record type */ If (Substring(&LineIn, 1, 13) = "session group") Then /* check to make sure that we don't overrun our output message buffer */ If ((&Message.Size + 100000) > %MaxMessageSize) Then &Message.Publish(); &Message = CreateMessage(Message.QUALITY_DATA_SUBMIT); If (&Message = Null) Then &LogFileOut.WriteLine("Unable to create message"); &LogFileOut.Close(); Return; End-If; &SessionGroupRs = &Message.GetRowset(); End-If; &nSessionGroups = &nSessionGroups + 1; &SessionGroupId = Value(LTrim(Substring(&LineIn, 15, 4))); &DataSource = Substring(&LineIn, 22, 12); If (&nSessionGroups > 1) Then &SessionGroupRs.InsertRow(&nSessionGroups - 1); End-If; &SessionGroupRow = &SessionGroupRs.GetRow(&nSessionGroups); &SessionGroupRec = &SessionGroupRow.GetRecord(Record.QS_EIP_SESS_GRP); /* set keys */ &SessionGroupRec.QS_EIP_SESSION_GRP.Value = &SessionGroupId; &SessionGroupRec.QS_EIP_DATASOURCE.Value = &DataSource; &iSession = 0; Else If (Substring(&LineIn, 1, 9) = " session") Then /* stop the last timer and start a new one */ &nSessions = &nSessions + 1; &iSession = &iSession + 1; &SessionRs = &SessionGroupRow.GetRowset(1); /* original -> &SessionId = Value(LTrim(Substring(&LineIn, 14, 5))); */ /* using statement below to autonumber */ &SessionId = &iSession; If (&iSession > 1) Then &SessionRs.InsertRow(&iSession - 1); End-If; &SessionRow = &SessionRs.GetRow(&iSession); &SessionRec = &SessionRow.GetRecord(Record.QS_EIP_SESSION); /* set keys */ &SessionRec.QS_EIP_SESSION_GRP.Value = &SessionGroupId; &SessionRec.QS_EIP_DATASOURCE.Value = &DataSource; &SessionRec.QS_EIP_SESSN_ID.Value = &SessionId; /* set fields */ &SessionRec.BUSINESS_UNIT.Value = LTrim(Substring(&LineIn, 22, 10)); &SessionCreateDttm = %Datetime; &SessionRec.SESSN_CRE_DTTM.Value = &SessionCreateDttm; /* Set session status to saved = 1, move = 2 */ &SessionRec.QS_SESSION_STATUS.Value = 1; /* set traceset to locked = 2, not locked = 1 */ &SessionRec.QS_EIP_TRACELOCK.Value = 2; &iSubgroup = 0; &iTrace = 0; Else If (Substring(&LineIn, 1, 12) = " subgroup") Then &nSubgroups = &nSubgroups + 1; &iSubgroup = &iSubgroup + 1; For &iRowSet = 1 To &SessionRow.ChildCount If (&SessionRow.GetRowset(&iRowSet).DBRecordName =
"QS_EIP_SGRP_SUB") Then Break; End-If; End-For; &SubgroupRs = &SessionRow.GetRowset(&iRowSet); &StreamId = Value(LTrim(Substring(&LineIn, 14, 5))); If (&iSubgroup > 1) Then &SubgroupRs.InsertRow(&iSubgroup - 1); End-If; &SubgroupRow = &SubgroupRs.GetRow(&iSubgroup); &SubgroupRec = &SubgroupRow.GetRecord(Record.QS_EIP_SGRP_SUB); /* set keys */ &SubgroupRec.QS_EIP_SESSION_GRP.Value = &SessionGroupId; &SubgroupRec.QS_EIP_DATASOURCE.Value = &DataSource; &SubgroupRec.QS_EIP_SESSN_ID.Value = &SessionId; &SubgroupRec.STREAM_ID.Value = &StreamId; /* set fields */ /* set subgroup status to submitted = 2, saved = 1 */ &SubgroupRec.QS_SUBGROUP_STATUS.Value = 2; &SubgroupRec.SESSN_CRE_DTTM.Value = &SessionCreateDttm; &SubgroupRec.SESSN_SUBMIT_DTTM.Value = %Datetime; &SubgroupRec.OPERATOR.Value = %OperatorId; &SubgroupRec.SESSN_SGRP_SIZE.Value =
Value(LTrim(Substring(&LineIn, 20, 8))); &SubgroupRec.QS_NVALUES.Value = Value(LTrim(Substring(&LineIn, 29, 8))); For &iValue = 1 To &SubgroupRec.QS_NVALUES.Value &Fieldname = "FIELD.QS_VALUEREADING_" | &iValue; &SubgroupRec.GetField(@&Fieldname).Value =
Value(RTrim(LTrim(Substring(&LineIn, 38 +
((&iValue - 1) * 9), 8)))); End-For; &iDefect = 0; Else If (Substring(&LineIn, 1, 12) = " defect") Then &nDefects = &nDefects + 1; &iDefect = &iDefect + 1; For &iRowSet = 1 To &SubgroupRow.ChildCount If (&SubgroupRow.GetRowset(&iRowSet).
DBRecordName = "QS_EIP_DEFECTS") Then Break; End-If; End-For; &DefectRs = &SubgroupRow.GetRowset(&iRowSet); If (&iDefect > 1) Then &DefectRs.InsertRow(&iDefect - 1); End-If; &DefectRow = &DefectRs.GetRow(&iDefect); &DefectRec = &DefectRow.GetRecord(Record.QS_EIP_DEFECTS); /* set keys */ &DefectRec.QS_EIP_SESSION_GRP.Value = &SessionGroupId; &DefectRec.QS_EIP_DATASOURCE.Value = &DataSource; &DefectRec.QS_EIP_SESSN_ID.Value = &SessionId; &DefectRec.STREAM_ID.Value = &StreamId; &DefectRec.SAMPLE.Value = Value(LTrim(Substring(&LineIn, 16, 5))); &DefectRec.DFCT_SEQ.Value = Value(LTrim(Substring(&LineIn, 22, 3))); /* set fields */ &DefectRec.DFCT_L1_DEFN.Value = RTrim(Substring(&LineIn, 28, 10)); &DefectRec.DFCT_L2_DEFN.Value = RTrim(Substring(&LineIn, 39, 10)); &DefectRec.DFCT_L3_DEFN.Value = RTrim(Substring(&LineIn, 50, 10)); &DefectRec.DFCT_CNT.Value = Value(LTrim(Substring(&LineIn, 61, 5))); Else If (Substring(&LineIn, 1, 12) = " traceset") Then &nTraceSets = &nTraceSets + 1; &iTrace = &iTrace + 1; For &iRowSet = 1 To &SessionRow.ChildCount If (&SessionRow.GetRowset(&iRowSet).DBRecordName =
"QS_EIP_TRACE") Then Break; End-If; End-For; &TraceRs = &SessionRow.GetRowset(&iRowSet); If (&iTrace > 1) Then &TraceRs.InsertRow(&iTrace - 1); End-If; &TraceRow = &TraceRs.GetRow(&iTrace); &TraceRec = &TraceRow.GetRecord(Record.QS_EIP_TRACE); /* set keys */ &TraceRec.QS_EIP_SESSION_GRP.Value = &SessionGroupId; &TraceRec.QS_EIP_DATASOURCE.Value = &DataSource; &TraceRec.QS_EIP_SESSN_ID.Value = &SessionId; &TraceRec.SAMPLE.Value = &iTrace; /* set operator and date/time stamp trace field defaults */ &TraceRec.OPERATOR.Value = %OperatorId; &TraceRec.STAMP_DTTM.Value = %Datetime; Else /* set trace fields */ If (Substring(&LineIn, 1, 11) = " field") Then &Fieldname = "FIELD." | RTrim(Substring(&LineIn, 16, 14)); &Fieldvalue = RTrim(LTrim(Substring(&LineIn, 30, 20))); &TraceRec.GetField(@&Fieldname).Value = &Fieldvalue; Else /* ignore comment lines */ If ( Not ((Substring(&LineIn, 1, 2) = "//") Or (&LineIn = ""))) Then &LogMsg = "Invalid line [" | &LineIn | "]"; &LogFileOut.WriteLine(&LogMsg); End-If; End-If; End-If; End-If; End-If; End-If; End-If; End-While; &LogFileOut.WriteLine(""); &LogMsg = "Message size = " | &Message.Size | ",
maximum message size = " | %MaxMessageSize; &LogFileOut.WriteLine(&LogMsg); &Message.Publish(); /* cleanup */ &TestDataIn.Close(); &LogFileOut.WriteLine(""); &LogMsg = &nSessions | " sessions, " | &nSubgroups | " subgroups, " |
&nDefects | " defects, " | &nTraceSets | " tracesets."; &LogFileOut.WriteLine(&LogMsg); &LogMsg = "Processing completed " | %Datetime | ", " | &nLinesIn |
" lines processed, closing log file."; &LogFileOut.WriteLine(&LogMsg); &LogFileOut.Close();
Application Engine Sample Input Test File
This test file is only an example. For the file to be useful, you must change the information in the example to reflect the information in the configuration.
// Test set // session group 2 EIP-AE session 1 M04 subgroup 140 3 3 13 11 12 subgroup 141 3 3 24 23 23 subgroup 142 3 3 34 33 33 session 2 M04 subgroup 140 3 3 12 12 13 subgroup 141 3 3 22 22 22 subgroup 142 3 3 32 32 32 session 3 M04 subgroup 140 3 3 11 12 13 subgroup 141 3 3 21 22 23 subgroup 142 3 3 31 32 33 session 4 M04 subgroup 140 3 3 13 11 13 subgroup 141 3 3 13 11 13 subgroup 142 3 3 13 11 13 session 5 M04 subgroup 140 3 3 12 11 13 subgroup 141 3 3 12 11 13 subgroup 142 3 3 12 11 13 session 6 M04 subgroup 140 3 3 14 11 13 subgroup 141 3 3 14 11 13 subgroup 142 3 3 14 11 13 session 7 M04 subgroup 140 3 3 12 12 12 subgroup 141 3 3 22 22 22 subgroup 142 3 3 22 22 22 session 8 M04 subgroup 140 3 3 13 12 13 subgroup 141 3 3 13 12 13 subgroup 142 3 3 13 12 13 session 9 M04 subgroup 140 3 3 14 13 11 subgroup 141 3 3 14 13 11 subgroup 142 3 3 14 13 11 session 10 M04 subgroup 140 3 3 14 13 12 subgroup 141 3 3 13 11 11 subgroup 142 3 3 13 11 11 session 11 M04 subgroup 140 3 3 13 11 11 subgroup 141 3 3 12 11 12 subgroup 142 3 3 12 11 12 session 12 M04 subgroup 140 3 3 12 11 12 subgroup 141 3 3 13 11 13 subgroup 142 3 3 13 11 13 session 13 M04 subgroup 140 3 3 13 11 13 subgroup 141 3 3 12 12 13 subgroup 142 3 3 12 12 13 session 14 M04 subgroup 140 3 3 12 12 13 subgroup 141 3 3 13 12 11 subgroup 142 3 3 13 12 11 session 15 M04 subgroup 140 3 3 13 12 11 subgroup 141 3 3 11 13 13 subgroup 142 3 3 11 13 13 session 16 M04 subgroup 140 3 3 11 13 13 subgroup 141 3 3 22 22 22 subgroup 142 3 3 22 22 22 session 17 M04 subgroup 140 3 3 12 12 12 subgroup 141 3 3 13 12 11 subgroup 142 3 3 13 12 11 session 18 M04 subgroup 140 3 3 13 12 11 subgroup 141 3 3 14 11 12 subgroup 142 3 3 11 12 14 session 19 M04 subgroup 140 3 3 14 11 12 subgroup 141 3 3 11 12 14 subgroup 142 3 3 12 12 14 session 20 M04 subgroup 140 3 3 11 12 14 subgroup 141 3 3 12 12 14 subgroup 142 3 3 14 11 12 session 21 M04 subgroup 140 3 3 12 12 14 subgroup 141 3 3 13 11 11 subgroup 142 3 3 13 11 11 session 22 M04 subgroup 140 3 3 13 11 11 subgroup 141 3 3 12 11 12 subgroup 142 3 3 12 11 12 session 23 M04 subgroup 140 3 3 12 11 12 subgroup 141 3 3 12 11 11 subgroup 142 3 3 12 11 11 session 24 M04 subgroup 140 3 3 11 12 11 subgroup 141 3 3 11 14 13 subgroup 142 3 3 11 14 13 session 25 M04 subgroup 140 3 3 11 14 13 subgroup 141 3 3 13 11 12 subgroup 142 3 3 13 11 12