EDIFACTReader Module
Properties Methods Events Config Settings Errors
The EDIFACTReader module efficiently parses complete EDIFACT transmissions, providing a convenient way to extract and explore data from all included messages.
Syntax
EDISDK.EDIFACTReader
Remarks
The class allows you to parse an incoming EDI document. To parse a document, first, use LoadSchema to load a schema file into the class. Next, select the document you want to process by setting InputFile or InputData and calling Parse.
As the class 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 class 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 module 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 module. |
| ComponentCount | The number of modules in the current Element. |
| ComponentIndex | The index of the current Module. |
| 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 module will validate any documents it parses. |
Method List
The following is the full list of the methods of the module 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 module 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 module 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 module 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 module 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 Module)
Specifies the type of ACK that will be generated by GenerateAck .
Syntax
public var ackType: EDIFACTReaderAckTypes { get {...} set {...} }
public enum EDIFACTReaderAckTypes: Int32 { case atFunctionalCONTRL = 0 case atTechnicalCONTRL = 1 }
@property (nonatomic,readwrite,assign,getter=ackType,setter=setAckType:) int ackType; - (int)ackType; - (void)setAckType :(int)newAckType;
Default Value
0
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. |
BuildDOM Property (EDIFACTReader Module)
Controls how much of the document will be stored during parsing.
Syntax
public var buildDOM: EDIFACTReaderBuildDOMs { get {...} set {...} }
public enum EDIFACTReaderBuildDOMs: Int32 { case bdEntireDocument = 0 case bdInterchange = 1 case bdMessage = 2 case bdNone = 3 }
@property (nonatomic,readwrite,assign,getter=buildDOM,setter=setBuildDOM:) int buildDOM; - (int)buildDOM; - (void)setBuildDOM :(int)newBuildDOM;
Default Value
0
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. |
Component Property (EDIFACTReader Module)
The current module.
Syntax
public var component: EDIElement { get {...} }
@property (nonatomic,readonly,assign,getter=componentDataType) NSString* componentDataType; - (NSString*)componentDataType; @property (nonatomic,readonly,assign,getter=componentIsComposite) BOOL componentIsComposite; - (BOOL)componentIsComposite; @property (nonatomic,readonly,assign,getter=componentMaxLen) int componentMaxLen; - (int)componentMaxLen; @property (nonatomic,readonly,assign,getter=componentMinLen) int componentMinLen; - (int)componentMinLen; @property (nonatomic,readonly,assign,getter=componentSchemaDesc) NSString* componentSchemaDesc; - (NSString*)componentSchemaDesc; @property (nonatomic,readonly,assign,getter=componentSchemaName) NSString* componentSchemaName; - (NSString*)componentSchemaName; @property (nonatomic,readonly,assign,getter=componentValue) NSString* componentValue; - (NSString*)componentValue;
Default Value
False
Remarks
When the current Element is a composite element, this property contains the component specified by ComponentIndex.
ComponentCount Property (EDIFACTReader Module)
The number of modules in the current Element.
Syntax
public var componentCount: Int32 { get {...} }
@property (nonatomic,readonly,assign,getter=componentCount) int componentCount; - (int)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.
ComponentIndex Property (EDIFACTReader Module)
The index of the current Module.
Syntax
public var componentIndex: Int32 { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=componentIndex,setter=setComponentIndex:) int componentIndex; - (int)componentIndex; - (void)setComponentIndex :(int)newComponentIndex;
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.
Delimiters Property (EDIFACTReader Module)
Contains the delimiters for the EDI Document.
Syntax
public var delimiters: EDIFACTDelimiters { get {...} }
@property (nonatomic,readwrite,assign,getter=delimiterComponent,setter=setDelimiterComponent:) NSString* delimiterComponent; - (NSString*)delimiterComponent; - (void)setDelimiterComponent :(NSString*)newDelimiterComponent; @property (nonatomic,readwrite,assign,getter=delimiterDecimal,setter=setDelimiterDecimal:) NSString* delimiterDecimal; - (NSString*)delimiterDecimal; - (void)setDelimiterDecimal :(NSString*)newDelimiterDecimal; @property (nonatomic,readwrite,assign,getter=delimiterElement,setter=setDelimiterElement:) NSString* delimiterElement; - (NSString*)delimiterElement; - (void)setDelimiterElement :(NSString*)newDelimiterElement; @property (nonatomic,readwrite,assign,getter=delimiterRelease,setter=setDelimiterRelease:) NSString* delimiterRelease; - (NSString*)delimiterRelease; - (void)setDelimiterRelease :(NSString*)newDelimiterRelease; @property (nonatomic,readwrite,assign,getter=delimiterRepetition,setter=setDelimiterRepetition:) NSString* delimiterRepetition; - (NSString*)delimiterRepetition; - (void)setDelimiterRepetition :(NSString*)newDelimiterRepetition; @property (nonatomic,readwrite,assign,getter=delimiterSegment,setter=setDelimiterSegment:) NSString* delimiterSegment; - (NSString*)delimiterSegment; - (void)setDelimiterSegment :(NSString*)newDelimiterSegment;
Default Value
False
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.
Element Property (EDIFACTReader Module)
The current element.
Syntax
public var element: EDIElement { get {...} }
@property (nonatomic,readonly,assign,getter=elementDataType) NSString* elementDataType; - (NSString*)elementDataType; @property (nonatomic,readonly,assign,getter=elementIsComposite) BOOL elementIsComposite; - (BOOL)elementIsComposite; @property (nonatomic,readonly,assign,getter=elementMaxLen) int elementMaxLen; - (int)elementMaxLen; @property (nonatomic,readonly,assign,getter=elementMinLen) int elementMinLen; - (int)elementMinLen; @property (nonatomic,readonly,assign,getter=elementSchemaDesc) NSString* elementSchemaDesc; - (NSString*)elementSchemaDesc; @property (nonatomic,readonly,assign,getter=elementSchemaName) NSString* elementSchemaName; - (NSString*)elementSchemaName; @property (nonatomic,readonly,assign,getter=elementValue) NSString* elementValue; - (NSString*)elementValue;
Default Value
False
Remarks
This property contains the element within the current Segment specified by ElementIndex.
ElementCount Property (EDIFACTReader Module)
The number of elements in the current Segment.
Syntax
public var elementCount: Int32 { get {...} }
@property (nonatomic,readonly,assign,getter=elementCount) int elementCount; - (int)elementCount;
Default Value
0
Remarks
This property contains the number of elements in the current Segment.
This property is read-only.
ElementIndex Property (EDIFACTReader Module)
The index of the current Element.
Syntax
public var elementIndex: Int32 { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=elementIndex,setter=setElementIndex:) int elementIndex; - (int)elementIndex; - (void)setElementIndex :(int)newElementIndex;
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.
FunctionalGroup Property (EDIFACTReader Module)
The current FunctionalGroup.
Syntax
public var functionalGroup: EDIFACTFunctionalGroup { get {...} }
@property (nonatomic,readwrite,assign,getter=FGroupAppPassword,setter=setFGroupAppPassword:) NSString* FGroupAppPassword; - (NSString*)FGroupAppPassword; - (void)setFGroupAppPassword :(NSString*)newFGroupAppPassword; @property (nonatomic,readwrite,assign,getter=FGroupAppRecipientIdentification,setter=setFGroupAppRecipientIdentification:) NSString* FGroupAppRecipientIdentification; - (NSString*)FGroupAppRecipientIdentification; - (void)setFGroupAppRecipientIdentification :(NSString*)newFGroupAppRecipientIdentification; @property (nonatomic,readwrite,assign,getter=FGroupAppRecipientIDQualifier,setter=setFGroupAppRecipientIDQualifier:) NSString* FGroupAppRecipientIDQualifier; - (NSString*)FGroupAppRecipientIDQualifier; - (void)setFGroupAppRecipientIDQualifier :(NSString*)newFGroupAppRecipientIDQualifier; @property (nonatomic,readwrite,assign,getter=FGroupAppSenderIdentification,setter=setFGroupAppSenderIdentification:) NSString* FGroupAppSenderIdentification; - (NSString*)FGroupAppSenderIdentification; - (void)setFGroupAppSenderIdentification :(NSString*)newFGroupAppSenderIdentification; @property (nonatomic,readwrite,assign,getter=FGroupAppSenderIDQualifier,setter=setFGroupAppSenderIDQualifier:) NSString* FGroupAppSenderIDQualifier; - (NSString*)FGroupAppSenderIDQualifier; - (void)setFGroupAppSenderIDQualifier :(NSString*)newFGroupAppSenderIDQualifier; @property (nonatomic,readwrite,assign,getter=FGroupAssociationAssignedCode,setter=setFGroupAssociationAssignedCode:) NSString* FGroupAssociationAssignedCode; - (NSString*)FGroupAssociationAssignedCode; - (void)setFGroupAssociationAssignedCode :(NSString*)newFGroupAssociationAssignedCode; @property (nonatomic,readwrite,assign,getter=FGroupControllingAgency,setter=setFGroupControllingAgency:) NSString* FGroupControllingAgency; - (NSString*)FGroupControllingAgency; - (void)setFGroupControllingAgency :(NSString*)newFGroupControllingAgency; @property (nonatomic,readwrite,assign,getter=FGroupDate,setter=setFGroupDate:) NSString* FGroupDate; - (NSString*)FGroupDate; - (void)setFGroupDate :(NSString*)newFGroupDate; @property (nonatomic,readwrite,assign,getter=FGroupGroupIdentification,setter=setFGroupGroupIdentification:) NSString* FGroupGroupIdentification; - (NSString*)FGroupGroupIdentification; - (void)setFGroupGroupIdentification :(NSString*)newFGroupGroupIdentification; @property (nonatomic,readwrite,assign,getter=FGroupMessageRelease,setter=setFGroupMessageRelease:) NSString* FGroupMessageRelease; - (NSString*)FGroupMessageRelease; - (void)setFGroupMessageRelease :(NSString*)newFGroupMessageRelease; @property (nonatomic,readwrite,assign,getter=FGroupMessageVersion,setter=setFGroupMessageVersion:) NSString* FGroupMessageVersion; - (NSString*)FGroupMessageVersion; - (void)setFGroupMessageVersion :(NSString*)newFGroupMessageVersion; @property (nonatomic,readwrite,assign,getter=FGroupReferenceNumber,setter=setFGroupReferenceNumber:) NSString* FGroupReferenceNumber; - (NSString*)FGroupReferenceNumber; - (void)setFGroupReferenceNumber :(NSString*)newFGroupReferenceNumber; @property (nonatomic,readwrite,assign,getter=FGroupTime,setter=setFGroupTime:) NSString* FGroupTime; - (NSString*)FGroupTime; - (void)setFGroupTime :(NSString*)newFGroupTime;
Default Value
False
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.
FunctionalGroupCount Property (EDIFACTReader Module)
The number of FunctionalGroups in the current Interchange.
Syntax
public var functionalGroupCount: Int32 { get {...} }
@property (nonatomic,readonly,assign,getter=functionalGroupCount) int functionalGroupCount; - (int)functionalGroupCount;
Default Value
0
Remarks
This property contains the number of FunctionalGroups in the current Interchange.
This property is read-only.
FunctionalGroupIndex Property (EDIFACTReader Module)
The index of the current FunctionalGroup.
Syntax
public var functionalGroupIndex: Int32 { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=functionalGroupIndex,setter=setFunctionalGroupIndex:) int functionalGroupIndex; - (int)functionalGroupIndex; - (void)setFunctionalGroupIndex :(int)newFunctionalGroupIndex;
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.
Group Property (EDIFACTReader Module)
Specifies the group to load segments from.
Syntax
public var group: String { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=group,setter=setGroup:) NSString* group; - (NSString*)group; - (void)setGroup :(NSString*)newGroup;
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.
InputData Property (EDIFACTReader Module)
The EDI message, specified as a string.
Syntax
public var inputData: String { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=inputData,setter=setInputData:) NSString* inputData; - (NSString*)inputData; - (void)setInputData :(NSString*)newInputData;
Default Value
""
Remarks
Set this property to specify the input EDI message as a string. The message can then be parsed with Parse.
InputFile Property (EDIFACTReader Module)
The file containing the EDI message.
Syntax
public var inputFile: String { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=inputFile,setter=setInputFile:) NSString* inputFile; - (NSString*)inputFile; - (void)setInputFile :(NSString*)newInputFile;
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.
Interchange Property (EDIFACTReader Module)
The current Interchange.
Syntax
public var interchange: EDIFACTInterchange { get {...} }
@property (nonatomic,readwrite,assign,getter=interchangeAckRequest,setter=setInterchangeAckRequest:) NSString* interchangeAckRequest; - (NSString*)interchangeAckRequest; - (void)setInterchangeAckRequest :(NSString*)newInterchangeAckRequest; @property (nonatomic,readwrite,assign,getter=interchangeAgreementIdentifier,setter=setInterchangeAgreementIdentifier:) NSString* interchangeAgreementIdentifier; - (NSString*)interchangeAgreementIdentifier; - (void)setInterchangeAgreementIdentifier :(NSString*)newInterchangeAgreementIdentifier; @property (nonatomic,readwrite,assign,getter=interchangeApplicationReference,setter=setInterchangeApplicationReference:) NSString* interchangeApplicationReference; - (NSString*)interchangeApplicationReference; - (void)setInterchangeApplicationReference :(NSString*)newInterchangeApplicationReference; @property (nonatomic,readwrite,assign,getter=interchangeCharacterEncoding,setter=setInterchangeCharacterEncoding:) NSString* interchangeCharacterEncoding; - (NSString*)interchangeCharacterEncoding; - (void)setInterchangeCharacterEncoding :(NSString*)newInterchangeCharacterEncoding; @property (nonatomic,readwrite,assign,getter=interchangeCodeListVersionNumber,setter=setInterchangeCodeListVersionNumber:) NSString* interchangeCodeListVersionNumber; - (NSString*)interchangeCodeListVersionNumber; - (void)setInterchangeCodeListVersionNumber :(NSString*)newInterchangeCodeListVersionNumber; @property (nonatomic,readwrite,assign,getter=interchangeDate,setter=setInterchangeDate:) NSString* interchangeDate; - (NSString*)interchangeDate; - (void)setInterchangeDate :(NSString*)newInterchangeDate; @property (nonatomic,readwrite,assign,getter=interchangeProcessingPriorityCode,setter=setInterchangeProcessingPriorityCode:) NSString* interchangeProcessingPriorityCode; - (NSString*)interchangeProcessingPriorityCode; - (void)setInterchangeProcessingPriorityCode :(NSString*)newInterchangeProcessingPriorityCode; @property (nonatomic,readwrite,assign,getter=interchangeRecipientIdentification,setter=setInterchangeRecipientIdentification:) NSString* interchangeRecipientIdentification; - (NSString*)interchangeRecipientIdentification; - (void)setInterchangeRecipientIdentification :(NSString*)newInterchangeRecipientIdentification; @property (nonatomic,readwrite,assign,getter=interchangeRecipientIDQualifier,setter=setInterchangeRecipientIDQualifier:) NSString* interchangeRecipientIDQualifier; - (NSString*)interchangeRecipientIDQualifier; - (void)setInterchangeRecipientIDQualifier :(NSString*)newInterchangeRecipientIDQualifier; @property (nonatomic,readwrite,assign,getter=interchangeRecipientInternalIdentification,setter=setInterchangeRecipientInternalIdentification:) NSString* interchangeRecipientInternalIdentification; - (NSString*)interchangeRecipientInternalIdentification; - (void)setInterchangeRecipientInternalIdentification :(NSString*)newInterchangeRecipientInternalIdentification; @property (nonatomic,readwrite,assign,getter=interchangeRecipientInternalSubIdentification,setter=setInterchangeRecipientInternalSubIdentification:) NSString* interchangeRecipientInternalSubIdentification; - (NSString*)interchangeRecipientInternalSubIdentification; - (void)setInterchangeRecipientInternalSubIdentification :(NSString*)newInterchangeRecipientInternalSubIdentification; @property (nonatomic,readwrite,assign,getter=interchangeRecipientPassword,setter=setInterchangeRecipientPassword:) NSString* interchangeRecipientPassword; - (NSString*)interchangeRecipientPassword; - (void)setInterchangeRecipientPassword :(NSString*)newInterchangeRecipientPassword; @property (nonatomic,readwrite,assign,getter=interchangeRecipientPasswordQualifier,setter=setInterchangeRecipientPasswordQualifier:) NSString* interchangeRecipientPasswordQualifier; - (NSString*)interchangeRecipientPasswordQualifier; - (void)setInterchangeRecipientPasswordQualifier :(NSString*)newInterchangeRecipientPasswordQualifier; @property (nonatomic,readwrite,assign,getter=interchangeReferenceNumber,setter=setInterchangeReferenceNumber:) NSString* interchangeReferenceNumber; - (NSString*)interchangeReferenceNumber; - (void)setInterchangeReferenceNumber :(NSString*)newInterchangeReferenceNumber; @property (nonatomic,readwrite,assign,getter=interchangeSenderIdentification,setter=setInterchangeSenderIdentification:) NSString* interchangeSenderIdentification; - (NSString*)interchangeSenderIdentification; - (void)setInterchangeSenderIdentification :(NSString*)newInterchangeSenderIdentification; @property (nonatomic,readwrite,assign,getter=interchangeSenderIDQualifier,setter=setInterchangeSenderIDQualifier:) NSString* interchangeSenderIDQualifier; - (NSString*)interchangeSenderIDQualifier; - (void)setInterchangeSenderIDQualifier :(NSString*)newInterchangeSenderIDQualifier; @property (nonatomic,readwrite,assign,getter=interchangeSenderInternalIdentification,setter=setInterchangeSenderInternalIdentification:) NSString* interchangeSenderInternalIdentification; - (NSString*)interchangeSenderInternalIdentification; - (void)setInterchangeSenderInternalIdentification :(NSString*)newInterchangeSenderInternalIdentification; @property (nonatomic,readwrite,assign,getter=interchangeSenderInternalSubIdentification,setter=setInterchangeSenderInternalSubIdentification:) NSString* interchangeSenderInternalSubIdentification; - (NSString*)interchangeSenderInternalSubIdentification; - (void)setInterchangeSenderInternalSubIdentification :(NSString*)newInterchangeSenderInternalSubIdentification; @property (nonatomic,readwrite,assign,getter=interchangeSyntaxIdentifier,setter=setInterchangeSyntaxIdentifier:) NSString* interchangeSyntaxIdentifier; - (NSString*)interchangeSyntaxIdentifier; - (void)setInterchangeSyntaxIdentifier :(NSString*)newInterchangeSyntaxIdentifier; @property (nonatomic,readwrite,assign,getter=interchangeSyntaxVersionNumber,setter=setInterchangeSyntaxVersionNumber:) NSString* interchangeSyntaxVersionNumber; - (NSString*)interchangeSyntaxVersionNumber; - (void)setInterchangeSyntaxVersionNumber :(NSString*)newInterchangeSyntaxVersionNumber; @property (nonatomic,readwrite,assign,getter=interchangeTestIndicator,setter=setInterchangeTestIndicator:) NSString* interchangeTestIndicator; - (NSString*)interchangeTestIndicator; - (void)setInterchangeTestIndicator :(NSString*)newInterchangeTestIndicator; @property (nonatomic,readwrite,assign,getter=interchangeTime,setter=setInterchangeTime:) NSString* interchangeTime; - (NSString*)interchangeTime; - (void)setInterchangeTime :(NSString*)newInterchangeTime;
Default Value
False
Remarks
This property contains the current Interchange within the document specified by InterchangeIndex.
InterchangeCount Property (EDIFACTReader Module)
The number of Interchanges in the document.
Syntax
public var interchangeCount: Int32 { get {...} }
@property (nonatomic,readonly,assign,getter=interchangeCount) int interchangeCount; - (int)interchangeCount;
Default Value
0
Remarks
This property contains the number of Interchanges in the current document.
This property is read-only.
InterchangeIndex Property (EDIFACTReader Module)
The index of the current Interchange.
Syntax
public var interchangeIndex: Int32 { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=interchangeIndex,setter=setInterchangeIndex:) int interchangeIndex; - (int)interchangeIndex; - (void)setInterchangeIndex :(int)newInterchangeIndex;
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.
Message Property (EDIFACTReader Module)
The current message.
Syntax
public var message: EDIFACTMessage { get {...} }
@property (nonatomic,readwrite,assign,getter=msgAssociationAssignedCode,setter=setMsgAssociationAssignedCode:) NSString* msgAssociationAssignedCode; - (NSString*)msgAssociationAssignedCode; - (void)setMsgAssociationAssignedCode :(NSString*)newMsgAssociationAssignedCode; @property (nonatomic,readwrite,assign,getter=msgCodeListVersionNumber,setter=setMsgCodeListVersionNumber:) NSString* msgCodeListVersionNumber; - (NSString*)msgCodeListVersionNumber; - (void)setMsgCodeListVersionNumber :(NSString*)newMsgCodeListVersionNumber; @property (nonatomic,readwrite,assign,getter=msgCommonAccessReference,setter=setMsgCommonAccessReference:) NSString* msgCommonAccessReference; - (NSString*)msgCommonAccessReference; - (void)setMsgCommonAccessReference :(NSString*)newMsgCommonAccessReference; @property (nonatomic,readwrite,assign,getter=msgControllingAgency,setter=setMsgControllingAgency:) NSString* msgControllingAgency; - (NSString*)msgControllingAgency; - (void)setMsgControllingAgency :(NSString*)newMsgControllingAgency; @property (nonatomic,readwrite,assign,getter=msgFirstAndLastTransfer,setter=setMsgFirstAndLastTransfer:) NSString* msgFirstAndLastTransfer; - (NSString*)msgFirstAndLastTransfer; - (void)setMsgFirstAndLastTransfer :(NSString*)newMsgFirstAndLastTransfer; @property (nonatomic,readwrite,assign,getter=msgMessageImplControllingAgency,setter=setMsgMessageImplControllingAgency:) NSString* msgMessageImplControllingAgency; - (NSString*)msgMessageImplControllingAgency; - (void)setMsgMessageImplControllingAgency :(NSString*)newMsgMessageImplControllingAgency; @property (nonatomic,readwrite,assign,getter=msgMessageImplIdentification,setter=setMsgMessageImplIdentification:) NSString* msgMessageImplIdentification; - (NSString*)msgMessageImplIdentification; - (void)setMsgMessageImplIdentification :(NSString*)newMsgMessageImplIdentification; @property (nonatomic,readwrite,assign,getter=msgMessageImplRelease,setter=setMsgMessageImplRelease:) NSString* msgMessageImplRelease; - (NSString*)msgMessageImplRelease; - (void)setMsgMessageImplRelease :(NSString*)newMsgMessageImplRelease; @property (nonatomic,readwrite,assign,getter=msgMessageImplVersion,setter=setMsgMessageImplVersion:) NSString* msgMessageImplVersion; - (NSString*)msgMessageImplVersion; - (void)setMsgMessageImplVersion :(NSString*)newMsgMessageImplVersion; @property (nonatomic,readwrite,assign,getter=msgMessageRelease,setter=setMsgMessageRelease:) NSString* msgMessageRelease; - (NSString*)msgMessageRelease; - (void)setMsgMessageRelease :(NSString*)newMsgMessageRelease; @property (nonatomic,readwrite,assign,getter=msgMessageSubsetControllingAgency,setter=setMsgMessageSubsetControllingAgency:) NSString* msgMessageSubsetControllingAgency; - (NSString*)msgMessageSubsetControllingAgency; - (void)setMsgMessageSubsetControllingAgency :(NSString*)newMsgMessageSubsetControllingAgency; @property (nonatomic,readwrite,assign,getter=msgMessageSubsetIdentification,setter=setMsgMessageSubsetIdentification:) NSString* msgMessageSubsetIdentification; - (NSString*)msgMessageSubsetIdentification; - (void)setMsgMessageSubsetIdentification :(NSString*)newMsgMessageSubsetIdentification; @property (nonatomic,readwrite,assign,getter=msgMessageSubsetRelease,setter=setMsgMessageSubsetRelease:) NSString* msgMessageSubsetRelease; - (NSString*)msgMessageSubsetRelease; - (void)setMsgMessageSubsetRelease :(NSString*)newMsgMessageSubsetRelease; @property (nonatomic,readwrite,assign,getter=msgMessageSubsetVersion,setter=setMsgMessageSubsetVersion:) NSString* msgMessageSubsetVersion; - (NSString*)msgMessageSubsetVersion; - (void)setMsgMessageSubsetVersion :(NSString*)newMsgMessageSubsetVersion; @property (nonatomic,readwrite,assign,getter=msgMessageType,setter=setMsgMessageType:) NSString* msgMessageType; - (NSString*)msgMessageType; - (void)setMsgMessageType :(NSString*)newMsgMessageType; @property (nonatomic,readwrite,assign,getter=msgMessageTypeSubFunctionIdentification,setter=setMsgMessageTypeSubFunctionIdentification:) NSString* msgMessageTypeSubFunctionIdentification; - (NSString*)msgMessageTypeSubFunctionIdentification; - (void)setMsgMessageTypeSubFunctionIdentification :(NSString*)newMsgMessageTypeSubFunctionIdentification; @property (nonatomic,readwrite,assign,getter=msgMessageVersion,setter=setMsgMessageVersion:) NSString* msgMessageVersion; - (NSString*)msgMessageVersion; - (void)setMsgMessageVersion :(NSString*)newMsgMessageVersion; @property (nonatomic,readwrite,assign,getter=msgReferenceNumber,setter=setMsgReferenceNumber:) NSString* msgReferenceNumber; - (NSString*)msgReferenceNumber; - (void)setMsgReferenceNumber :(NSString*)newMsgReferenceNumber; @property (nonatomic,readwrite,assign,getter=msgScenarioControllingAgency,setter=setMsgScenarioControllingAgency:) NSString* msgScenarioControllingAgency; - (NSString*)msgScenarioControllingAgency; - (void)setMsgScenarioControllingAgency :(NSString*)newMsgScenarioControllingAgency; @property (nonatomic,readwrite,assign,getter=msgScenarioIdentification,setter=setMsgScenarioIdentification:) NSString* msgScenarioIdentification; - (NSString*)msgScenarioIdentification; - (void)setMsgScenarioIdentification :(NSString*)newMsgScenarioIdentification; @property (nonatomic,readwrite,assign,getter=msgScenarioRelease,setter=setMsgScenarioRelease:) NSString* msgScenarioRelease; - (NSString*)msgScenarioRelease; - (void)setMsgScenarioRelease :(NSString*)newMsgScenarioRelease; @property (nonatomic,readwrite,assign,getter=msgScenarioVersion,setter=setMsgScenarioVersion:) NSString* msgScenarioVersion; - (NSString*)msgScenarioVersion; - (void)setMsgScenarioVersion :(NSString*)newMsgScenarioVersion; @property (nonatomic,readwrite,assign,getter=msgSequenceOfTransfers,setter=setMsgSequenceOfTransfers:) NSString* msgSequenceOfTransfers; - (NSString*)msgSequenceOfTransfers; - (void)setMsgSequenceOfTransfers :(NSString*)newMsgSequenceOfTransfers;
Default Value
False
Remarks
This property contains the message within the current Interchange or FunctionalGroup specified by MessageIndex.
MessageCount Property (EDIFACTReader Module)
The number of message in the current Interchange or FunctionalGroup.
Syntax
public var messageCount: Int32 { get {...} }
@property (nonatomic,readonly,assign,getter=messageCount) int messageCount; - (int)messageCount;
Default Value
0
Remarks
This property contains the number of messages in the current Interchange or FunctionalGroup.
This property is read-only.
MessageIndex Property (EDIFACTReader Module)
The index of the current Message.
Syntax
public var messageIndex: Int32 { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=messageIndex,setter=setMessageIndex:) int messageIndex; - (int)messageIndex; - (void)setMessageIndex :(int)newMessageIndex;
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.
Segment Property (EDIFACTReader Module)
The current segment.
Syntax
public var segment: EDISegment { get {...} }
@property (nonatomic,readonly,assign,getter=segmentOptional) BOOL segmentOptional; - (BOOL)segmentOptional; @property (nonatomic,readonly,assign,getter=segmentPath) NSString* segmentPath; - (NSString*)segmentPath; @property (nonatomic,readonly,assign,getter=segmentSchemaPath) NSString* segmentSchemaPath; - (NSString*)segmentSchemaPath; @property (nonatomic,readonly,assign,getter=segmentTag) NSString* segmentTag; - (NSString*)segmentTag;
Default Value
False
Remarks
This property contains the segment within the current Message specified by SegmentIndex.
SegmentCount Property (EDIFACTReader Module)
The number of segments in the current Message.
Syntax
public var segmentCount: Int32 { get {...} }
@property (nonatomic,readonly,assign,getter=segmentCount) int segmentCount; - (int)segmentCount;
Default Value
0
Remarks
This property contains the number of elements in the current Message.
This property is read-only.
SegmentIndex Property (EDIFACTReader Module)
The index of the current segment.
Syntax
public var segmentIndex: Int32 { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=segmentIndex,setter=setSegmentIndex:) int segmentIndex; - (int)segmentIndex; - (void)setSegmentIndex :(int)newSegmentIndex;
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.
ValidateOnParse Property (EDIFACTReader Module)
When True , the module will validate any documents it parses.
Syntax
public var validateOnParse: Bool { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=validateOnParse,setter=setValidateOnParse:) BOOL validateOnParse; - (BOOL)validateOnParse; - (void)setValidateOnParse :(BOOL)newValidateOnParse;
Default Value
False
Remarks
When this property is set to True, the class will perform validation on the document when Parse is called. The ValidateWarning event will fire for each error it encounters.
Config Method (EDIFACTReader Module)
Sets or retrieves a configuration setting.
Syntax
- (NSString*)config:(NSString*)configurationString;
Remarks
Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, 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 Module)
Generates an ACK in response to the most recently parsed message.
Syntax
public func generateAck() throws -> String
- (NSString*)generateAck;
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 Module)
Returns the value of the element or component at the specified path.
Syntax
- (NSString*)getElementValue:(NSString*)path;
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 Module)
Loads schema information from a file or string data.
Syntax
- (void)loadSchema:(NSString*)fileOrData :(NSString*)messageName;
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 Module)
Parse the EDI document and fire parsing events.
Syntax
public func parse() throws -> Void
- (void)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 Module)
Resets all properties to their default values.
Syntax
public func reset() throws -> Void
- (void)reset;
Remarks
This method resets all properties of the component to their default values as specified in the property definitions.
SchemaCode Method (EDIFACTReader Module)
Defines a code value within a list of codes.
Syntax
public func schemaCode(schemaId: String, codeListId: String, value: String, description_: String) throws -> Void
- (void)schemaCode:(NSString*)schemaId :(NSString*)codeListId :(NSString*)value :(NSString*)description;
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 Module)
Defines a list of codes.
Syntax
public func schemaCodeList(schemaId: String, codeListId: String, description_: String) throws -> Void
- (void)schemaCodeList:(NSString*)schemaId :(NSString*)codeListId :(NSString*)description;
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 Module)
Defines a composite element.
Syntax
public func schemaComposite(schemaId: String, compositeId: String, description_: String) throws -> Void
- (void)schemaComposite:(NSString*)schemaId :(NSString*)compositeId :(NSString*)description;
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 Module)
Defines a simple element.
Syntax
public func schemaElement(schemaId: String, elementId: String, dataType: String, minLength: Int32, maxLength: Int32, codeId: String, description_: String) throws -> Void
- (void)schemaElement:(NSString*)schemaId :(NSString*)elementId :(NSString*)dataType :(int)minLength :(int)maxLength :(NSString*)codeId :(NSString*)description;
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 Module)
Adds a reference to an element in a segment or composite element.
Syntax
public func schemaElementRef(schemaId: String, parentId: String, elementId: String, refId: String, required: Bool, maxCount: Int32) throws -> Void
- (void)schemaElementRef:(NSString*)schemaId :(NSString*)parentId :(NSString*)elementId :(NSString*)refId :(BOOL)required :(int)maxCount;
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 Module)
Ends a schema definition.
Syntax
public func schemaEnd() throws -> Void
- (void)schemaEnd;
Remarks
Ends a schema definition when a schema is being defined manually instead of loaded from a file.
SchemaGroup Method (EDIFACTReader Module)
Defines a group of segments.
Syntax
public func schemaGroup(schemaId: String, groupPath: String, groupId: String, required: Bool, maxCount: Int32) throws -> Void
- (void)schemaGroup:(NSString*)schemaId :(NSString*)groupPath :(NSString*)groupId :(BOOL)required :(int)maxCount;
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 Module)
Defines a message.
Syntax
- (void)schemaMessage:(NSString*)schemaId :(NSString*)messageId :(NSString*)description;
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 Module)
Defines a segment.
Syntax
- (void)schemaSegment:(NSString*)schemaId :(NSString*)segmentId :(NSString*)description;
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 Module)
Adds a reference to a segment in a message or group.
Syntax
public func schemaSegmentRef(schemaId: String, segmentPath: String, segmentId: String, required: Bool, maxCount: Int32) throws -> Void
- (void)schemaSegmentRef:(NSString*)schemaId :(NSString*)segmentPath :(NSString*)segmentId :(BOOL)required :(int)maxCount;
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 Module)
Starts a schema definition.
Syntax
Remarks
Starts manually defining a schema, as an alternative to loading one from a file.
Validate Method (EDIFACTReader Module)
Validate the EDI document and warn about any errors encountered.
Syntax
public func validate() throws -> Void
- (void)validate;
Remarks
This method parses the input EDI document, firing the ValidateWarning event for any non-blocking errors it encounters.
EndFunctionalGroup Event (EDIFACTReader Module)
Fires at the end of a functional group while parsing.
Syntax
- (void)onEndFunctionalGroup:(NSString*)tag :(int)messageCount :(NSString*)referenceNumber;
Remarks
This event fires when the class encounters the end of a functional group while parsing a document.
EndGroup Event (EDIFACTReader Module)
Fires at the end of a group while parsing a message.
Syntax
- (void)onEndGroup:(NSString*)name :(int)schemaIndex;
Remarks
This event fires when the class encounters the end of a group while parsing a message.
EndInterchange Event (EDIFACTReader Module)
Fires at the end of an interchange while parsing.
Syntax
- (void)onEndInterchange:(NSString*)tag :(int)groupCount :(NSString*)referenceNumber;
Remarks
This event fires at the end of an interchange while parsing a document.
EndMessage Event (EDIFACTReader Module)
Fires at the end of a message while parsing.
Syntax
- (void)onEndMessage:(NSString*)tag :(int)segmentCount :(NSString*)referenceNumber;
Remarks
This event fires when the class encounters the end of a message while parsing a document.
Error Event (EDIFACTReader Module)
Fires when an error occurs during message processing. Normally, the component fails with an error.
Syntax
- (void)onError:(int)errorCode :(NSString*)description;
Remarks
The Error event is fired in case of exceptional conditions during message processing. Normally, the class .
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 Module)
Fires whenever a new EDIFACT message is encountered and no schema is found for it.
Syntax
- (void)onResolveSchema:(NSString*)messageVersion :(NSString*)messageType;
Remarks
This method fires when the class 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 class still doesn't have a matching schema, then it will attempt schema-less parsing of the EDIFACT message.
Segment Event (EDIFACTReader Module)
Fires at the end of a Segment while parsing.
Syntax
func onSegment(tag: String, schemaPath: String, optional: Bool, elementCount: Int32, schemaIndex: Int32, segmentIndex: Int32, maxCount: Int32, path: String)
- (void)onSegment:(NSString*)tag :(NSString*)schemaPath :(BOOL)optional :(int)elementCount :(int)schemaIndex :(int)segmentIndex :(int)maxCount :(NSString*)path;
Remarks
Fires at the end of a Segment while parsing a document
StartFunctionalGroup Event (EDIFACTReader Module)
Fires at the beginning of a functional group while parsing.
Syntax
func onStartFunctionalGroup(tag: String, appSenderIdentification: String, appRecipientIdentification: String, dateTime: String, referenceNumber: String)
- (void)onStartFunctionalGroup:(NSString*)tag :(NSString*)appSenderIdentification :(NSString*)appRecipientIdentification :(NSString*)dateTime :(NSString*)referenceNumber;
Remarks
This event fires when the class encounters the start of a functional group while parsing a document.
StartGroup Event (EDIFACTReader Module)
Fires at the beginning of a group while parsing a message.
Syntax
- (void)onStartGroup:(NSString*)name :(int)schemaIndex :(int)maxCount :(NSString*)path;
Remarks
This event fires when the class encounters the start of a group while parsing a message.
StartInterchange Event (EDIFACTReader Module)
Fires at the beginning of an interchange while parsing.
Syntax
func onStartInterchange(tag: String, syntaxIdentifier: String, syntaxVersion: String, senderIdentification: String, recipientIdentification: String, dateTime: String, referenceNumber: String)
- (void)onStartInterchange:(NSString*)tag :(NSString*)syntaxIdentifier :(NSString*)syntaxVersion :(NSString*)senderIdentification :(NSString*)recipientIdentification :(NSString*)dateTime :(NSString*)referenceNumber;
Remarks
This event fires at the beginning of an interchange while parsing a document.
StartMessage Event (EDIFACTReader Module)
Fires at the beginning of a message while parsing.
Syntax
func onStartMessage(tag: String, messageRelease: String, messageType: String, referenceNumber: String, schemaLoaded: Bool)
- (void)onStartMessage:(NSString*)tag :(NSString*)messageRelease :(NSString*)messageType :(NSString*)referenceNumber :(BOOL)schemaLoaded;
Remarks
This event fires when the class encounters the start of a message while parsing a document.
ValidateWarning Event (EDIFACTReader Module)
Fires to warn about validation errors.
Syntax
func onValidateWarning(position: Int64, line: Int32, column: Int32, errorCode: String, errorMessage: String, errorType: Int32)
- (void)onValidateWarning:(long long)position :(int)line :(int)column :(NSString*)errorCode :(NSString*)errorMessage :(int)errorType;
Remarks
When the class 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
Bool (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
Int32 (read-only)
Default Value: 0
For a simple element, this specifies the maximum length of the element according to the schema.
minLen
Int32 (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
public init()
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
public init()
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
public init()
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
public init()
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
public init()
EDISegment Type
A segment of an EDI document.
Remarks
This represents a segment appearing in an EDI document.
Fields
optional
Bool (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
public init()
Config Settings (EDIFACTReader Module)
The class 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 class, access to these internal properties is provided through the Config method.EDIFACTReader Config Settings
| 0 (default) | EDIFACT |
| 1 | XML |
Trappable Errors (EDIFACTReader Module)
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. |