C++ Unified API
Requirements
Please see the readme.txt file that accompanies Instream for Instream requirements information.
You also need:
-
Access to persons with knowledge of C++ and Instream.
-
Compiler:
Windows Microsoft Visual C++ version 2010 or later
UNIX GCC version:
AIX
4.1.1
Oracle/Sun Solaris
3.3.2
Linux
3.4.5
-
Files
UNIX Files
| API\C++Sample Directory | ||
|---|---|---|
|
File |
Location / Purpose |
|
|
|
Sample header file that funnels the detailed results and summary results to your program one line at a time. |
|
|
|
Sample source code that you can edit. |
|
| Required Files |
||
|
|
Instream’s API \ Include directory Defines the classes, procedures, and constants needed to interface to the Instream Validation Engine. Include it in your C++ source file. The main class needed (and contained in this file) is FSInStream, which is described in the next section. Note: Do not modify this file. This object is passed to the validation engine and might be changed when you upgrade to a newer version.
|
|
|
|
Instream’s API/ Source directory File that actually calls the validation engine. Add FSInStream to you own project that calls the Validation engine. Note: Do not change this file. This object is passed to the validation engine and may be changed with the next installation.
|
|
|
|
Instream’s Bin directory The Instream dynamic-link library. Include the Bin directory is the system’s Path. |
|
Windows Files
| Instream’s API\InStreamAPISample Directory | ||
|---|---|---|
|
File |
Location / Purpose |
|
|
|
Sample header file that funnels the detailed results and summary results to your program one line at a time. |
|
|
|
Sample source code that you can edit. |
|
| Required Files |
||
|
|
Instream’s API \ Include directory Defines the classes, procedures, and constants needed to interface to the Instream Validation Engine. Include it in your C++ source file. The main class needed (and contained in this file) is FSInStream, which is described in the next section. Note: Do not change this file. This object is passed to the validation engine and may be changed with the next installation.
|
|
|
|
Instream’s API \ Source directory File that actually calls the validation engine. Add FSInStream to your own project that calls the Validation engine. Note: Do not change this file. This object is passed to the validation engine and may be changed with the next installation.
|
|
| Visual Studio Version Specific Files in Instream's API/InStreamAPISample/VS201x Directories There are two versions of the Windows C++ API Sample for use with different versions of Microsoft's Visual Studio. The Visual Studio 2010-specific files are found in the folder VS2010, while the Visual Studio 2015 (and later)-specific files are found in the folder VS2015. |
||
|
|
Visual Studio solution file for sample project. |
|
|
|
Visual Studio project file for sample project. |
|
|
|
Debug build of the Instream dll located in the DLLs sub-folder under the VS201x folder. If you wish to use this build, copy it to the Instream/Bin directory and rename it to |
|
|
|
Release build of the Instream dll located in the DLLs sub-folder under the VS201x folder. If you wish to use this build, copy it to the Instream/Bin directory and rename it to |
|
FSInStream Class
The FSInStream class is the link between your C/C++ application and the Instream Validation Engine Library. An object of the FSInStream class is initiated, its input parameters initialized to the appropriate files, options, etc. and then the Analyze procedure is called to perform the validation.
| Method | Details |
|---|---|
| Analyze |
Once you have called the necessary Set and Get methods, call the Analyze method to perform the actual validation. Return codes are listed in TIBCO Foresight® Instream® Validation Technical Manual If a return code indicates an error, you can use the function GetLastErrorMessage to get a detailed description of the er |
|
Example:
|
|
| RespGen |
Once you have called the necessary Set and Get methods, call the RespGen method to perform the actual generation of 997, 999, 824, 277, or custom text reports. Return codes are listed in TIBCO Foresight® Instream® Response Generator |
|
Example:
|
|
| Split |
Once you have called the necessary Set and Get methods, call the Split method to perform the actual document splitting. Return codes are listed in TIBCO Foresight® Instream® Document Splitter. |
|
Example: retVal=myInStream.Split();
|
|
| Substitution |
Once you have called the necessary Set methods, call the Substitution method to run Docsplitter. Return codes are listed in TIBCO Foresight® Instream® Document Splitter. |
|
Example: retVal = myInStream.Substitution();
|
|
| DocumentLevelOnly |
This lets you process EDI data that has no enveloping. When set to true, the Interchange and Functional Group envelope is processed with the data in SetIntEnvelope and SetFGEnvelope (below). Both SetIntEnvelope and SetFGEnvelope must be included if you want to use DocumentLevelOnly.If the incoming EDI data contain an Interchange and Functional Group Envelope, its enveloping will always be used regardless of DocumentLevelOnly. Another method for document only processing is to use m_separator (see page C++ Unified API). |
|
Example: //Set Document Level Only Parameters
|
|
| getDocReport | (memory output only) Memory buffer for the Docsplitter report |
|
Example:
|
|
| getInValidEdi | (memory output only) Memory buffer for the Invalid EDI file created by Docsplitter. |
|
Example:
|
|
| GetLastErrorMessage | Returns the text of the last error encountered by Instream validation. |
|
Example:
|
|
|
GetRGoutput997 GetRGoutput999 GetRGOoutput277 GetRGOoutput824 GetRGOoutputTA1 GetRGOoutputReport |
(Response Generator memory output only) These are the buffer names for the Response Generator output. |
|
Example:
|
|
| getValidEdi | (memory output only) Memory buffer for the Valid EDI file created by Docsplitter. |
|
Example:
|
|
| getVersion |
Returns the version of Instream being used. Example: 9.1.0 |
|
Example:
|
|
| m_svrty.SUM_ severity
|
(File-based output only) Returns count of errors of a particular severity: IgnoreCount InfoCount WarningCount ErrorCount FatalCount User1Count User2Count |
|
Example:
|
|
| m_etype.SUM_ type |
(File-based output only) Returns count of errors of a particular type: TypeZeroCount SyntaxCount TypeTwoCount SituationCount CodeSetCount ProductCount PayerCount PartnerCount |
|
Example:
|
|
|
m_originalFileInfo.mon m_originalFileInfo.day m_originalFileInfo.year m_originalFileInfo.hour m_originalFileInfo.min m_originalFileInfo.sec m_originalFileInfo.fsize m_originalFileInfo.FilePathName |
Specifies the month, day, year, hour, minute, second, size, and path of the original EDI file. m_separator For “document only” validation - when the data does not have ISA or GS enveloping, or when the enveloping is to be ignored. m_separator.seg m_separator.elm m_separator.comp Delimiters and separators for document only validation. They can be in these formats: integer example: 29 hexadecimal example: 0x1E character example: ~ m_separator.ignoreENV Validation is to ignore ISA and GS enveloping and use the separators provided with m_separator.seg, m_separator.elm and m_separator.comp. This requires that m_separator.seg, m_separator.elm and m_separator.comp be provided, and it must come AFTER them. Another method for document only processing is to use DocumentLevelOnly (see page C++ Unified API). |
|
Example:
|
|
|
rg_277 rg_824 rg_997 rg_999 rg_TA1 rg_text |
(memory output only) If set to true, these create the specific types of Response Generator output in memory. |
|
Example:
Since RGReportItem.rg is set to true, this example creates 824 output in memory. It does not create TA1 output. |
|
| setDocReportFormat |
(memory output only) Specifies the format of the Docsplitter report, one of these: DocXMLFormat DocDelimitedFormat The XML format slows performance more than the CSV format. |
|
Example:
|
|
| SetDSOptions |
Docsplitter options to create valid and/or invalid EDI files using one of these: DOC_ReportBoth DOC_ReportInvalidOnly DOC_ReportValidOnly SetDSReportInvalidFile Gives the path and filename of the Docsplitter invalid EDI file. SetDSReportValidFile Gives the path and filename of the Docsplitter valid EDI file. |
|
Example:
|
|
| SetDSplitEdiOutputOpt |
Specifies that the Docsplitter valid and invalid EDI is to be output to memory. Settings can be: OutputByMemory OutputByFile |
|
Example:
|
|
| SetDSplitReportOutputOpt |
Specifies that the Docsplitter report is to be output to memory. Settings can be: OutputByMemory OutputByFile |
|
Example:
|
|
| SetDSReportDebug |
0 turns off debug Docsplitter messages 1 turns on debug Docsplitter messages Default is 0. |
|
Example:
|
|
| SetDSReportFile |
0 turns off debug Docsplitter messages 1 turns on debug Docsplitter messages Default is 0. |
|
Example:
|
|
| SetDSReportFile | Sets the path and filename of the Docsplitter report. It will contain XML if the filename ends with .xml. It will be a delimited report if the filename ends with .csv. |
|
Example:
|
|
| SetDSubEDIInputSourceOption |
Sets Docsplitter’s EDI input to memory or file; used when Docsplitter is being used in the mode that calls Instream. Currently, Docsplitter can output to file, but not to memory. It can input from memory if it calls Instream, but not if it accepts validation detail results as input. This can be set to: InputByMemory InputByFile |
|
Example:
|
|
| SetDSubEDIOutputFile | Points to Docsplitter’s EDI output file. Must be set to strEDIOutputFile. |
|
Example:
|
|
| SetGuideline |
Specifies the guideline to use for the validation. If omitted, Instream uses the first guideline encountered that matches the data’s Version/Release Identifier code (GS08). If you are using Docsplitter, be sure it is a GuidelinePlus or is based on a GuidelinePlus (one that starts with PD). |
|
Example:
|
|
| SetInputFile |
When using InputByFile, this contains the full path name to the input EDI data file to be validated. When using InputByMemory, this contains a name or title for the data to be output in the Start Message (see STRT record in TIB_fsp-instream_<n.n>_usersguide.pdf). Be sure the directory already exists for the specified file. |
|
Example:
|
|
| SetInputMemory |
Location of the memory buffer for the EDI data being input to Instream. This parameter is required when SetOutputSource is OutputByMemory and is ignored otherwise. |
|
Example:
|
|
| SetInputSourceOption | InputByFile – Means the filename specified with SetInputFile is the source of the EDI data. InputByMemory – Must SetInputMemory to the memory location of the EDI data. |
|
Example:
|
|
| SetIntEnvelope and SetFGEnvelope | Defines the Interchange and Functional Group Envelopes when DocumentLevelOnly is set to true. If the EDI data contains an Interchange or Functional Group envelope, the ones in the file will be used even if SetIntEnvelope and SetFGEnvelope have been set. |
| Example:
//Set Document Level Only Parameters
|
|
| SetOutputErrorFile |
When using OutputByFile, this contains the full path name of the validation detail file to be generated. When using OutputByMemory, this contains a filename in case problems occur and Validator needs a ‘last resort’ place to put output. |
|
Example:
|
|
| SetOutputSourceOption |
OutputByFile – (default) Detail and Summary validation results should go to the file indicated by SetOutputErrorFile. The summary file will have the same name with SUMMARY in front of it. OutputByMemory – The methods DetailMessage and SummaryMessage will get called as an output line is created. Avoid OutputByMemory if you are feeding the validation output into Docsplitter or Response Generator. DetailMessage / SummaryMessage The default version of this routine sends the message to standard output. To perform something different, override these routines in the FSInStream derived object. If you wish to terminate processing from this routine, you can return false. Otherwise, true should be returned to continue processing. |
|
Example:
|
|
| SetProfileFile |
Specifies the name of the profile file to be used for the validation. Please see TIB_fsp-instream_n.n.n_APF.pdf. If the path is omitted, the Bin directory is assumed. If SetProfileFile is omitted, the validation will use the default profile $fsdeflt.apf (in Bin directory of Instream). |
|
Example:
|
|
| SetRespGenOutputOpt |
Specifies that Response Generator output goes to memory or file. It can be set to: OUTPUTBYMEMORY OUTPUTBYFILE |
|
Example:
|
|
| SetRGOptions | Response Generator options, which can include any options mentioned in TIBCO Foresight® Instream® Response Generator |
|
Example:
This example specifies that group enveloping is to be included in the response documents and that Response Generator can overwrite files if they already exist. Important: . Note: When specifying Response Generator options via the API, leave no space between the option and its value. For example, use -er3 instead of -er 3. Spaces may cause the API response generator call to fail.
|
|
|
SetRGRep824File SetRGRep997File SetRGRep277File SetRGRep999File |
Gives the name of the EDI 824, 997, 277, or 999 to be created by Response Generator. |
|
Example:
|
|
| SetRGReptextFile SetRGReptempFile |
SetRGRepTextFile gives the name of a custom text report to be created by Response Generator. SetRGRepTplFile gives the name of the template file to be used when creating the custom text report. If you use one of these, use both. |
|
Example:
|
|
| SetUserMessage |
Specifies free-form text to be inserted in a GEN record with number 15078. Example:
|
|
Example:
|