Structures are models of data objects, which can be both simple and complex, containing elements of various types. Structure Builder is a built-in editor for creating structures. Using the constructor, you can create structures using basic data types such as String, Integer, Float, Date, Boolean, Arrays, Maps, and other already created structures, not limiting the possibilities of use. Structures can be of any nesting.
Once a structure has been created, it is available for use by any entity within the platform, such as in Flow as an incoming structure or to define a local variable structure.
After a project has been created and you have started working on it, you will be redirected to the Integrated Development Environment (IDE). Here you can see the project working environment. Use it to create a data model, your own logic, and manage the solution.
To create a new Structure, select the Structures icon on the Project Explorer panel — left end panel. Make sure you are in the Structures entity section. Now create a structure by clicking on the icon at the top of the Explorer panel. To create a structure in a folder, you need to select the desired folder and then click on the icon. In the pop-up window, enter the Structure name and click the CREATE button.
NOTE: The Structure’s name should be longer than 1 character and shorter than 100. It can contain letters (Latin a-z A-Z), numbers 0-9, $, and underscore. Always begin with a letter or underscore character.
Your first structure has now been created.
Every Structure is a set of own properties and inherited properties (optional). By default, a Structure is inherited from the superclass
NOTE: Each structure can contain up to 255 properties.
Structures other than the superclass UserObject can inherit properties from any other structures created in the system on their own, as well as from auto-generated ones, and others from the superclass Exception. The inherited properties are contained in the Inherited Properties block and cannot be edited from the current structure.
Auto-Generated structures occur when creating Assets and SOAP Connectors.
System classes that can be inherited are contained in the PDK folder in the structure selector. To access the structure selector, click ‘See All’ in the drop-down list when selecting a property type.
Select Structure on the Project Explorer panel — left end panel. By clicking the right mouse button, a context menu opens, through which a number of operations are available.
Let’s see what operations are possible:
After creation, a new Structure is inherited from the
UserObject, empty Inherited Properties and Own Properties.
A structure can extend another structure, in this case, the parent structure’s properties will be available as inherited properties. To do this, click on the current extends, then select See All, then the Structure Selector opens, in which you need to select the structure, then click on the CONFIRM button. After that, the section with inherited properties is filled with properties and their types. These are not editable. To view the inherited structure, click on the extension icon next to its name, after which the inherited structure will open in a new tab.
You can filter Inherited Properties to find the necessary properties. To do this, click on the icon on the central part, then click on the data type and select the necessary data type. If you do not see the required type or already created structure that you would like to use for this property in the drop-down list, then click See All.
For the property to be an array of elements, you need to open the structure selector, select pdk → core → click Array, and the required type, for example, String, depending on your needs. In this case, the property will be an array of strings. At the top of the selector, you see a constructor template that displays your current selection.
The same is true for Maps.
To rename Own Property click on the property name, then enter the necessary property name.
You can filter Own Properties to find the necessary properties. To do this, click on the icon. You will see a field in which you can enter the name of the element that you need to find.
Select property in the Own Properties section. By clicking the right mouse button, a context menu opens through which a number of operations are available.
Let’s see what operations are possible:
You can import XSD structure to simplify the process of creating structures or reusing your existing developments. For this, it’s necessary to follow this procedure: select Project on the top panel → Import → XSD Structures.
In the pop-up window enter the URL or Browse button and click UPLOAD button.
Then, select the necessary structures using the checkbox and click the CONFIRM button. Before clicking the confirm button, you can view the contents of each structure by navigating through them.
After a successful import, all imported structures can be viewed in the Structures section, which is available in the Explorer panel. In the future, all imported structures can be used in the same way as those created manually on the platform, you can also edit them.
NOTE: by using the function multivariable, you can automatically assign values to the generated structures as there is often a pair of XML VS XSD.