Home Search

DriveWorks Pro 22
Export Specification Data

Send Feedback

Export Specification Data

The Export Specification Data Macro Task allows you to export the Specification data of a Specification that you are running into either a XML or JSON file format.

The Task will export all Controls that are editable that are contained within the Specification being exported. The Controls that are editable are:

  • Check Box
  • Combo Box
  • Date Picker
  • List Box
  • Measurement Text Box
  • Numeric Text Box
  • Option Button
  • Option Group
  • Slider
  • Spin Button
  • Text Box

The Task will also let you select which Constants and Project Tables to export.

Please note the only type of Project Table that you can export is a Simple Table.

Properties

Property NameDescription
Constants To IncludeA pipebar delimited (|) list of Constants to include in the export.

This defaults to * when the Task is added.

Project Tables To IncludeA pipebar delimited (|) list of Project Tables to include in the export.

This defaults to * when the Task is added.

Export FormatThe file format to export in; XML or JSON.

This defaults to XML when the Task is added.

Overwrite FlagTRUE to make the component overwrite the existing file (if one exists) regardless of the Group's overwrite setting. FALSE to not overwrite the existing file.
Output File NameA path to the file that will contain the exported Specification data. The path can be Absolute or Relative to the Project file.
(Title)

A brief description of the purpose of the Task/Condition.

When applying this Task to a Specification Macro the title can be changed by clicking in the header of the applied Task or by using the Rename button found on the Command bar. For more information see Specification Macro Editor.

Example

When this task is added the properties are static by default.
See How To: Change A Static Property To A Dynamic Property to enable rules to be built on these properties.

Example Specification Data

Specification ItemNameValue
ConstantConstant A1
ConstantConstant B2
ConstantConstant C3
Simple TableTable A{"ID","First Name","Second Name";"1","John","Smith";"2","Sam","Jones";
"3","Eric","Coates"}
Simple TableTable B{"ID","Manufacturer","Type","Age";"1","Audi","A4","5";"2","Ford","Fiesta",
"3";"3","Citroen","C1","7"}
Simple TableTable C{"ID","Spare Parts","Quantity";"1","O rings 10mm","32";"2","Engine Oil 1L","6","3","Windscreen Wipers","7"}
Text Box ControlFirst NameEric
Numeric Text Box ControlCar Age7
Combo BoxItem Quantity1

Example 1

Property NameExample RuleExample ResultMeaning
Constants To Include"*"*This will export all the Constants that exist in the Project.
Project Tables To Include"*"*This will export all the Project Tables that exist in the Project.
Export Format"XML"XMLThis will export the Specification Data as an XML file.
Overwrite FlagTRUETRUEIf the File already exists this will overwrite that file.
Output File Name"C:\MyDocuments\Specifications\
ExportedData\Export"&DWSpecificationId
C:\MyDocuments\Specifications\
ExportedData\Export 9999
This is the location and the name of the file that will be exported. The file in this case will be called Export 0043.

Example 2

Property NameExample RuleExample ResultMeaning
Constants To Include"DWConstantConstantA|DWConstantConstantC"DWConstantA|DWConstantCThis will export just the specified Constants given in the pipebar delimited (|) list.
Project Tables To Include"Table A"Table AThis will export this Table.
Export Format"JSON"JSONThis will export the file as a JSON file.
Overwrite FlagFALSEFALSEIf the file already exists this will not overwrite it.
Output File Name"C:\MyDocuments\Specifications\
ExportedData\Export"&DWSpecificationId
C:\MyDocuments\Specifications
\ExportedData\Export 9999
This is the location and the name of the file that will be exported. The file in this case will be called Export 0047.

Example Result

Each example shows a different Specification that has been exported and the file that would be exported.

Example 1

The exported XML file will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<Specification CurrentOwnerName="Admin" CurrentOwnerId="109a9d93-d6d9-4d2b-b188-862c6aaf818d" CurrentState="Completed" RevisionNumber="1" SpecificationID="43" ProjectName="PartsOrder" SpecificationName="PartsOrder 0476">
    <Constants>
        <Constant Name="Constant A">1</Constant>
        <Constant Name="Constant B">2</Constant>
        <Constant Name="Constant C">3</Constant>
    </Constants>
    <ProjectTables>
        <ProjectTable Name="Table A">ID,First Name,Second Name 1,John,Smith 2,Sam,Jones 3,Eric,Coates</ProjectTable>
        <ProjectTable Name="Table B">ID,Manufacturer,Type,Age 1,Audi,A4,5 2,Ford,Fiesta,3 3,Citroen,C1,7</ProjectTable>
        <ProjectTable Name="Table C">ID,Spare Parts,Quantity 1,O rings 10mm,32 2,Engine Oil 1L,6 3,Windscreen Wipers,7</ProjectTable>
    </ProjectTables>
    <Controls>
        <Control Name="FirstName" Type="TextBox">
            <Value>Eric</Value>
        </Control>
        <Control Name="CarAge" Type="NumericTextBox">
            <Value>7</Value>
        </Control>
        <Control Name="ItemQuantity" Type="ComboBox">
            <Value>1</Value>
        </Control>
    </Controls>
</Specification>
        

Example 2

The exported JSON file will look like this:

{
  "SpecificationName": "PartsOrder 47",
  "ProjectName": "PartsOrder",
  "SpecificationID": 47,
  "RevisionNumber": 1,
  "CurrentState": "Completed",
  "CurrentOwnerId": "109a9d93-d6d9-4d2b-b188-862c6aaf818d",
  "CurrentOwnerName": "Admin",
  "Constants": [
    { 
      "Name": "Constant A",
      "Value": "1"
    },
    {
      "Name": "Constant C",
      "Value": "3"
    }
  ],
  "ProjectTables": [
    {
      "Name": "Table A",
      "TableData": "ID,First Name,Second Name\n1,John,Smith\n2,Sam,Jones\n3,Eric,Coates"
    }
  ],
  "Controls": [
    {
      "Name": "FirstName",
      "Type": "TextBox",
      "Value": "Eric"
    },
    {
      "Name": "CarAge",
      "Type": "NumericTextBox",
      "Value": 7.0
    },
    {
      "Name": "ItemQuantity",
      "Type": "ComboBox",
      "Value": "1"
    }
  ]
}
        

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 was exported and saved to file.

Success with Warnings

  • Data was exported and saved to file, but extension was changed to XML.

Failed (one of the following occurred)

  • No file name or path was provided.
  • File name or path was invalid.
  • General failure - Check the specification report for more details.