Versions Compared
Version | Old Version 1 | New Version 2 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
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:
Note |
---|
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.
Expand | ||
---|---|---|
| ||
# 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)
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.
EX: ConcurrentDataFiles=-1 |
ConcurrentProcesses:
Expand |
---|
Can be set in the X Stream definition to run multiple XASN/XINI files at the same time. |
DataMask: Required
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”
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
|
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”
CXTNOW will return the current date at the time of processing within cxtAsp.
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.Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Syntax for the routed ASN configuration is slightly different than on demand, however many similarities exist.
The primary difference is that routed ASN configuration files introduce the concept of using two nodes, one to represent the order information and the other for the parcel information (usually rsMaster and rsSecondary, set with the Nodes configuration item.) In the following examples, the node names of rsMaster and rsSecondary are assumed:
Paste code macro | ||
---|---|---|
| ||
Nodes=rsMaster,rsSecondary |
Data Item Specifications
Data items are set using a Node|Key=Value format.
The syntax of Value varies based on the Delimiter item (i.e., whether input file is XML, delimited, or fixed-width.) Specific examples for each type of input file are provided in the following sections.
For Routed file types, Node|Key must be one of the following:
rsMaster|EncryptedPassword: Required
Expand | |||||
---|---|---|---|---|---|
Specifies whether the X Dispatch Internet User's password has been encrypted. Most of the time, this should be set to true.
|
rsMaster|Password: Required
Expand | |||||
---|---|---|---|---|---|
Password for the X Dispatch Internet User used for placing orders.
|
rsMaster|UserID: Required
Expand | |||||
---|---|---|---|---|---|
X Dispatch Internet User to use for placing the orders.
|
rsMaster|CustID: Required
Expand | |||||
---|---|---|---|---|---|
Customer ID used to place the order.
|
DelayImport: Optional
Expand | |||||
---|---|---|---|---|---|
DelayImport is a parameter to delay the processing of a file by a set number of seconds.
|
NameSpacePrefix: Optional
Expand | |||||
---|---|---|---|---|---|
NameSpacePrefix is a parameter that can be required in some xml inbound documents. If this is being used you will also need to use NameSpaceUri.
|
On This Page:
Table of Contents | ||
---|---|---|
|
Related Articles:
Child pages (Children Display) | ||
---|---|---|
|
Live Search | ||||
---|---|---|---|---|
|