Create Types From XSD
  • Updated on 25 May 2015
  • 2 minutes to read
  • Print
  • Dark
    Light

Create Types From XSD

  • Print
  • Dark
    Light

XSD (XML Schema Definition), a Recommendation of the World Wide Web Consortium (W3C), specifies how to formally describe the elements in an Extensible Markup Language (XML) document. This description can be used to verify that each item of content in a document adheres to the description of the element in which the content is to be placed.

Example:
In this example we will create Type From XSD and use this Schema to deserialize XML object and display it on the Form .
We begin in the Designer Folder with selecting Datatypes/Database > XML/JSON > Create Types from XSD from Folder Actions Panel.
2018-09-07_160156.png

2018-09-07_160322.png

In the resulting pop-up window we provide our Schema with a Name and either use XSD File or Paste Schema Code . In this example we paste XSD Schema . When finished, click Ok .
2018-09-07_162059.png

System creates XSD Data Structure.
2018-09-17_155008.png

Next, we can start creating our Flow where we will use XSD Schema Type . From Folder Actions Panel click Create Flow button.
2018-06-27_133340.png

Then, we Name our Flow and click Create to proceed to the Flow Designer.
2018-09-17_161932.png

In the Flow Designer we addDeserialize note step from All Steps [Catalog]> User Defined Types > XSD Structures > NoteXMLSchema category.
addDeserializeStep1.png

Next, we select Deserialize note step on the workspace and Step Information Layer pops up. We can configure this step within this Layer . We define Constant Mapping Type for String To Deserialize Input and paste the String that represents anXML object into Value text box. This XML object fit in description that we defined in our XSD Schema Type (the input for this step may be a result of Webservice call).
insertStringIntoDeserializeStep.png

Then, add Show Form step from the Favorite Steps category on the Done outcome from Deserialize note step.
addFormStep.png

In the resulting window we Name our Form and click Create to proceed to the Form Designer.
createForm2.png

In the Form Designer we use Data Grid component from the List category in the ToolBox to display deserialized result from XML object . For this component we pick note type that we defined at the beginning of this tutorial. At the end our Form Design looks as following... When finished, we can save the Form and close Form Designer.
addDataGridType.png

Next, we connect steps in our Flow as following… Then, we select Form step on the workspace and Step Information Layer pops up. We select Show Mapping Editor option.
showMappingEditorForForm.png

In the Mapping Editor we select Build Array Mapping Type for the Data Grid component. Then, we connect Output from Deserialize step to the Item 0 in the Array for Data Grid . Click Ok to save and close Mapping Editor.
mappingForForm1.png

This completes our Flow . We can click Debug Flow link on the top panel of the Flow Designer to test our Flow .
Note that in Decisions version 3.5 and above, you'll need to click Test Flow to access the Debugger .
3.5-Test-Flow-Shot5.png

debugFlow2.png

Our Form opens in the Debugger . Data Grid component displays deserialized XML object . Click Done to terminate Flow execution.
formInDebugger.png

Diagram in the Debugger shows that the Flow ran to the End step with no issues.
flowExecuted1.png

Was this article helpful?