Prepare the GenerateFormXML Code Sample

This topic looks at how to use the NintexFormsPublishExample code sample.

The sample contains two folders. One folder XmlParts contains XML fragments and a file, form_input.xml, that is an example of a well-formed XML input into the application. You will want to place XmlParts in a location accessible the console application. The console app in 2013_ONPREM_NF_GenerateFormXML uses the XML fragments and reads the input XML. The sample will not run without making sure the paths in the Program.cs have been configured and point to valid path names.

Sample Contents

The sample includes:

  1. 2013_ONPREM_NF_GenerateFormXML Folder (The solution file)
    • Program.cs
    • FormControlLayout.cs
  2. XmlParts Folder (The XML resources used by the application)
    • BooleanFormControlProperties.xml
    • ButtonFormControlProperties.xml
    • ChoiceFormControlProperties.xml
    • Form_blank.xml
    • ImageFormControlProperties.xml
    • LabelFormControlProperties.xml
    • TextBoxFormControlProperties.xml
    • Form_input.xml

Setting Up the Project

Place the XmlPartsfolder in a path that is accessible from the application. You will need to update Program.cs in the solution file with the appropriate paths to the XML resources.

Building and running the sample

Note: The sample can be successfully built, but will not successfully run, without performing the following procedure.

To run the sample, perform the following steps:

  1. Open the 2013_ONPREM_NF_GenerateFormXML Visual Studio solution in Visual Studio.

  2. Find each instance of the following text in the Program.cs file of the 2013_ONPREM_NF_GenerateFormXML project, and perform the action described in each matching comment.

    // TODO:
                        

    For example, the line 34 in the Program class contains the path that loads the Form_blank.xml. That line of code is preceded by the following comments:

    // // TODO: update path to: <filepathpath>Form_blank.xml
                    

    Follow the instructions and edit the code as needed to satisfy all of the requisite changes.

  3. Build the Visual Studio solution.

Related information

Generate Form XML

Overview of the GenerateFormXML Code Sample

Author a Bare-bones Form XML Document

Load the Generated Form XML