EDIFACTReader Component
Properties Methods Events Config Settings Errors
The EDIFACTReader component efficiently parses complete EDIFACT transmissions, providing a convenient way to extract and explore data from all included messages.
Syntax
TedEDIFACTReader
Remarks
The component allows you to parse an incoming EDI document. To parse a document, first, use LoadSchema to load a schema file into the component. Next, select the document you want to process by setting InputFile or InputData and calling Parse.
As the component processes the document, its events will fire and the contents of the document will be available in the Interchange, FunctionalGroup, Message, Segment, Element, and Component properties. The corresponding *Index properties can be thought of as a path within the document. For example, setting the MessageIndex property will cause the SegmentCount property to be updated with the number of segments within the selected message, and then the SegmentIndex property can be used to select one of the segments within that message.
To manage the amount of memory used during processing, the BuildDOM property can be used to select how much of the message will be available in the properties at once:
- bdEntireDocument - The entire document will be available at once.
- bdInterchange - Only the current interchange and its contents will be available.
- bdMessage - Only the current message will be available.
- bdNone - Only the current segment and its elements will be available.
During parsing, the component performs basic validation of the incoming document. If an error is encountered, the ValidateWarning event will fire.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
| AckType | Specifies the type of ACK that will be generated by GenerateAck . |
| BuildDOM | Controls how much of the document will be stored during parsing. |
| Component | The current component. |
| ComponentCount | The number of components in the current Element. |
| ComponentIndex | The index of the current Component. |
| Delimiters | Contains the delimiters for the EDI Document. |
| Element | The current element. |
| ElementCount | The number of elements in the current Segment. |
| ElementIndex | The index of the current Element. |
| FunctionalGroup | The current FunctionalGroup. |
| FunctionalGroupCount | The number of FunctionalGroups in the current Interchange. |
| FunctionalGroupIndex | The index of the current FunctionalGroup. |
| Group | Specifies the group to load segments from. |
| InputData | The EDI message, specified as a string. |
| InputFile | The file containing the EDI message. |
| Interchange | The current Interchange. |
| InterchangeCount | The number of Interchanges in the document. |
| InterchangeIndex | The index of the current Interchange. |
| Message | The current message. |
| MessageCount | The number of message in the current Interchange or FunctionalGroup. |
| MessageIndex | The index of the current Message. |
| Segment | The current segment. |
| SegmentCount | The number of segments in the current Message. |
| SegmentIndex | The index of the current segment. |
| ValidateOnParse | When True , the component will validate any documents it parses. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
| Config | Sets or retrieves a configuration setting. |
| GenerateAck | Generates an ACK in response to the most recently parsed message. |
| GetElementValue | Returns the value of the element or component at the specified path. |
| LoadSchema | Loads schema information from a file or string data. |
| Parse | Parse the EDI document and fire parsing events. |
| Reset | Resets all properties to their default values. |
| SchemaCode | Defines a code value within a list of codes. |
| SchemaCodeList | Defines a list of codes. |
| SchemaComposite | Defines a composite element. |
| SchemaElement | Defines a simple element. |
| SchemaElementRef | Adds a reference to an element in a segment or composite element. |
| SchemaEnd | Ends a schema definition. |
| SchemaGroup | Defines a group of segments. |
| SchemaMessage | Defines a message. |
| SchemaSegment | Defines a segment. |
| SchemaSegmentRef | Adds a reference to a segment in a message or group. |
| SchemaStart | Starts a schema definition. |
| Validate | Validate the EDI document and warn about any errors encountered. |
Event List
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
| EndFunctionalGroup | Fires at the end of a functional group while parsing. |
| EndGroup | Fires at the end of a group while parsing a message. |
| EndInterchange | Fires at the end of an interchange while parsing. |
| EndMessage | Fires at the end of a message while parsing. |
| Error | Fires when an error occurs during message processing. Normally, the component fails with an error. |
| ResolveSchema | Fires whenever a new EDIFACT message is encountered and no schema is found for it. |
| Segment | Fires at the end of a Segment while parsing. |
| StartFunctionalGroup | Fires at the beginning of a functional group while parsing. |
| StartGroup | Fires at the beginning of a group while parsing a message. |
| StartInterchange | Fires at the beginning of an interchange while parsing. |
| StartMessage | Fires at the beginning of a message while parsing. |
| ValidateWarning | Fires to warn about validation errors. |
Config Settings
The following is a list of config settings for the component with short descriptions. Click on the links for further details.
| DelimitersFromUNA | A flag indicating if delimiters were read from UNA segment. |
| InputFormat | The format of the input document. |
| MaxValidationErrors | The maximum number of validation errors to return. |
AckType Property (EDIFACTReader Component)
Specifies the type of ACK that will be generated by GenerateAck .
Syntax
property AckType: TedTEDIFACTAckTypes read get_AckType write set_AckType;
TedTEDIFACTAckTypes = ( atFunctionalCONTRL, atTechnicalCONTRL );
Default Value
atFunctionalCONTRL
Remarks
This setting specifies the type of ACK that will be generated when GenerateAck is called. Options include:
| Functional CONTRL (atFunctionalCONTRL - 0) | A functional CONTRL message. If any syntax errors are encountered when parsing the message, the response will indicate the details of the issue. |
| Technical CONTRL (atTechnicalCONTRL - 1) | A technical CONTRL message, which confirms receipt of the message but not the results of parsing the message. |
This property is not available at design time.
BuildDOM Property (EDIFACTReader Component)
Controls how much of the document will be stored during parsing.
Syntax
property BuildDOM: TedTBuildDOMs read get_BuildDOM write set_BuildDOM;
TedTBuildDOMs = ( bdEntireDocument, bdInterchange, bdMessage, bdNone );
Default Value
bdEntireDocument
Remarks
This property controls how much of the document will be stored in an internal model during parsing:
| 0 (bdEntireDocument) | The entire document. |
| 1 (bdInterchange) | The current interchange. |
| 2 (bdMessage) | The current message. |
| 3 (bdNone) | No data will be stored and only the events can be used to process the document. |
This property is not available at design time.
Component Property (EDIFACTReader Component)
The current component.
Syntax
property Component: TedEDIElement read get_Component;
Remarks
When the current Element is a composite element, this property contains the component specified by ComponentIndex.
This property is read-only and not available at design time.
Please refer to the EDIElement type for a complete list of fields.ComponentCount Property (EDIFACTReader Component)
The number of components in the current Element.
Syntax
property ComponentCount: Integer read get_ComponentCount;
Default Value
0
Remarks
If the current Element is composite, this property contains the number of components within the element.
This property is read-only and not available at design time.
ComponentIndex Property (EDIFACTReader Component)
The index of the current Component.
Syntax
property ComponentIndex: Integer read get_ComponentIndex write set_ComponentIndex;
Default Value
1
Remarks
If the current Element is composite, this property is used to specify a Component within the element.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, MessageIndex, SegmentIndex, ElementIndex and ComponentIndex to navigate to a specific Component within the parsed document.
This property is not available at design time.
Delimiters Property (EDIFACTReader Component)
Contains the delimiters for the EDI Document.
Syntax
property Delimiters: TedEDIFACTDelimiters read get_Delimiters;
Remarks
This property contains the delimiters that will be used when parsing the EDIFACT document. If the document uses delimiters other than the default, change the properties of this object to parse the document correctly.
This property is read-only and not available at design time.
Please refer to the EDIFACTDelimiters type for a complete list of fields.Element Property (EDIFACTReader Component)
The current element.
Syntax
property Element: TedEDIElement read get_Element;
Remarks
This property contains the element within the current Segment specified by ElementIndex.
This property is read-only and not available at design time.
Please refer to the EDIElement type for a complete list of fields.ElementCount Property (EDIFACTReader Component)
The number of elements in the current Segment.
Syntax
property ElementCount: Integer read get_ElementCount;
Default Value
0
Remarks
This property contains the number of elements in the current Segment.
This property is read-only and not available at design time.
ElementIndex Property (EDIFACTReader Component)
The index of the current Element.
Syntax
property ElementIndex: Integer read get_ElementIndex write set_ElementIndex;
Default Value
1
Remarks
This property is used to specify an Element within the current Segment.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, MessageIndex, SegmentIndex and ElementIndex to navigate to specific Element within the parsed document.
This property is not available at design time.
FunctionalGroup Property (EDIFACTReader Component)
The current FunctionalGroup.
Syntax
property FunctionalGroup: TedEDIFACTFunctionalGroup read get_FunctionalGroup;
Remarks
This property contains the current FunctionalGroup within the Interchange This property is read-only and not available at design time. Please refer to the FunctionalGroup type for a complete list of fields.
This property is read-only and not available at design time.
Please refer to the EDIFACTFunctionalGroup type for a complete list of fields.FunctionalGroupCount Property (EDIFACTReader Component)
The number of FunctionalGroups in the current Interchange.
Syntax
property FunctionalGroupCount: Integer read get_FunctionalGroupCount;
Default Value
0
Remarks
This property contains the number of FunctionalGroups in the current Interchange.
This property is read-only and not available at design time.
FunctionalGroupIndex Property (EDIFACTReader Component)
The index of the current FunctionalGroup.
Syntax
property FunctionalGroupIndex: Integer read get_FunctionalGroupIndex write set_FunctionalGroupIndex;
Default Value
1
Remarks
This property is used to specify a FunctionalGroup within the current Interchange.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory, including all interchanges, and functional groups. You can then use InterchangeIndex and FunctionalGroupIndex to navigate to a specific FunctionalGroup within the parsed document.
This property is not available at design time.
Group Property (EDIFACTReader Component)
Specifies the group to load segments from.
Syntax
property Group: String read get_Group write set_Group;
Default Value
''
Remarks
When this property is set, only segments from the specified group and iteration will be available through the Segment properties.
A path for a group consists of the name of the group followed by an index indicating the iteration, like this:
reader.Group = "CPSGroup[2]";
If the group is nested inside of another group, the parent and child are connected by a ".":
reader.Group = "CPSGroup[2].LINGroup[2]";
That can be repeated if a group is nested more than one level deep.
This property is not available at design time.
InputData Property (EDIFACTReader Component)
The EDI message, specified as a string.
Syntax
property InputData: String read get_InputData write set_InputData;
Default Value
''
Remarks
Set this property to specify the input EDI message as a string. The message can then be parsed with Parse.
This property is not available at design time.
InputFile Property (EDIFACTReader Component)
The file containing the EDI message.
Syntax
property InputFile: String read get_InputFile write set_InputFile;
Default Value
''
Remarks
Set this property to specify a file to read the input EDI message from. The message can then be parsed with Parse.
This property is not available at design time.
Interchange Property (EDIFACTReader Component)
The current Interchange.
Syntax
property Interchange: TedEDIFACTInterchange read get_Interchange;
Remarks
This property contains the current Interchange within the document specified by InterchangeIndex.
This property is read-only and not available at design time.
Please refer to the EDIFACTInterchange type for a complete list of fields.InterchangeCount Property (EDIFACTReader Component)
The number of Interchanges in the document.
Syntax
property InterchangeCount: Integer read get_InterchangeCount;
Default Value
0
Remarks
This property contains the number of Interchanges in the current document.
This property is read-only and not available at design time.
InterchangeIndex Property (EDIFACTReader Component)
The index of the current Interchange.
Syntax
property InterchangeIndex: Integer read get_InterchangeIndex write set_InterchangeIndex;
Default Value
1
Remarks
This property is used to specify an Interchange within the document.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory, including all interchanges. You can then use InterchangeIndex to navigate to specific Interchange within the parsed document.
This property is not available at design time.
Message Property (EDIFACTReader Component)
The current message.
Syntax
property Message: TedEDIFACTMessage read get_Message;
Remarks
This property contains the message within the current Interchange or FunctionalGroup specified by MessageIndex.
This property is read-only and not available at design time.
Please refer to the EDIFACTMessage type for a complete list of fields.MessageCount Property (EDIFACTReader Component)
The number of message in the current Interchange or FunctionalGroup.
Syntax
property MessageCount: Integer read get_MessageCount;
Default Value
0
Remarks
This property contains the number of messages in the current Interchange or FunctionalGroup.
This property is read-only and not available at design time.
MessageIndex Property (EDIFACTReader Component)
The index of the current Message.
Syntax
property MessageIndex: Integer read get_MessageIndex write set_MessageIndex;
Default Value
1
Remarks
This property is used to specify a Message within the current Interchange or FunctionalGroup.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory, including all interchanges, functional groups, and messages. You can then use InterchangeIndex, FunctionalGroupIndex and MessageIndex to navigate to a specific Message within the parsed document.
This property is not available at design time.
Segment Property (EDIFACTReader Component)
The current segment.
Syntax
property Segment: TedEDISegment read get_Segment;
Remarks
This property contains the segment within the current Message specified by SegmentIndex.
This property is read-only and not available at design time.
Please refer to the EDISegment type for a complete list of fields.SegmentCount Property (EDIFACTReader Component)
The number of segments in the current Message.
Syntax
property SegmentCount: Integer read get_SegmentCount;
Default Value
0
Remarks
This property contains the number of elements in the current Message.
This property is read-only and not available at design time.
SegmentIndex Property (EDIFACTReader Component)
The index of the current segment.
Syntax
property SegmentIndex: Integer read get_SegmentIndex write set_SegmentIndex;
Default Value
1
Remarks
This property is used to specify a Segment within the current Message.
Note: When BuildDOM is set to bdentiredoc, after Parse is called the entire EDI document is parsed and stored in memory. You can then use InterchangeIndex, FunctionalGroupIndex, MessageIndex and SegmentIndex to navigate to specific Segment within the parsed document.
This property is not available at design time.
ValidateOnParse Property (EDIFACTReader Component)
When True , the component will validate any documents it parses.
Syntax
property ValidateOnParse: Boolean read get_ValidateOnParse write set_ValidateOnParse;
Default Value
false
Remarks
When this property is set to True, the component will perform validation on the document when Parse is called. The ValidateWarning event will fire for each error it encounters.
This property is not available at design time.
Config Method (EDIFACTReader Component)
Sets or retrieves a configuration setting.
Syntax
function Config(ConfigurationString: String): String;
Remarks
Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
GenerateAck Method (EDIFACTReader Component)
Generates an ACK in response to the most recently parsed message.
Syntax
function GenerateAck(): String;
Remarks
After parsing a message, call this method to generate an ACK that you can send back in response. The type of ACK generated can be controlled by setting the AckType property.
GetElementValue Method (EDIFACTReader Component)
Returns the value of the element or component at the specified path.
Syntax
function GetElementValue(Path: String): String;
Remarks
This method returns the value of the element at the specified path. The path starts at the current Message and consists of groups (with indexes to indicate the iteration), a segment tag, and 1-2 indexes to indicate the element or component.
For a simple element the path should include the path to a specific iteration of a group (as in the Group property), followed by a segment tag and an index for the element position within the segment, each separated by a ".":
reader.GetElementValue("CPSGroup[2].LINGroup[2].LIN.1");
When selecting a component of a composite element, the component index should be added after the element index:
reader.GetElementValue("CPSGroup[2].LINGroup[2].QTY.1.2");
LoadSchema Method (EDIFACTReader Component)
Loads schema information from a file or string data.
Syntax
procedure LoadSchema(fileOrData: String; messageName: String);
Remarks
This method loads schema information for use when parsing, validating, and translating messages.
The FileOrData parameter can be set to the path of a file containing schema data, or can be set to the contents of a schema file directly.
MessageName can be set to the name of a specific message to load only the specified message's schema information. If left empty or set to "*", the entire schema will be loaded.
Parse Method (EDIFACTReader Component)
Parse the EDI document and fire parsing events.
Syntax
procedure Parse();
Remarks
This method parses the input EDI document, firing the following events as it parses:
- StartInterchange
- StartFunctionalGroup
- ResolveSchema
- StartMessage
- StartGroup
- Segment
- EndGroup
- EndMessage
- EndFunctionalGroup
- EndInterchange
When multiple input sources are specified, only the highest-priority input will be used, in the following order:
Reset Method (EDIFACTReader Component)
Resets all properties to their default values.
Syntax
procedure Reset();
Remarks
This method resets all properties of the component to their default values as specified in the property definitions.
SchemaCode Method (EDIFACTReader Component)
Defines a code value within a list of codes.
Syntax
procedure SchemaCode(SchemaId: String; CodeListId: String; Value: String; Description: String);
Remarks
Creates a schema definition for a code value within a particular list of codes.
This method can be used when defining a schema instead of loading one from a file.
SchemaCodeList Method (EDIFACTReader Component)
Defines a list of codes.
Syntax
procedure SchemaCodeList(SchemaId: String; CodeListId: String; Description: String);
Remarks
Creates a schema definition for an empty list of codes. SchemaCode can be used to add code values to the list.
This method can be used when defining a schema instead of loading one from a file.
SchemaComposite Method (EDIFACTReader Component)
Defines a composite element.
Syntax
procedure SchemaComposite(SchemaId: String; CompositeId: String; Description: String);
Remarks
Creates a schema definition for a composite element. SchemaElementRef can be used to add components to the element.
This method can be used when defining a schema instead of loading one from a file.
SchemaElement Method (EDIFACTReader Component)
Defines a simple element.
Syntax
procedure SchemaElement(SchemaId: String; ElementId: String; DataType: String; MinLength: Integer; MaxLength: Integer; CodeId: String; Description: String);
Remarks
Creates a schema definition for a simple element.
This method can be used when defining a schema instead of loading one from a file.
SchemaElementRef Method (EDIFACTReader Component)
Adds a reference to an element in a segment or composite element.
Syntax
procedure SchemaElementRef(SchemaId: String; ParentId: String; ElementId: String; RefId: String; Required: Boolean; MaxCount: Integer);
Remarks
Adds a reference to an element to the specified parent, which can be the most recently defined segment or composite element.
This method can be used when defining a schema instead of loading one from a file.
SchemaEnd Method (EDIFACTReader Component)
Ends a schema definition.
Syntax
procedure SchemaEnd();
Remarks
Ends a schema definition when a schema is being defined manually instead of loaded from a file.
SchemaGroup Method (EDIFACTReader Component)
Defines a group of segments.
Syntax
procedure SchemaGroup(SchemaId: String; GroupPath: String; GroupId: String; Required: Boolean; MaxCount: Integer);
Remarks
Creates a schema definition for a group of segments. SchemaSegmentRef can be used to add references to defined segments.
This method can be used when defining a schema instead of loading one from a file.
SchemaMessage Method (EDIFACTReader Component)
Defines a message.
Syntax
procedure SchemaMessage(SchemaId: String; MessageId: String; Description: String);
Remarks
Creates a schema definition for a message. SchemaSegmentRef and SchemaGroup can be used to add segment references and groups to the message.
This method can be used when defining a schema instead of loading one from a file.
SchemaSegment Method (EDIFACTReader Component)
Defines a segment.
Syntax
procedure SchemaSegment(SchemaId: String; SegmentId: String; Description: String);
Remarks
Creates a schema definition for a segment. SchemaElementRef can be used to add component references to the segment.
This method can be used when defining a schema instead of loading one from a file.
SchemaSegmentRef Method (EDIFACTReader Component)
Adds a reference to a segment in a message or group.
Syntax
procedure SchemaSegmentRef(SchemaId: String; SegmentPath: String; SegmentId: String; Required: Boolean; MaxCount: Integer);
Remarks
Adds a reference to a segment to the specified path.
This method can be used when defining a schema instead of loading one from a file.
SchemaStart Method (EDIFACTReader Component)
Starts a schema definition.
Syntax
procedure SchemaStart(SchemaId: String);
Remarks
Starts manually defining a schema, as an alternative to loading one from a file.
Validate Method (EDIFACTReader Component)
Validate the EDI document and warn about any errors encountered.
Syntax
procedure Validate();
Remarks
This method parses the input EDI document, firing the ValidateWarning event for any non-blocking errors it encounters.
EndFunctionalGroup Event (EDIFACTReader Component)
Fires at the end of a functional group while parsing.
Syntax
type TEndFunctionalGroupEvent = procedure ( Sender: TObject; const Tag: String; MessageCount: Integer; const ReferenceNumber: String ) of Object;
property OnEndFunctionalGroup: TEndFunctionalGroupEvent read FOnEndFunctionalGroup write FOnEndFunctionalGroup;
Remarks
This event fires when the component encounters the end of a functional group while parsing a document.
EndGroup Event (EDIFACTReader Component)
Fires at the end of a group while parsing a message.
Syntax
type TEndGroupEvent = procedure ( Sender: TObject; const Name: String; SchemaIndex: Integer ) of Object;
property OnEndGroup: TEndGroupEvent read FOnEndGroup write FOnEndGroup;
Remarks
This event fires when the component encounters the end of a group while parsing a message.
EndInterchange Event (EDIFACTReader Component)
Fires at the end of an interchange while parsing.
Syntax
type TEndInterchangeEvent = procedure ( Sender: TObject; const Tag: String; GroupCount: Integer; const ReferenceNumber: String ) of Object;
property OnEndInterchange: TEndInterchangeEvent read FOnEndInterchange write FOnEndInterchange;
Remarks
This event fires at the end of an interchange while parsing a document.
EndMessage Event (EDIFACTReader Component)
Fires at the end of a message while parsing.
Syntax
type TEndMessageEvent = procedure ( Sender: TObject; const Tag: String; SegmentCount: Integer; const ReferenceNumber: String ) of Object;
property OnEndMessage: TEndMessageEvent read FOnEndMessage write FOnEndMessage;
Remarks
This event fires when the component encounters the end of a message while parsing a document.
Error Event (EDIFACTReader Component)
Fires when an error occurs during message processing. Normally, the component fails with an error.
Syntax
type TErrorEvent = procedure ( Sender: TObject; ErrorCode: Integer; const Description: String ) of Object;
property OnError: TErrorEvent read FOnError write FOnError;
Remarks
The Error event is fired in case of exceptional conditions during message processing. Normally, the component raises an exception.
ConnectionId is the associated client Id, ErrorCode contains an error code, and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.
ResolveSchema Event (EDIFACTReader Component)
Fires whenever a new EDIFACT message is encountered and no schema is found for it.
Syntax
type TResolveSchemaEvent = procedure ( Sender: TObject; const MessageVersion: String; const MessageType: String ) of Object;
property OnResolveSchema: TResolveSchemaEvent read FOnResolveSchema write FOnResolveSchema;
Remarks
This method fires when the component encounters an EDIFACT message it has not loaded a schema for. The parameters of the event can be used to locate the correct schema and load it with LoadSchema.
MessageVersion - The EDIFACT version of the message, such as D97A.
MessageType - The type of message, such as INVOIC.
After the event fires, if the component still doesn't have a matching schema, then it will attempt schema-less parsing of the EDIFACT message.
Segment Event (EDIFACTReader Component)
Fires at the end of a Segment while parsing.
Syntax
type TSegmentEvent = procedure ( Sender: TObject; const Tag: String; const SchemaPath: String; Optional: Boolean; ElementCount: Integer; SchemaIndex: Integer; SegmentIndex: Integer; MaxCount: Integer; const Path: String ) of Object;
property OnSegment: TSegmentEvent read FOnSegment write FOnSegment;
Remarks
Fires at the end of a Segment while parsing a document
StartFunctionalGroup Event (EDIFACTReader Component)
Fires at the beginning of a functional group while parsing.
Syntax
type TStartFunctionalGroupEvent = procedure ( Sender: TObject; const Tag: String; const AppSenderIdentification: String; const AppRecipientIdentification: String; const DateTime: String; const ReferenceNumber: String ) of Object;
property OnStartFunctionalGroup: TStartFunctionalGroupEvent read FOnStartFunctionalGroup write FOnStartFunctionalGroup;
Remarks
This event fires when the component encounters the start of a functional group while parsing a document.
StartGroup Event (EDIFACTReader Component)
Fires at the beginning of a group while parsing a message.
Syntax
type TStartGroupEvent = procedure ( Sender: TObject; const Name: String; SchemaIndex: Integer; MaxCount: Integer; const Path: String ) of Object;
property OnStartGroup: TStartGroupEvent read FOnStartGroup write FOnStartGroup;
Remarks
This event fires when the component encounters the start of a group while parsing a message.
StartInterchange Event (EDIFACTReader Component)
Fires at the beginning of an interchange while parsing.
Syntax
type TStartInterchangeEvent = procedure ( Sender: TObject; const Tag: String; const SyntaxIdentifier: String; const SyntaxVersion: String; const SenderIdentification: String; const RecipientIdentification: String; const DateTime: String; const ReferenceNumber: String ) of Object;
property OnStartInterchange: TStartInterchangeEvent read FOnStartInterchange write FOnStartInterchange;
Remarks
This event fires at the beginning of an interchange while parsing a document.
StartMessage Event (EDIFACTReader Component)
Fires at the beginning of a message while parsing.
Syntax
type TStartMessageEvent = procedure ( Sender: TObject; const Tag: String; const MessageRelease: String; const MessageType: String; const ReferenceNumber: String; SchemaLoaded: Boolean ) of Object;
property OnStartMessage: TStartMessageEvent read FOnStartMessage write FOnStartMessage;
Remarks
This event fires when the component encounters the start of a message while parsing a document.
ValidateWarning Event (EDIFACTReader Component)
Fires to warn about validation errors.
Syntax
type TValidateWarningEvent = procedure ( Sender: TObject; Position: Int64; Line: Integer; Column: Integer; const ErrorCode: String; const ErrorMessage: String; ErrorType: Integer ) of Object;
property OnValidateWarning: TValidateWarningEvent read FOnValidateWarning write FOnValidateWarning;
Remarks
When the component encounters a non-blocking error while validating a document, this event fires with information about the error.
EDIElement Type
An element of an EDI document.
Remarks
This represents an element appearing in an EDI document.
Fields
DataType
String (read-only)
Default Value: ""
The type of data contained in the element.
Possible values for EDIFACT include:
| A | The element can only contain alphabetic characters. |
| AN | The element can contain any alphanumeric characters. |
| N | The element can only contain numeric characters. |
| composite | The element is a composite element containing multiple components. |
Possible values for X12 include:
| AN | The element can contain any alphanumeric characters. |
| ID | The element contains an identifier for a code value. |
| Nn | The element contains a numeric integer value. |
| R | The element contains a number with an optional decimal value. |
| DT | The element contains a string representing a date. |
| TM | The element contains a string representing a time. |
| B | The element contains binary data. |
| composite | The element is a composite element containing multiple components. |
IsComposite
Boolean (read-only)
Default Value: False
Specifies whether the element is a simple or composite element. If True, the element is a composite element that contains other components.
MaxLen
Integer (read-only)
Default Value: 0
For a simple element, this specifies the maximum length of the element according to the schema.
MinLen
Integer (read-only)
Default Value: 0
For a simple element, this specifies the minimum length of the element according to the schema.
SchemaDesc
String (read-only)
Default Value: ""
The description of the element as specified in the schema.
SchemaName
String (read-only)
Default Value: ""
The name of the element as specified in the schema.
Value
String (read-only)
Default Value: ""
If the element is a simple element, this field contains its value.
Constructors
constructor Create();
EDIFACTDelimiters Type
The delimiters used in the EDIFACT document.
Remarks
This type contains fields specifying the various delimiters used within the EDIFACT document.
Fields
Component
String
Default Value: ":"
The character used to separate the components in a composite element.
Decimal
String
Default Value: "."
The character used to separate the integer portion of a numeric value from the fractional portion.
Element
String
Default Value: "+"
The delimiter used to separate elements within a segment.
Release
String
Default Value: "?"
The character used to escape other characters within a field. For example, with the default EDIFACT delimiters, "?+" should be considered "+" character that appears within a field, not an element separator.
Repetition
String
Default Value: "*(syntax 4) or empty(syntax 3)"
The character used to indicate a repeating element or component.
Segment
String
Default Value: "'"
The character used to terminate a segment.
Constructors
constructor Create();
EDIFACTFunctionalGroup Type
A functional group of messages.
Remarks
This type represents a functional group of messages, with fields describing the values from the UNG segment.
- AppPassword
- AppRecipientIdentification
- AppRecipientIDQualifier
- AppSenderIdentification
- AppSenderIDQualifier
- AssociationAssignedCode
- ControllingAgency
- Date
- GroupIdentification
- MessageRelease
- MessageVersion
- ReferenceNumber
- Time
Fields
AppPassword
String
Default Value: ""
The application password as specified in the functional group header.
This is an alphanumeric field with a value up to 14 characters long.
AppRecipientIdentification
String
Default Value: ""
The name or code of the intended recipient of the message group.
This is an alphanumeric field with a value up to 35 characters long.
AppRecipientIDQualifier
String
Default Value: ""
The qualifier for the recipient's identification (if it contains a code value).
This is an alphanumeric field with a value up to 4 characters long.
AppSenderIdentification
String
Default Value: ""
The name or code of the message group's sender.
This is an alphanumeric field with a value up to 35 characters long.
AppSenderIDQualifier
String
Default Value: ""
The qualifier for the sender's identification (if it contains a code value).
This is an alphanumeric field with a value up to 4 characters long.
AssociationAssignedCode
String
Default Value: ""
The assigned code for the message type.
This is an alphanumeric field with a value up to 6 characters long.
ControllingAgency
String
Default Value: ""
A code value that indicates the agency responsible for maintaining the message specifications.
This is an alphanumeric field with a value up to 3 characters long.
Date
String
Default Value: ""
The date that the group of messages was prepared.
GroupIdentification
String
Default Value: ""
The identification value for the functional group.
This is an alphanumeric field with a value up to 6 characters long.
MessageRelease
String
Default Value: ""
The message release number for the message type appearing in the message group.
This is an alphanumeric field with a value up to 3 characters long.
MessageVersion
String
Default Value: ""
The message version number for message type appearing in the functional group.
This is an alphanumeric field with a value up to 3 characters long.
ReferenceNumber
String
Default Value: ""
The reference number for the functional group.
This is an alphanumeric field with a value up to 14 characters long.
Time
String
Default Value: ""
The time that the group of messages was prepared.
Constructors
constructor Create();
EDIFACTInterchange Type
An interchange containing functional groups and messages.
Remarks
This type represents an EDIFACT interchange, with fields describing the values from the UNB segment.
- AckRequest
- AgreementIdentifier
- ApplicationReference
- CharacterEncoding
- CodeListVersionNumber
- Date
- ProcessingPriorityCode
- RecipientIdentification
- RecipientIDQualifier
- RecipientInternalIdentification
- RecipientInternalSubIdentification
- RecipientPassword
- RecipientPasswordQualifier
- ReferenceNumber
- SenderIdentification
- SenderIDQualifier
- SenderInternalIdentification
- SenderInternalSubIdentification
- SyntaxIdentifier
- SyntaxVersionNumber
- TestIndicator
- Time
Fields
AckRequest
String
Default Value: ""
If this field is '1', an ACK was requested in response to this interchange.
AgreementIdentifier
String
Default Value: ""
The identifier for the communication agreement used by the interchange.
This is an alphanumeric field with a value up to 35 characters long.
ApplicationReference
String
Default Value: ""
If the interchange contains only one type of message, this can contain the identifier for the type of message.
This is an alphanumeric field with a value up to 14 characters long.
CharacterEncoding
String
Default Value: ""
The character encoding used by the interchange.
This is an alphanumeric field with a value up to 3 characters long, and is only present for EDIFACT syntax 4.
CodeListVersionNumber
String
Default Value: ""
The identifier for the communication agreement used by the interchange.
This is an alphanumeric field with a value up to 6 characters long.
Date
String
Default Value: ""
The date that the interchange was prepared.
ProcessingPriorityCode
String
Default Value: ""
A 1-character code that requests a specific processing priority for the interchange.
RecipientIdentification
String
Default Value: ""
The identification for the interchange's recipient.
This is an alphanumeric field with a value up to 35 characters long.
RecipientIDQualifier
String
Default Value: ""
The qualifier for the recipient identification code.
This is an alphanumeric field with a value up to 4 characters long.
RecipientInternalIdentification
String
Default Value: ""
More specific recipient identification for internal use.
This is an alphanumeric field with a value up to 35 characters long.
RecipientInternalSubIdentification
String
Default Value: ""
A sub-identification string for the receiver for internal use.
This is an alphanumeric field with a value up to 35 characters long.
RecipientPassword
String
Default Value: ""
A password to be verified by the recipient, such as a system or network password.
This is an alphanumeric field with a value up to 14 characters long.
RecipientPasswordQualifier
String
Default Value: ""
A qualifier for the recipient password.
This is an alphanumeric field with a value up to 2 characters long.
ReferenceNumber
String
Default Value: ""
A reference number for the interchange.
This is an alphanumeric field with a value up to 14 characters long.
SenderIdentification
String
Default Value: ""
The identification for the interchange's sender.
This is an alphanumeric field with a value up to 35 characters long.
SenderIDQualifier
String
Default Value: ""
The qualifier for the sender identification code.
This is an alphanumeric field with a value up to 4 characters long.
SenderInternalIdentification
String
Default Value: ""
More specific sender identification for internal use.
This is an alphanumeric field with a value up to 35 characters long.
SenderInternalSubIdentification
String
Default Value: ""
A sub-identification string for the sender for internal use.
This is an alphanumeric field with a value up to 35 characters long.
SyntaxIdentifier
String
Default Value: ""
A identifier specifying the controlling agency and valid character set.
This is an alphanumeric field with a value up to 4 characters long.
SyntaxVersionNumber
String
Default Value: ""
A 1-character numeric value indicating the syntax version.
TestIndicator
String
Default Value: ""
If this field is '1', the interchange is a test interchange.
Time
String
Default Value: ""
The time that the interchange was prepared.
Constructors
constructor Create();
EDIFACTMessage Type
An EDIFACT message.
Remarks
This type represents an EDIFACT message, with fields describing the values from the UNH segment.
- AssociationAssignedCode
- CodeListVersionNumber
- CommonAccessReference
- ControllingAgency
- FirstAndLastTransfer
- MessageImplControllingAgency
- MessageImplIdentification
- MessageImplRelease
- MessageImplVersion
- MessageRelease
- MessageSubsetControllingAgency
- MessageSubsetIdentification
- MessageSubsetRelease
- MessageSubsetVersion
- MessageType
- MessageTypeSubFunctionIdentification
- MessageVersion
- ReferenceNumber
- ScenarioControllingAgency
- ScenarioIdentification
- ScenarioRelease
- ScenarioVersion
- SequenceOfTransfers
Fields
AssociationAssignedCode
String
Default Value: ""
A code assigned to the message by the controlling organization.
This is an alphanumeric field with a value up to 6 characters long.
CodeListVersionNumber
String
Default Value: ""
The version number of the code list that should be used.
This is an alphanumeric field with a value up to 6 characters long. This field only appears in EDIFACT syntax version 4.
CommonAccessReference
String
Default Value: ""
A reference value to associate this message with related messages.
This is an alphanumeric field with a value up to 35 characters long.
ControllingAgency
String
Default Value: ""
A code that identifies the controlling agency for this message type.
This is an alphanumeric field with a value up to 3 characters long.
FirstAndLastTransfer
String
Default Value: ""
A single-character field that indicates the first and last messages in a related set.
MessageImplControllingAgency
String
Default Value: ""
A code value that identifies the controlling agency for the message implementation.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
MessageImplIdentification
String
Default Value: ""
Identifies the message implementation.
This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.
MessageImplRelease
String
Default Value: ""
Identifies the release number for the message implementation.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
MessageImplVersion
String
Default Value: ""
Identifies the version number for the message implementation.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
MessageRelease
String
Default Value: ""
Identifies the release number for the message.
This is an alphanumeric field with a value up to 3 characters long.
MessageSubsetControllingAgency
String
Default Value: ""
A code value that identifies the controlling agency for the message subset.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
MessageSubsetIdentification
String
Default Value: ""
Identifies the message subset.
This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.
MessageSubsetRelease
String
Default Value: ""
Identifies the release number for the message subset.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
MessageSubsetVersion
String
Default Value: ""
Identifies the version number for the message subset.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
MessageType
String
Default Value: ""
A code identifying the message's type.
This is an alphanumeric field with a value up to 6 characters long.
MessageTypeSubFunctionIdentification
String
Default Value: ""
A code identifying the sub-function of the message's type.
This is an alphanumeric field with a value up to 6 characters long. This field only appears in EDIFACT syntax version 4.
MessageVersion
String
Default Value: ""
Identifies the version number for the message.
This is an alphanumeric field with a value up to 3 characters long.
ReferenceNumber
String
Default Value: ""
A unique reference number for the message.
This is an alphanumeric field with a value up to 14 characters long.
ScenarioControllingAgency
String
Default Value: ""
Identifies the controlling agency for the message scenario.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
ScenarioIdentification
String
Default Value: ""
The identifier for the message scenario.
This is an alphanumeric field with a value up to 14 characters long. This field only appears in EDIFACT syntax version 4.
ScenarioRelease
String
Default Value: ""
The message scenario's release number.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
ScenarioVersion
String
Default Value: ""
The message scenario's version number.
This is an alphanumeric field with a value up to 3 characters long. This field only appears in EDIFACT syntax version 4.
SequenceOfTransfers
String
Default Value: ""
Specifies the message's position in a sequence.
This is an alphanumeric field with a value up to 2 characters long.
Constructors
constructor Create();
EDISegment Type
A segment of an EDI document.
Remarks
This represents a segment appearing in an EDI document.
Fields
Optional
Boolean (read-only)
Default Value: False
Specifies whether the segment is required or optional. If True, the element is optional.
Path
String (read-only)
Default Value: ""
Contains the path to the segment, including the groups that the segment is contained in.
SchemaPath
String (read-only)
Default Value: ""
Contains a numeric representation of the path to the segment, using the indexes within the schema, such as \4[3]\5[6]\7[8].
Tag
String (read-only)
Default Value: ""
The tag of the segment, such as BGM, DTM, FTX, etc.
Constructors
constructor Create();
Config Settings (EDIFACTReader Component)
The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.EDIFACTReader Config Settings
| 0 (default) | EDIFACT |
| 1 | XML |
Trappable Errors (EDIFACTReader Component)
EDIFACTReader Errors
| 202 | Invalid argument. |
| 304 | Cannot write to file. |
| 1003 | Could not find the selected schema in the chosen file. |
| 1099 | Encountered an unexpected segment tag. |
| 1100 | Attempted to perform an action while the component was busy, or close an incomplete interchange. |
| 1044 | Tried to load an invalid schema file. |
| 1201 | The index is out of range. |
| 1202 | The selected ACK type is invalid. |
| 1203 | Encountered an error while validating the UNA segment. |