Creating an EDIFACT document structure

Creating an EDIFACT document structure

 

Why Create an EDIFACT document structure?

SmartBridge recognizes EDIFACT documents by default, and is able to process all the default metadata. So, why create a document structure?

EDIFACT document structures are useful in case you need to extract more data than commonly required.

Step 1: Preparation

The general 'Preparation, Configuration, and Testing' process applies to Document Structures of all types, especially the Preparation phase. To learn more about the preparation for any Document Structure definition, follow the steps in Configuring Document Analysis & Document Labeling: Document Structures.

After that:


  1. Click on the  +  at the bottom of the page and select ‘Add EDIFACT’.

  2. Have an EDIFACT test document ready.

 

Step 2: Configuration

Step 2a: Selecting the specific EDIFACT document

As EDIFACT documents are identified by default, SmartBridge allows you to filter out a specific EDIFACT document using several metadata properties: document type, subtype, sender, recipient, and the test indicator. The Document structure selection rules allow you to indicate the specific EDIFACT document for which you are creating a custom Document Structure.

Sample settings:

FormatTypeSubTypeSenderRecipientTest indicatorResult
EDIFACTAnyAnyAnyAnyAnyAll EDIFACT documents will use this Document Structure.
EDIFACTORDERSAnyAnyAnyAnyOnly EDIFACT documents that are ORDERS will use this Document Structure.
AnyORDERSAnyAnyAnyAny 


Step 2b: Value retrieval options

In case your EDIFACT document is not fully standards compliant you can have SmartBridge handle these customizations:

OptionWhat is itHow to use it
True value for test indicatorUse this option in case the document uses a non-standard test indicator. The EDIFACT standard test indicator is: 1.Enter an alphanumeric value that represents the custom test indicator.
Values separatorUse this option in case the document could contain multiple values for a single attribute (e.g. a series).Enter a separator.

Step 2c: Setting metadata

Depending on what data is available in the document, your configuration involves:

  • Providing your own static values for standard metadata.
  • Adding custom metadata.

Usage:

MetadataWhat to do
For values that can be extracted from the document.
  • Set 'is Xpath' to 'true'.
  • Set 'Value' to the Xpath necessary to locate a specific value in the document.
  • For values that cannot be extracted from the document.
  • For extractable values that you want to overwrite.
  • Set 'is Xpath' to 'false'.
  • Set 'Value' to a static value.

These values support macro substitutions for using document properties or system settings. See the Workflow Macros Reference for more details and examples.

For custom metadata.Click on the '+' below the metadata table to add a new row.
 EDIFACT Xpath example »

 Example:

Suppose you need to extract the code of NAD/DP from a D96A EDIFACT ORDER. The Xpath could be:

/Ichg/Msg[1]/Grp2/NAD[e3035='DP']/C082/e3039

Xpath is case sensitive.

These are the standard attributes necessary for each document.

Attribute

What you should enter

Example value

SenderIdentifier

The Sender Identifier includes the actual data that identifies the sender (for example, if the Sender Identifier type is EAN, the Sender Identifier will be the EAN number itself). Usage:

  • Set the XPATH expression to locate where in the document the Sender Identifier is defined, and set ‘Is XPath’ to True.
  • Alternatively, you can also set a self-defined value if necessary. In that case, set ‘Is XPath’ to False.

 

 

SenderIdentifierType

By setting the Sender Identifier Type SmartBridge understands in which way the Sender Identifier should be interpreted (for example, EAN). Usage:

  • Set the XPATH expression to locate where in the document the Sender Identifier Type is defined, and set ‘Is XPath’ to True.
  • Alternatively, you can also set a self-defined value if necessary. In that case, set ‘Is XPath’ to False.

 

 

RecipientIdentifier

The Recipient Identifier includes the actual data that identifies the sender (for example, if the Recipient Identifier type is EAN, the Recipient Identifier will be the EAN number itself). Usage:

  • Set the XPATH expression to locate where in the document the Recipient Identifier is defined, and set ‘Is XPath’ to True.
  • Alternatively, you can also set a self-defined value if necessary. In that case, set ‘Is XPath’ to False.

 

 

RecipientIdentifierType

By setting the Recipient Identifier Type SmartBridge understands in which way the Recipient Identifier should be interpreted (for example, EAN). Usage:

  • Set the XPATH expression to locate where in the document the Recipient Identifier Type is defined, and set ‘Is XPath’ to True.
  • Alternatively, you can also set a self-defined value if necessary. In that case, set ‘Is XPath’ to False.

 

 

DocumentType

  • Set the XPATH expression to locate where in the document the message type is defined (for example, ORDER), and set ‘Is XPath’ to True.
  • Alternatively, you can also set a self-defined value if necessary. In that case, set ‘Is XPath’ to False.

 

 

DocumentSubType

  • Set the XPATH expression to locate where in the document the Document Subtype is defined, and set ‘Is XPath’ to True.
  • Alternatively, you can also set a self-defined value if necessary. In that case, set ‘Is XPath’ to False.

 

 

DocumentNumber

  • Set the XPATH expression to locate where in the document the Document Number is defined, and set ‘Is XPath’ to True.
  • Alternatively, you can also set a self-defined value if necessary. In that case, set ‘Is XPath’ to False.

 

 

TestIndicator

Value that indicates whether the document is used for testing purposes. Usage:

  • Set the XPATH expression to locate where in the document the Test Indicator is defined, and set ‘Is XPath’ to True.
  • Alternatively, you can also set a self-defined value if necessary. In that case, set ‘Is XPath’ to False.
 

You can add custom metadata using the plus sign below the 'Document attributes' table.

Usage:

  • For metadata you would like to add: create a new line in the 'Document attributes' table, specify a unique name in the 'Name' column, enter the necessary XPath expression in the 'Value' column, and set ‘Is XPath’ to ‘true’.

 

Step 3: Test your Document Structure


 Visual explanation


  1. Have the test file ready (see Step 1).
  2. In the upper right-hand corner click on the test button:

    A new window will open.

  3. Click on Browse... to select the test file, for testing whether the new Document Structure matches your test file.

  4. (Optional step unless your Document Structure uses communication attributes) Configure the Inhouse Recognition Parameters section.
  5. Click on Test to analyze your file. You will see all the information SmartBridge is able to extract from the document, using the Document Structure that you created.

  6. Review the Results section. Correct your Document Structure in case you run into unexpected results (e.g. when the results show the name of a different Document Structure), then test again.

 

You might run into unexpected results when you test a Document Structure definition that contains Macros.

 Click here to expand...

In most cases SmartBridge is able to set these Macros in case a communication module first processes the document. However, this testing method does not use a communication module for testing. As a consequence, during this type of testing you will likely encounter unprocessed Macros in the test results. This is expected behavior.

Read the FAQ to learn more »



On this page