Message Standards

Overview

Crossfire supports Delimited, Fixed, Xml, OleDb, EDIFACT, and X12 Message Standards.

All Message Standards can be exported to an Xml file and stored on disk. They can then be imported to another system, or back into the original system if the Standard was deleted. This is a common way for people to share standards. It is also common for people to use this method to move Message Standards between test and live environments.

When a Message Standard is created, it is given a unique reference to prevent it from being imported twice.

Delimited, Fixed, Xml and OleDb Message Standards can be created from scratch. EDIFACT and 12 Message Standards must be imported from the standards library at Sandfield.

Common Concepts

Replace data element characters: This will replace values inside a data element with another value use the following syntax – “value, value to replace, value2, value to replace 2”

If you need to replace non-alphabetic characters or non-printable characters, then you can use the #Code value for ASCII codes between 1-31. E.g. replacing a tab would be #TAB. The complete list is available at www.asciitable.com

To replace commas, use ┘ (Alt, 217 on the number pad)

Replace interchange characters: Commonly used to remove unwanted lines, elements, characters from Interchanges. Works exactly the same as above.


NameSpaces:

A NameSpace is a way of grouping nodes together it ensures that if objects are given a unique name they can be identified.

The namespace declaration has the following syntax. xmlns:prefix="URI".

example of how you would layout a NameSpace:

Prefix: soapenv

URI: http://schemas.xmlsoap.org/soap/envelope/

Prefix: sal

URI: http://www.paperless-warehousing.com/YourCompany/SalesOrderToWMS


Note: when you add this in the message standard ensure that your Prefix looks has xmlns: xmlns:sal


Moving Elements, Segments, Groups

Elements can be dragged up and down within the same segment to move their sequence.

Segments and Segment groups can be dragged up and down with in the same group to change their sequence. They can also be directly dropped on to another group to be moved within it.

Delimited Messages

When creating delimited Message Standards, you may have multiple separators, however in the majority of cases (CSV, TSV, PSV) files, the ‘Data Element Separator’ is the one you use.

If you’re creating a CSV standard, then place a ‘,’ in the ‘Character’ field of data element separator. This is all that is required. End of Line characters are assumed as segment terminators by default.

If your CSV file requires that alphabetic values surrounded in quotes, then put a quote (“) mark into the Character field of ‘Text qualifier’.

When completed, click on the Definition tab.

Right click on the name of the message on the left, and click add Segment.

In most cases, for delimited messages, segments are lines and data elements are the values which are separated.

When you name your segment, the tag value, length and position will be automatically populated. You may override these if required. This is how Crossfire knows which segment is which.

If your standard does not have tag values, then under the advanced section, change the Logical operator to ‘None’. Note that if your segment repeats and you do this, it may not validate correctly.

Name: Name of your segment, shows in the tree view

Description: Description of your segment, not used for any other purpose

Required: If the segment is missing, an error will be generated

Repetition count: Maximum number of times this segment may repeat

Tag value: The part of the message which identifies this segment

Logical operator: How the segment value is matched against the tag value to confirm a match.

Tag Length: Number of characters to read from the segment for the tag value

Tag Position: Position in the segment to start reading characters for the tag value

New message after: A new message will be created after this segment has been processed.

Example:

Segment is: HDR,1,22,BLACK CHAIR

The tag value could be HDR, tag length 3, tag position 1, logical operator =.

We obtain the first 3 characters from position one, and check if they equal the tag value. If they do, then we assume the correct segment has been found.

If the logical operator was ‘not equal’ then we would check if they did not equal and then assume we had found our segment.

For the contains logical operator, use comma separators.

Once the segment has been created, add one data element for each value which is delimited. If it is required, check the required checkbox. An error will be displayed if a required element is missing.

Rinse and repeat until the full standard is completed. If you have two repeating lines which repeat after each other in a continual fashion. Put a segment group around them.

Fixed Message Standards

Works the same as delimited messages, except there is no separator required. When creating fixed length messages, you will notice that the ‘Fixed Length’ checkbox is checked and greyed out.

