Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Next »

When importing data into X Dispatch, it is important to know the structure of an X Import configuration file. There are two types of files, which can be distinguished by their file extension. XINI files are On Demand configurations, while XASN files are routed. Both types of files will be discussed below.  The structure is as follows:

Before version 1.3.1, these entries are case sensitive.  Please make sure to enter these values as they appear.

Comments

Comments are indicated by the '#' character and continue to the end of the line

Comments can begin at the beginning of a line, or after an Item.

 Example

# This is a comment

OriginName=0,CXT Software # This is also a comment

Configuration Items

There are two different types of items: Configuration Items, and Data Items. This section deals with configuration items. Data Items will be more thoroughly examined in the following sections.

  • DataPath=C:\ximport\inbox # example comment

  • DataMask=XML

  • Inherit=0

  • ProcPath=C:\ximport\Processed

  • ErrPath=C:\ximport\Errors

  • # another comment

  • URL=http://127.0.0.1/SampleWeb/XMLListener.asp

  • Delimiter=XML

Configuration items are set using a Key=Value format, where key must be one of:

ConcurrentDataFiles: Optional (starting in version 1.2.0)

 Click here to expand...

This value is set to the number of concurrent data files to be processed. This value will tell the system how many parallel processes to attempt to create. The system will only create up to that many of processes at one time. If you set this value to -1 it will tell the system to create as many as it can.

This value can be used in both the XINI and XASN file types.

If this value is NOT set, it will default to 1 to mimic current functionality.

EX: ConcurrentDataFiles=-1

ConcurrentProcesses:

 Click here to expand...

Can be set in the X Stream definition to run multiple XASN/XINI files at the same time.

DataMask: Required

 Click here to expand...

Specifies the extension of the import files (e.g., xml, txt, *).

N.B.: To disregard the file extension, you may use '*', however the DataMask item should be set whenever possible to prevent the processing of unintended files. Many times, third-party companies sending the import files will upload the file with a ".tmp" extension and rename the file to the correct extension only once the upload has been completed. If the DataMask is set to '*' these temporary files may be processed before they have been completely transferred.

EX: DataMask=xml

Data Items

There are three types of Data Items: static, dynamic, and macro.

Static Data Items

Static data items allow you to populate fields with known values. For example, if all of the deliveries sent in on an ASN will be assigned the same order type, origin address, etc. Static data items can be set by prepending the argument with “0,” followed by the static value.

 EX: UserID=0,ximport-mckesson

Macro Data Items

Macro data items allow you to populate fields with certain pre-defined macros. Currently, the only supported macros are the following:

  • NOW will return the current timestamp at the time of processing, e.g. “04/20/2008 11:11”

     Click here to expand...

    AKA "Server Time"  This would be the time of the server on which X Import is running. Time may be added and subtracted in minute increments by appending the appropriate math after the “NOW” routekeyword

    • “NOW+30” in the example above would be “04/20/2008 11:41”
    • “NOW-30” in the example above would be “04/20/2008 10:41”
  • TODAY will return the current date at the time of processing with the time set to 12:00 AM, e.g. “04/20/2008 00:00”

     Click here to expand...


  • CXTNOW will return the current date at the time of processing within cxtAsp.

     Click here to expand...


EX:

PickupDate= NOW+360

DeliverDate=TODAY+2

Macro data items can also be manipulated to add time offsets. For example, if you receive an ASN for same day delivery and the file comes in at inconsistent times (11 PM one day and 1 AM the next), using the above macros may not be sufficient. For these cases, it is possible to add a time offset and then apply a date transformation.

If you want to accept a same day ASN before 3 PM, but roll everything after 3 PM to the next day, you could do the following:

EX: PickupDate=NOW&09:01|DAYFLOOR

The syntax for this type of macro manipulation is in the following form: Item=Macro&[OffsetHours:]OffsetMinutes|Transformation

Where:

Item is a valid Data Item for the configuration file.

Macro must be one of: NOW (see NOTE below) or TODAY.

OffsetHours specifies the number of hours to add to the evaluated macro (required)

OffsetMinutes specifies the number of minutes to add to the evaluated macro (required)

Transformation is one of:

DAYFLOOR: Set the resulting time to 00:00

DAYUPPER: Set the resulting time to 00:00 and adds one day

WEEKDAYFLOOR:  Behaves similarly to DAYFLOOR.  If the time, after adding the OffsetHours and OffsetMinutes, is on a Saturday or Sunday, it will be pushed to the following Monday and then set the resulting time to 00:00 (NOTE:  WEEKDAYFLOOR was added in 12.0.6 in ticket MAIN-2096)

NOTE: NOW is a macro that pulls the SERVER time, not the time local to the customer.  The server time for Hosted customers is always AZT and the imported files will show the time local to the customer. In the example above, if the customer’s local time is EST you would need to add 3 hours to the syntax example:

EX: PickupDate=NOW&12:01|DAYFLOOR

Dynamic Data Items

Dynamic data items allow you to set an item’s value based upon the type of input file and are discussed in the following two sections.

  • No labels