(Optional) Setting File Time-Outs #
You can set the time out period for how long the Import XML Document tool attempts to import a file. If the file cannot be imported, after the expiry time, an error is written to the Event Log.
You do this in the Import XML Document time out interface. You open this interface from the resources tree — expand System > Tools > Input and double-click Import XML Document in the items list.
Adding a Task Step #
To add a new Import XML Document step to an existing task, do the following:
- Open the relevant task (if creating a new task, see How to Create a Basic Task).
- Either:
- Click and drag the Import XML Document icon from the Task Browser to the task Design area.
- From the task’s Design tab, right-click on empty space and select New > Input > Import XML Document.
- In the General tab, Name your task step and select the file to Import.
To do this…
The General tab is used to Name and describe (Description) this task step.
- File name and path from a previous step — Enable this option to import an XML document previously imported by another task step
- Source — Contains all available task steps that have previously imported an XML document
- Path — The full folder path to the location of the XML document; you must ensure the logged in Windows user has read access to the folder specified here
- File Name — The XML document to be imported; use wildcards to import multiple documents at task run-time
- File name and path from a previous step — Enable this option to import an XML document previously imported by another task step
For more information, go to the main General tab topic.
- (Optional) Go to the Main tab and define the XML schema to validate the imported file with.
To do this…
You can define the schema by:
- Manually entering it into the text box
- Importing an existing XSD file — click Browse to XSD/XML File
Click Validate Schema to ensure no errors exist in the XSD file prior to run-time.
Alternatively, the Import XML Document tool can infer the schema from a sample XML document. If you have an example of the XML document imported at run-time, either:
- Copy it into the text box
- Import it into the tool — click Browse to XSD/XML File
Click Infer Schema from XML to define the XSD file, then click Validate Schema to ensure no errors exist in the XSD file prior to run-time.
Once the XML schema has been defined, you can view the expected XML structure in the OutputXML tab.
For more information, go to the main Main tab topic.
- Go to the Options tab and select the relevant error handling options for this task step.
To do this…
The Options tab allows you to define how errors in this step are handled at task runtime.
If an XML validation error occurs when processing the current XML document, you can choose to either Abort Step regardless of whether there are unprocessed files remaining or Continue with the next matching file. If there are no more matching files, the step is completed.
If a file cannot be accessed, you can choose to either Abort Step regardless of whether there are unprocessed files remaining or Continue with the next matching file. If there are no more matching files, the step is completed.
If the step is aborted, you can choose to Continue processing onto the next step in the task, or terminate the whole task immediately (Abort Task).
If the Import XML Document step has attempted to process all available XML documents and has failed (Continue with next matching file has been selected from the previous option sets), you can choose what happens to the whole task itself:
- If no files could be processed, you can choose to Continue processing onto the next step in the task, or terminate the whole task immediately (Abort Task).
For more information, go to the main Options tab topic.
- Click to save the task step.