Contact Us 1-800-596-4880

EDIFACT EDI Connector 2.8 Configuring Schemas - Mule 4

Standard versions of the schemas for all defined EDIFACT messages and supported versions are included with this connector. If your implementation conventions differ from the standard, you can create schemas to describe your messages.

Set Your Schema Locations

To configure schemas in Anypoint Studio:

  1. Switch to the XML view by clicking Configuration XML.

  2. Modify your EDIFACT EDI configuration to include a list of all schemas by adding an <http://edischema[edi:schema]> element for each document type:

<edifact-edi:config name="EDIFACT_EDI__Configuration" identKeys="true" doc:name="EDIFACT EDI: Configuration">
  <edifact-edi:schemas>
    <edifact:schema value="/edifact/d96a/ORDERS.esl"/>
  </edifact-edi:schemas>
</edifact-edi:config>

After you create a global element for your EDIFACT EDI in Studio, configure any schemas and operations.

Configuration Options in XML

All values listed in the Studio configuration can be set directly in XML.

General parameters control both Send and Receive document handling.

XML Value Studio Option

schemas=list of values

List of schema paths the connector can use. Each path can be either a file system or classpath.

stringSubstitutionChar

Substitution character used to replace invalid characters within string values when using the syntax level UNOA or UNOB.

separatorUsage="USE_DEFAULTS" "USE_SPECIFIED_FOR_WRITES" "USE_SPECIFIED_FOR_ALL"

Specification to use either separator or release characters as defaults for messages.

dataSeparator="+"

Data element separator character.

componentSeparator=":"

Component element separator character.

repetitionSeparator="*"

Repetition separator character.

segmentTerminator="'"

Segment terminator character.

releaseCharacter="?"

Release character.

Self-Identification Parameters

Use these parameters to identify your side of the trading partner relationship:

XML Value Studio Option

interchangeIdSelf

Mule interchange Sender or Receiver ID (UNB2.1/UNB3.1).

interchangeIdQualifierSelf

Interchange Sender or Receiver ID qualifier (UNB2.2/UNB3.2).

Partner Identification Parameters

These identify your partner.

XML Value Studio Option

interchangeIdPartner

Partner interchange Sender or Receiver ID for Mule application (UNB2.1/UNB3.1).

interchangeIdQualifierPartner

Partner interchange Sender or Receiver ID qualifier (UNB2.2/UNB3.2).

Parser Parameters for Error Conditions

These control the parser operation and the types of error conditions that reject Receive messages.

XML Value (default) Studio Option

enforceLengthLimits="true"

Enforce the minimum and maximum lengths for receive values.

truncateExceedingMaxLength="false"

Truncate to the maximum lengths for received values.

enforceValueRepeats="true"

Enforce the repetition count limits for receive values.

enforceReadCharacters="true"

Enforce valid characters for a Read operation. Only applies when using syntax levels UNOA and UNOB.

allowUnknownSegments="false"

Allow unknown segments in a message.

enforceSegmentOrder="true"

Enforce the segment order in a message.

allowUnusedSegments="false"

Allow segments marked as Unused in a message.

enforceSegmentRepeats="true"

Enforce segment repetition count limits in a message.

receiveEncodingOverride="false"

Java character encoding used for Receive messages. This overrides receive UNB.

requireUniqueInterchanges="true"

Require unique interchange control references (such as UNB.5). The default behavior records the interchange numbers previously processed and rejects duplicate interchange numbers from the same partner. It is derived from the interchange Sender and Receiver identification. Setting to false enables received interchange processing to continue and relies on the application flow to track the numbers and manage them appropriately.

requireUniqueGroups="false"

Enforce globally unique group control numbers (UNG.5) for received functional groups. By default, group control numbers must be unique only within an interchange. Setting this value to true requires group numbers to be unique across all interchanges received from the same partner and application, as determined by the interchange sender and recipient identification.

requireUniqueMessages="false"

Enforce globally unique message reference numbers (UNH.1) for received messages. By default, message reference numbers must be unique only within a particular interchange. Setting this value to true requires message reference numbers to be unique across all interchanges received from the same partner and application, as determined by the interchange sender and recipient identification.

daysToStore="30"

Minimum number of days to store interchange, group, and message numbers for uniqueness checking.

enforceCodeSetValidationsParse="false"

Enforce code set validations on the Read operation.

parseUseVersionAssociationCode="false"

Enforce Edifact version using UNH0205 (association code) on the Read operation.

Writer Parameters

These control the types of writer operations.

XML Value (default) Studio Option

characterEncoding="ASCII_B"

Character encoding used for writing messages. There must be one defined in each EDIFACT syntax version.

sendSyntaxVersion="VERSION4"

Syntax version for Send messages. Used to determine the data structures for service segments and CONTRL acknowledgment message structures in DataSense metadata for both Send and Receive.

lineEnding="NONE" "LF" "CRLF" "CR"

Line ending to add between segments. Improves the readability of the output message text by adding line endings between segments.

writeUseCRLFLastLine="false"

Use the configured Segment Line Ending value at the end of the last line.

alwaysSendUNA="false"

Always send the UNA service segment. A UNA is included only in an interchange when the syntax separator characters don’t match the defaults for both the syntax version and character encoding when in use. Setting to true means a UNA is always sent.

enforceWriteCharacters="true"

Enforce valid characters for a Write operation. This applies when using syntax levels UNOA and UNOB.

useWriteFunctionalGroups="false"

If true, the connector classifies each message by the corresponding functional group (UNG-UNE), according to its type. By default, the connector doesn’t classify messages by functional group.

sendUniqueGroupNumbers="false"

