One moment please...
 

How to schedule XConnector activities

 

The XConnector can fully automatically handle its activities.


The task scheduler launches the XConnector with a Command String. This Command String has all the information needed by the XConnector.
The XConnector generates an XML file based on the Source file and import definition.
After this the XConnector can start the Exact import module (ASImport) to automatically import the XML file into Exact.
All these activities are logged in the XConnector.log for later review.

The XConnector generates a Command String automatically.

Create a Command String

Start the XConnector and fill the correct data in the form.

 

 

1) Import type: Select the import type
2) Definition: Choose the import definition file to be used
3) Source file: Choose the source file to be used
4) Delete source(s) The source files will be deleted after the XML file is generated. A backup copy of the file will be put in a sub folder named "OLD" in the same folder as the source file.
5) Target location This folder is used to store the generated XML file.
6) Copy source directory This button copies the folder location of the source file (3) to the Target location (6)
7) Import into Exact The generated XML file will be imported into Exact automatically. For this the AsImport.exe or Exact.XML.Launcher.exe (Globe+) of the Exact program installation must be given (10).
Also a the Exact license must have XML server.
8) Companies The XML file will be imported in the selected companies. This can be one or more companies.
9) Create master data For some import topics the Exac import module can create missing master data automatically.
10) Exact import module For Exact Globe the ASImport.exe should be selected.
(For Exact Globe+ it is Exact.XML.Launcher,exe) 
This file is located in the Exact Software bin folder on your workstation.


Once the XConnector form has the correct settings the Command String will be generated automatically.
Tip: Test the correct functioning of these settings made in the XConnector and make sure the XML file is generated and imported into Exact without problems.

Go to menu: [File - Create Command String]




The Command String is created.
Now press the button [Copy to Clipboard] button to copy the Command String to the clipboard.
The Command String is created based on the settings made on the XConnector form and copied to the clipboard.

An example of a Command String looks like this:

"C:\\XConnector\XConnector.exe"
-tProjects
-iC:\Data\ProjectImport\Definition Projects.csv
-sC:\Data\ProjectImport\ImportFile Projects.xls
-lC:\Data\ProjectImport
-ODelete
-OImport
-d001
-OAuto

It is not necessary to edit the Command String, but the syntax is the following:

-t Topic to be imported  
-i Import definition  
-s Source file  
-l Target location The location where the XML file is put
-d Exact database(s) if more than one database is used these should be separated by "|" (pipe)
example: -d001|002|003
-o Options

possible options are:

Validate

Validate option is used

Delete

NoDelete

Source file(s) are deleted from the source directory and copied to old directory
By default the files are archived to the old directory.
Source files(s) are NOT deleted from the source directory. (available from version 4.41)
This can be useful when the same source file is needed for a second XML generation.



Auto


The XConnector screen is hidden and automatically start the import into Exact.
Removing this option will open the XConnector with the settings and options set above, but will not execute it.
This can be usefull for testing purposes.

Using wildcards in the sourcefile

By using wildcards it is possible to have the XConnector process multiple files in one command.
Supported wildcard characters are:
? - for a single character
* - for zero or more characters

Examples:

C:\sourcefiledirectory\*.* All the files in the C:\sourcefiledirectory are processed by the XConnector
C:\sourcefiledirectory\*.xls Files with the extention XLS are processed by the XConnector
C:\sourcefiledirectory\orders*.xls Filenames starting with "orders" and having the extention XLS are processed by the XConnector
so: "orders01.xls", "orders02.xls", "orders03.xls" and "orders_20220419.xls" are processed
C:\sourcefiledirectory\invoices??.*

Filenames starting the "invoices" followed by two characters or numbers with any extention are processed by the XConnector
So: "invoices01.xls", "invoices02.csv", "invoices03.csv" are processed.
Files not meeting these conditions, like: "invoices555.xls" and "orders01.csv" will not be processed.

 

Schedule the job

Now it can be used in scheduler like Windows Task Scheduler of MS SQL Agent.
It is also possible to put the Command String in a batch file and execute this batch file with a scheduler.
After the Command String is create the XConnector can be closed.

Checking the result of the import

The result of the XConnector actions can be monitored in various ways.
- The imported data in Exact.
- The import log in Exact: menu [XML - Other import - Results]  (Nederlands: [XML - Overige import - Resultaten]
- The history or log of the scheduler application.
- The XConnector log, located in the XConnector.exe directory.


The XConnector log reports the following action:


(the log file should be read buttom-up. So the newest actions are at the top)
Some remarks:
Line 13. the Command String which started the XConnector
Line 12. the number or records processed into XML
Line 11. the target XML file
Line 10. Indicates that the import has started
Line 8. the command which started the Exact import
Line 7. the import batch number in Exact
Line 5 and 3. the result reported by Exact

Historical files

Because the option Delete was set in the Command String the Source file moved to the old directory.
The original file name is extended with the date and time of the import. In the example below "20090720_1421" (yyyymmdd_hhmm).
This to prevent multiple import of the same data.


In case the XConnector is launched and no source file is present, no XML file will be generated and no import will be done.
The log file will state: "Source file does not exist."


Doc id: 00.001.948