Home Search

DriveWorks Pro 22
Import Data From An XML File Into Constants And Controls

Send Feedback

Import Data From An XML File Into Constants And Controls

This Specification Flow Task reads data from an XML file and passes it into the Specification for driving into Constants or Controls.

The XML file format is the same as the format used when importing a Specification through DriveWorks Autopilot.

If a Constant is found with the same name (not case sensitive) then the value from that tag will be passed through to the Constant.

If no Constant is found with that name, then it will look for a Form Control with that name to pass the value to.

If no Control is found, then no action will be taken with that tags data.

Child Specifications

Importing Data into Child Specifications is not supported with this task.

Properties

Property NameDescription
TitleChanges the Title (not the name) of the task.
File NameFull Path and File name of the XML file including extension.
Constant NameThe Constant used to report on the success of the Specification task, for reference only.

Example

When this Task is added the properties are static. To be able to build rules on a static property see How To: Change A Static Property To A Dynamic Property.

Property NameExample RuleExample ResultMeaning
File Name"C:\MyDocuments\XMLImport\Import.XML"C:\MyDocuments\XMLImport\Import.XMLThis is the Full File path and name including extension of the XML file to import into DriveWorks.
Constant Name"ImportReporting"ImportReportingThis is the name of the Constant that the task will report to.

Example XML file

XML File
<?xml version="1.0"?>
<Specifications xmlns="http://schemas.driveworks.co.uk/interop/specification/1/0">
    <Specification Transition="Finish" Project="ImportingXML">
        <Input Name="FirstName">Bob</Input>
        <Input Name="SecondName">Jones</Input>
        <Input Name="A">123</Input>
        <Input Name="B">ABC</Input>
    </Specification>
</Specifications>
    

Example Result

NameTypeValue
FirstNameControlBob
SecondNameControlJones
AConstant123
BConstantABC

Using the Task in a Specification Macro

This task has different types of Outputs. For more information about Outputs see Specification Macros Task Node.

Outputs are only available within Specification Macros. Currently Outputs are not available for Specification Flow.

Status Outputs

This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.

The status output navigation is as follows:

Success

  • Data imported successfully.

Success with Warnings

  • N/A - should never be fulfilled.

Failed (one of the following occurred)

  • File Name does not exist or cannot be accessed.
  • File Name cannot be empty.
  • File extension not valid.
  • Unable to read data from XML file.
  • General failure - Check the Specification report for more details.