EDIFACT EDI Connector 2.1- Configuring Schemas - Mule 4

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

Set Your Schema Locations

You can configure schema locations in the Anypoint Studio XML view.

  1. In Anypoint Studio, 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 in Studio for your EDIFACT EDI, 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 connector schemas paths. These are for 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"

Use specified 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 Studio Option

enforceLengthLimits="true"

Enforce the minimum and maximum lengths for receive values

enforceValueRepeats="true"

Enforce the repetition count limits for receive values

enforceReadCharacters="true"

Enforce valid characters for read. This only applies when using syntax levels UNOA and UNOB

allowUnknownSegments="false"

Allow unknown segments in a message

enforceSegmentOrder="true"

Enforce 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 (UNB.5). Records the previously processed interchange numbers and rejects any duplicate interchange numbers from the same partner. This is determined by the interchange sender and receiver identification. If set to false, it processes the received interchange and leaves it to the application flow to track numbers and handle appropriately.

requireUniqueMessages="false"

Enforce globally unique Message Reference Numbers (UNH.1) for received messages. By default, message reference numbers only need to be unique with a particular interchange. If set to true, this requires message reference numbers to be unique across all interchanges received from the same partner and application. This is determined by the interchange sender and recipient identification.

daysToStore="30"

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

Writer Parameters

These control the types of writer operations:

XML Value Studio Option

characterEncoding="ASCII_B"

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

sendSyntaxVersion="VERSION4"

Syntax version for Send messages. Also 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, defaults to NONE. Allows adding line endings between segments to improve the readability of the output message text.

alwaysSendUNA="false"

Always send the UNA service segment. With a default of false, a UNA is only included in an interchange when the syntax separator characters don’t match the defaults for the syntax version and character encoding in use. If set to true, a UNA is always sent.

enforceWriteCharacters="true"

Enforce valid characters for write. Only applies when using syntax levels UNOA and UNOB.

sendUniqueMessageNumbers="false"

Send unique Message Reference Numbers (UNH.1). By default, message reference numbers are assigned sequentially within each interchange and reused in a different interchange. If set to true, it assigns unique transaction set numbers across all interchanges for sending to the same partner. This is determined by the interchange sender and recipient identification.

initialInterchangeReference="1"

The initial Interchange Control Reference 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 supplied values. The default is always to generate control numbers when writing allowing you to use chosen values.

Next Step

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