Segment matching works exactly the same was as delimited messages.

Xml Message Standards

Standards can be created using the interface manually, but the best way is to import a sample file and Crossfire will automatically build your Xml message standard for you.

For Xml messages, the Tag Position, Logical Operator, and Tag Length do not apply, but the Tag Value must match the Tag in the Xml.

When building Xml messages, all segments have a segment group directly below them, unless they have no child segments. The importer will do this for you.

The following Xml specific options are available when you create an Xml Standard.

Xml Type: Defined on data element is the best choice here. This allows you to specify on each element if it is an attribute or element. If your message uses only attributes or only elements, then you can select those, these cases are rare.

Data type: This validates the format of the data element and makes sure it matches the one selected. A custom option is available where you can supply your own regular expression to match against the data element.

Validation pattern: This is available if the custom data type is selected and is where you supply your own regular expression to match against. Below shows an example where the validation checks the value inside the <Segment> tags is a single character out of a, b or c. The value is z so the validation failed and the below error is given.

Remove Empty Elements: One of the following, should be self explanatory:

Convert empty elements to short tags (e.g. <sample /> instead of <sample></sample>)

Remove if there are no attributes

Remove if there are attributes, but they are all blank

Always remove empty elements (even if they have attributes)

Don’t ever remove empty elements

Xml Header: Any Xml to include before the message. Can be useful to save hours of mapping.

Xml Footer: Same as header, but for the footer.

Note: The option to include the Xml declaration is available on the Process page.

XML Namespace:

Xml namespaces with the prefix must be added under the 'Xml Namespaces' tab, this is used for validation, if the namespace is to be added as a prefix, it needs to be done on the element:

Add prefixes into the element definition, or add the name space (xmlns) element into the message standard.

Note that the following XML is identical - the namespace can be specified using a prefix, or as a parent element.

<?xml version="1.0"?>

<ns:NotifyShipment xmlns:ns="http://www.openapplications.org/oagis/ASN/9">

<ns:ApplicationArea>

<ns:Sender>

<ns:LogicalID>http://www.tweglobal.com</ns:LogicalID>

<ns:ComponentID>US</ns:ComponentID>

<ns:ReferenceID>Order :406650/ OrderType :OT/ Order Company :30005</ns:ReferenceID>

</ns:Sender>

<?xml version="1.0"?>

<NotifyShipment xmlns="http://www.openapplications.org/oagis/ASN/9">

<ApplicationArea>

<Sender>

<LogicalID>http://www.tweglobal.com</LogicalID>

<ComponentID>US</ComponentID>

<ReferenceID>Order :406650/ OrderType :OT/ Order Company :30005</ReferenceID>

</Sender>

OleDb/Excel Message Standards

These are the same as delimited message standards, but with fixed delimiters and encodings which are used in combination with the OleDb Transports to achieve the neccessary outcome in an Excel spreadsheet.

X12, EDIFACT Message Standards

These cannot be created from scratch, but instead only imported into Crossfire. Sandfield has a library of EDIFACT message standards and can provide them at request. We expect to have these available for download directly from the Crossfire website this year.

Once these have been imported, they can be modified like any other standard. This is required for when Partners do not follow the standards correctly.

You may also remove large unused segment groups from the standard after importing. This can make working with large standards a little easier.

To import a standard, just enter a name and click import, and choose the file.

Importing / Exporting

Message standards can be moved between systems. Clicking ‘Export’ will produce an Xml file which can be saved to disk and loaded into another Crossfire system.

This is useful for moving between systems and moving between test and live.

If you wish to import a Message Standard that already exists, it will not allow you to do so. The unofficial solution is to open the Xml file and modify the guid=”xx” and change the guid value.

A solution to this is on the road map.

Code Lists

After defining a <link>code list</link>, the user is able to assign the code list to a data element in the mapping. When the message is being processed/mapped, the incoming value will be searched against the code column in the code list and then replaced with the value in translation.