EDIFACTWriter Module
Properties Methods Events Config Settings Errors
The EDIFACTWriter module generates EDIFACT documents with a clear, straightforward API.
Syntax
EDISDK.EDIFACTWriter
Remarks
The class allows you to create an EDI document from scratch, one segment at a time. Here's how a document would normally be created:
- Call LoadSchema to load the necessary schemas for the transactions that will be used.
- Specify where to write the output document by setting the OutputFile, or check the OutputData property after writing.
- Create a new interchange start segment by setting the fields of the Interchange property and call the StartInterchange method. Once the interchange is complete, call EndInterchange to add the interchange footer.
- If you want to create a functional group, set the fields of the FunctionalGroup property and then call the StartFunctionalGroup. Once all the messages in the group have been created, call EndFunctionalGroup to add a footer for the group.
- To start a message, call the StartMessage method. Once all segments have been added, call EndMessage to add a footer to the message.
- To begin a segment, call the StartSegment method and pass in the tag for the segment. Once all the elements in the segment have been added, call EndSegment to add the segment terminator.
- To write a basic element to the current segment, call the WriteElement method.
- To write a composite element, call the StartCompositeElement method, then call the WriteComponent method for each component, and finally call EndCompositeElement to end the element.
Property List
The following is the full list of the properties of the module with short descriptions. Click on the links for further details.
| Delimiters | Contains the delimiters for the EDI Document.. |
| FileWriteMode | Determines how the output file is opened for writing. |
| FunctionalGroup | Contains the current functional group information for the EDI Document. |
| Interchange | Contains the current interchange information for the EDI Document. |
| Message | Contains the current message information for the EDI Document. |
| OutputData | The output data that has been written so far. |
| OutputFile | The name of the output file to which the EDI data will be written. |
| SegmentSuffix | The suffix that is appended to the end of a segment. |
Method List
The following is the full list of the methods of the module with short descriptions. Click on the links for further details.
| Close | Closes the writer. |
| Config | Sets or retrieves a configuration setting. |
| EndCompositeElement | Finish writing the composite element. |
| EndFunctionalGroup | Write the UNE(FunctionalGroup) segment to the output file/data/stream. |
| EndInterchange | Write the UNZ(Interchange) segment to the output file/data/stream. |
| EndMessage | Closes the current message. |
| EndSegment | Finish writing the segment, add SegmentSuffix at the end of the segment. |
| Reset | Resets all properties to their default values. |
| StartCompositeElement | Starts a composite element within the current segment. |
| StartFunctionalGroup | Starts a new functional group in the EDI document. |
| StartInterchange | Starts a new interchange in the EDI document. |
| StartMessage | Starts a new message in the EDI document. |
| StartSegment | Starts a new segment with the specified tag. |
| WriteComponent | Writes a module element value to the current composite element. |
| WriteElement | Writes an element value to the current segment. |
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.
| Error | Fires when an error occurs during message processing. Normally, the module fails with an error. |
| Output | Fires when output data is written. |
Config Settings
The following is a list of config settings for the module with short descriptions. Click on the links for further details.
Delimiters Property (EDIFACTWriter 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
3
Remarks
This property contains the delimiters that will be used when writing the EDIFACT document. If the document uses delimiters other than the default, change the properties of this object to write the document correctly.
FileWriteMode Property (EDIFACTWriter Module)
Determines how the output file is opened for writing.
Syntax
public var fileWriteMode: EDIFACTWriterFileWriteModes { get {...} set {...} }
public enum EDIFACTWriterFileWriteModes: Int32 { case fwmCreate = 0 case fwmOverwrite = 1 case fwmAppend = 2 }
@property (nonatomic,readwrite,assign,getter=fileWriteMode,setter=setFileWriteMode:) int fileWriteMode; - (int)fileWriteMode; - (void)setFileWriteMode :(int)newFileWriteMode;
Default Value
0
Remarks
When OutputFile is set, this property determines how the file will be opened.
| fwmCreate (Default) | Creates a new file. If the file already exists, the translation will fail. |
| fwmOverwrite | Opens an existing file and overwrites its contents. If the file does not exist, a new file will be created. |
| fwmAppend | Opens an existing file and appends data to the end of the file. If the file does not exist, a new file will be created. |
FunctionalGroup Property (EDIFACTWriter Module)
Contains the current functional group information for the EDI Document.
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
3
Remarks
The functional group information is used when writing the functional group header (GS) and trailer (GE) segments. The properties of this object must be changed before calling StartFunctionalGroup to write the functional group correctly. After calling StartFunctionalGroup changing the properties of this object will change the values for the next functional group only.
Interchange Property (EDIFACTWriter Module)
Contains the current interchange information for the EDI Document.
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
3
Remarks
The interchange information is used when writing the interchange header (ISA) and trailer (IEA) segments. The properties of this object must be changed before calling StartInterchange to write the interchange correctly. After calling StartInterchange changing the properties of this object will change the values for the next interchange only.
Message Property (EDIFACTWriter Module)
Contains the current message information for the EDI Document.
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
3
Remarks
This property holds the current message information for the EDI document. It is used by the StartMessage method to create a new transaction set header. The properties of this object must be changed before calling StartMessage to write the transaction set correctly. After calling StartMessage changing the properties of this object will change the values for the next transaction set only.
OutputData Property (EDIFACTWriter Module)
The output data that has been written so far.
Syntax
public var outputData: String { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=outputData,setter=setOutputData:) NSString* outputData; - (NSString*)outputData; - (void)setOutputData :(NSString*)newOutputData;
Default Value
""
Remarks
OutputData contains the entire EDI document that has been written so far. If writing to a file or stream, this property will be empty.
OutputFile Property (EDIFACTWriter Module)
The name of the output file to which the EDI data will be written.
Syntax
public var outputFile: String { get {...} set {...} }
@property (nonatomic,readwrite,assign,getter=outputFile,setter=setOutputFile:) NSString* outputFile; - (NSString*)outputFile; - (void)setOutputFile :(NSString*)newOutputFile;
Default Value
""
Remarks
FileWriteMode property determines how the file is opened for writing. If OutputFile is empty, no file will be written and the OutputData property will contain the EDI data instead.
SegmentSuffix Property (EDIFACTWriter Module)
The suffix that is appended to the end of a segment.
Syntax
public var segmentSuffix: EDIFACTWriterSegmentSuffixes { get {...} set {...} }
public enum EDIFACTWriterSegmentSuffixes: Int32 { case ssNone = 0 case ssCR = 1 case ssLF = 2 case ssCRLF = 3 }
@property (nonatomic,readwrite,assign,getter=segmentSuffix,setter=setSegmentSuffix:) int segmentSuffix; - (int)segmentSuffix; - (void)setSegmentSuffix :(int)newSegmentSuffix;
Default Value
3
Remarks
Possible values are:
| ssNone (0) | No suffix is appended to the segment. |
| ssCR (1) | A carriage return (ASCII 13) is appended to the segment. |
| ssLF (2) | A line feed (ASCII 10) is appended to the segment. |
| ssCRLF (3) | A carriage return followed by a line feed (ASCII 13 and 10) is appended to the segment. This is the default value. |
Close Method (EDIFACTWriter Module)
Closes the writer.
Syntax
public func close() throws -> Void
- (void)close;
Remarks
Calling Close will close the writer and release any resources associated with it. After calling Close, the writer cannot be used unless it is re-initialized.
Config Method (EDIFACTWriter 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.
EndCompositeElement Method (EDIFACTWriter Module)
Finish writing the composite element.
Syntax
public func endCompositeElement() throws -> Void
- (void)endCompositeElement;
Remarks
This method is used to close a CompositeElement. This method may only be called after a successful call to StartCompositeElement
EndFunctionalGroup Method (EDIFACTWriter Module)
Write the UNE(FunctionalGroup) segment to the output file/data/stream.
Syntax
public func endFunctionalGroup() throws -> Void
- (void)endFunctionalGroup;
Remarks
This method is used to close a FunctionalGroup. This method may only be called after a successful call to StartFunctionalGroup
EndInterchange Method (EDIFACTWriter Module)
Write the UNZ(Interchange) segment to the output file/data/stream.
Syntax
public func endInterchange() throws -> Void
- (void)endInterchange;
Remarks
This method is used to close an Interchange. This method may only be called after a successful call to StartInterchange
EndMessage Method (EDIFACTWriter Module)
Closes the current message.
Syntax
public func endMessage() throws -> Void
- (void)endMessage;
Remarks
Calling this method will close the current message. If no message is open, an error will be raised. This method will also write the required Message Trailer (UNT) segment to the output.
EndSegment Method (EDIFACTWriter Module)
Finish writing the segment, add SegmentSuffix at the end of the segment.
Syntax
public func endSegment() throws -> Void
- (void)endSegment;
Remarks
This method is used to close a Segment. This method may only be called after a successful call to StartSegment
Reset Method (EDIFACTWriter 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.
StartCompositeElement Method (EDIFACTWriter Module)
Starts a composite element within the current segment.
Syntax
public func startCompositeElement() throws -> Void
- (void)startCompositeElement;
Remarks
This method starts a composite element within the current segment. The composite element can contain multiple component elements. The composite element is ended by calling the EndCompositeElement method. Component elements within the composite are added by calling the WriteComponent method.
StartFunctionalGroup Method (EDIFACTWriter Module)
Starts a new functional group in the EDI document.
Syntax
public func startFunctionalGroup() throws -> Void
- (void)startFunctionalGroup;
Remarks
This method starts a new functional group in the EDI document. The functional group fields must be set using the appropriate properties before calling this method. The functional group is ended by calling the EndFunctionalGroup method. The functional group header segment (UNG) is written to the output when this method is called.
StartInterchange Method (EDIFACTWriter Module)
Starts a new interchange in the EDI document.
Syntax
public func startInterchange() throws -> Void
- (void)startInterchange;
Remarks
This method starts a new interchange in the EDI document. The interchange fields must be set using the appropriate properties before calling this method. The interchange is ended by calling the EndInterchange method. The interchange header segment (UNB) is written to the output when this method is called. If opening a new interchange would result in an invalid structure (for example, starting a new interchange before ending the previous one), an error will be raised.
StartMessage Method (EDIFACTWriter Module)
Starts a new message in the EDI document.
Syntax
public func startMessage() throws -> Void
- (void)startMessage;
Remarks
This method starts a new message in the EDI document. The message fields must be set using the appropriate properties before calling this method. The message is ended by calling the EndMessage method. The message header segment (UNH) is written to the output when this method is called. If opening a new message would result in an invalid structure (for example, starting a new message before ending the previous one), an error will be raised.
StartSegment Method (EDIFACTWriter Module)
Starts a new segment with the specified tag.
Syntax
Remarks
This method starts a new segment with the specified tag. The segment is ended by calling the EndSegment method. Element values within the segment are added by calling the WriteElement method. Composite elements can be added to the segment by calling the StartCompositeElement method. If starting a new segment would result in an invalid structure (for example, starting a new segment before ending the previous one), an error will be raised.
WriteComponent Method (EDIFACTWriter Module)
Writes a component element value to the current composite element.
Syntax
Remarks
This method writes a component element value to the current composite element. The composite element must be started by calling the StartCompositeElement method before calling this method. The composite element is ended by calling the EndCompositeElement method. If this method is called when not within a composite element, an error will be raised.
WriteElement Method (EDIFACTWriter Module)
Writes an element value to the current segment.
Syntax
Remarks
This method writes an element value to the current segment. The segment must be started by calling the StartSegment method before calling this method. The segment is ended by calling the EndSegment method. If this method is called when not within a segment, an error will be raised.
Error Event (EDIFACTWriter 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.
Output Event (EDIFACTWriter Module)
Fires when output data is written.
Syntax
func onOutput(data: Data)
- (void)onOutput:(NSData*)data;
Remarks
This event is fired when output data is written. The Data parameter contains the segment that was written.
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()
Config Settings (EDIFACTWriter 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.Trappable Errors (EDIFACTWriter Module)
EDIFACTWriter Errors
| 202 | Invalid argument. |
| 304 | Cannot write to file. |
| 1099 | Encountered an unexpected segment tag. |
| 1100 | Attempted to perform an action while the component was busy, or close an incomplete interchange. |
| 1205 | Tried to perform an operation in a bad state (such as ending an interchange before starting one). |
| 1206 | Tried to end an interchange with no contents. |