CheckEdifactPreParser
Configuration file |
None. |
Class name |
com.ebd.hub.datawizard.parser.CheckEdifactPreParser |
Description
This preparser can be used in an error handling profile (profile 2) for profiles with an EDIFACT source structure (profile 1). If the EDIFACT profile (profile 1) generates an error when reading in an EDIFACT file, the error handling profile (profile 2) is called. The preparser (in profile 2) receives the source structure and the EDIFACT file (from profile 1) and performs an error analysis. The result of the analysis is delivered by the preparser in the form of input data for the error handling profile (profile 2), where it can then react accordingly, depending on the error.
Profile 1:
Document type "EDIFACT" with EDIFACT source structure.
Enter the error handling profile (profile 2) in Profile on error.
Example profile: Profile-EDIFACT_profile.pak
Erroneous sample file (missing character (') at the end of the FTX segment): example.edi
UNB+UNOA:3+5400110000009:14+5013546107732:14+010502:1237+2722166169492+++I+0+EANCOM+1'
UNG+ORDERS+5400110000009:14+5013546107732:14+010502:1237+1+UN+D:96A:EAN008'
UNH+1+ORDERS:D:96A:UN:EAN008'
BGM+220+C1441747'
DTM+137:200105022200:203'
FTX+PUR+1++THIS IS AN EXAMPLE OF EDIFACT FILE.
NAD+BY+5400110000009::9'
NAD+SU+5013546107732::9+COMPANY ABC'
LIN+1++5400111864181:EN'
PIA+1+8641800:BP'
IMD+C++CU::9:WIDGETS'
IMD+F++:::0.7066 EURO'
MEA+PD+LAY:4+NAR:6'
MEA+PD+ULY:4+NAR:48'
QTY+21:288'
QTY+59:12'
PRI+AAA:12.80:CT:AAE'
SCC+7'
UNS+S'
UNT+21+1'
UNE+1+1'
UNZ+1+2722166169492'
Profile 2:
Must have Input Agent "Message".
Must have this preparser here set (field "Preparsing by").
The preparser gets the source structure and the input data from profile 1 and delivers an error analysis as output, which profile 2 gets as input data. Profile 2 has the EDIFACT file as backup file. Note: The structure of the error analysis can be obtained by setting the checkbox "Result of preparser overrides backup file". In the example profile here, however, a suitable source structure has already been created.
The profile allows error handling of an EDIFACT file not successfully parsed in profile 1 without profile 2 running into an error.
Example profile: Profile-EDIFACT_error_handling_profile.pak
The following is the raw error analysis for this example.
result;error
err;1;7;FTX;"Found more fields than defined in segment: FTX+PUR+1++THIS IS AN EXAMPLE OF EDIFACT FILE.NAD+BY+5400110000009::9"
...
The first line is a header. The format of the error lines:
<error record type>;<record number>;<affected line in EDIFACT file>;<affected segment>;<error message> |