Send unique group reference numbers (UNG.1). By default, message reference numbers are assigned sequentially within each interchange and are reused in a different interchange. If true, the connector assigns unique message numbers across all interchanges sent to the same partner, as determined by the interchange sender and recipient identification.

sendUniqueMessageNumbers="false"

Send unique Message Reference Numbers (UNH.1). false (default) assigns message reference numbers sequentially within each interchange and reuses them in a different interchange. true assigns unique transaction set numbers across all interchanges sent to the same partner. It is derived by the interchange sender and recipient identification.

initialInterchangeReference="1"

The initial interchange control reference used for outgoing messages.

initialGroupReference="1"

The initial group reference number used for outgoing messages.

initialMessageReference="1"

The initial Message Reference Number used for outgoing messages.

requestAcks="false"

Request acknowledgments for Send interchanges using the Acknowledgment Request field (UNB.9).

testIndicator=""

Test indicator digit used on Send interchanges (UNB.11). By default interchanges are not sent as tests.

useSuppliedValues="false"

Choose your own data values for control-segment identifiers such as UNB and UNZ segments or use the supplied values. false always generates control numbers when writing letting you choose values.

outputEdiMimeType="APPLICATION_PLAIN"/"APPLICATION_EDIFACT"

Output MIME type of the message.

writeInterchangeControlNumberKey=""

Interchange number key for the object store. If a key is specified, it is used for subsequent operations that use the object store for interchange control numbers.

writeGroupControlNumberKey=""

Group control number key for the object store. If a key is specified, it is used for subsequent operations that use the object store for group control numbers.

writeMessageControlNumberKey=""

Message control number key for the object store. If a key is specified, it is used for subsequent operations that use the object store for message control numbers.

writeEnforceLengthLimits="true"

Enforce minimum and maximum lengths for write values. The default of true throws an exception when an element is too long or too short. false leaves the values as-is.

writeTruncateExceedingMaxLength="false"

Truncate to the maximum lengths for received values.

enforceCodeSetValidationsWrite="false"

Enforce code set validations on the Write operation.

writeUseVersionAssociationCode="false"

Enforce Edifact version using UNH0205 (association code) on the Write operation.

Write-Batch Parameters

These control the types of write-batch operations.

XML Value (default) Studio Option

batchCharacterEncoding="ASCII_B"

Character encoding used for writing messages. There must be one defined in each EDIFACT syntax version.

batchSendSyntaxVersion="VERSION4"

Syntax version for Send messages. Used to determine the data structures for service segments and CONTRL acknowledgment message structures in DataSense metadata for both Send and Receive.

batchLineEnding="NONE"/"LF"/"CRLF"/"CR"

Line ending to add between segments. Improves the readability of the output message text by adding line endings between segments.

batchUseCRLFLastLine="false"

Use the configured Segment Line Ending value at the end of the last line.

batchAlwaysSendUNA="false"

Always send the UNA service segment. A UNA is included only in an interchange when the syntax separator characters don’t match the defaults for both the syntax version and character encoding when in use. Setting to true means a UNA is always sent.

batchEnforceWriteCharacters="true"

Enforce valid characters for a Write operation. This applies when using syntax levels UNOA and UNOB.

batchSendUniqueMessageNumbers="false"

Send unique Message Reference Numbers (UNH.1). false (default) assigns Message Reference Numbers sequentially within each interchange and reuses them in a different interchange. true assigns unique transaction set numbers across all interchanges sent to the same partner. It is derived by the interchange sender and recipient identification.

useBatchFunctionalGroups="false"

If true, the connector classifies each message by the corresponding functional group (UNG-UNE). By default, messages are not classified by functional group.

batchSendUniqueGroupNumbers="false"

Send unique group reference numbers (UNG.1). By default, the connector assigns message reference numbers sequentially within each interchange and reuses them in different interchanges. If true, the connector assigns unique message reference numbers across all interchanges sent to the same partner, as determined by the interchange sender and recipient identification.

batchInitialInterchangeReference="1"

The initial interchange control reference used for outgoing messages.

batchInitialGroupReference="1"

The initial group reference number used for outgoing messages.

batchInitialMessageReference="1"

The initial Message Reference Number used for outgoing messages.

batchRequestAcks="false"

Request acknowledgments for Send interchanges using the Acknowledgment Request field (UNB.9).

batchTestIndicator=""

Test indicator digit used on Send interchanges (UNB.11). By default interchanges are not sent as tests.

batchUseSuppliedValues="false"

Choose your own data values for control-segment identifiers such as UNB and UNZ segments or use the supplied values. false always generates control numbers when writing, letting you choose values.

batchOutputEdiMimeType="APPLICATION_PLAIN"/"APPLICATION_EDIFACT"

Output MIME type of the message.

batchInterchangeControlNumberKey=""

Interchange number key for object store. If a key is specified, then that key is used for subsequent operations involving the object store for interchange control numbers.

batchGroupNumberKey=""

Group control number key for the object store. If a key is specified, it is used for subsequent operations that use the object store for the group control numbers.

batchMessageControlNumberKey=""

Message control number key for an object store. If a key is specified, it is used for subsequent operations that use the object store for the message control number.

batchEnforceLengthLimits="true"

Enforce minimum and maximum lengths for write values. If true, a element with values too long or too short throws an exception; if false, the values are used anyway.

batchTruncateExceedingMaxLength="false"

Truncate to the maximum lengths for received values.

enforceCodeSetValidationsBatch="false"

Enforce code set validations on the Write Batch operation.

batchUseVersionAssociationCode="false"

Enforce Edifact version using UNH0205 (association code) on the Write Batch operation.

Next Step

After you complete configuring the connector, you can try the Examples.

View on GitHub