ProcessMIX User Guide
Categories

Structures builder

Updated on July 25, 2023
Print

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.

How to create the first 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:

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.

How to work with Structures?

Every Structure is a set of own properties and inherited properties (optional). By default, a Structure is inherited from the superclass UserObject.

Note:

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.

Operations with Structures

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:

  1. Editing or simply clicking on the name of the structure allows you to open the Structure Builder with the properties of the structure.
  2. Copy allows you to copy the structure to transfer it later.
  3. Clone allows you to create a clone of the structure. The cloned structure will have the name the same as the Name of the parent structure + Clone(n).
  4. Cut allows you to cut structure for transfer later.
  5. Paste allows you to paste the structure. It is not available unless you have previously used the Copy or Cut options.
  6. Rename allows you to rename the structure.
  7. Delete allows you to delete the structure.

How to build Structures and work with properties?

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 and enter the desired value.

To add a new property, click the plus button, 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.

Supported data types

  1. Boolean — value “true” or “false”
  2. String — text, for example, “Peter Petenson”
  3. Integer — number, for example, “22”
  4. Float — floating-point or decimal number, for example, “0.1234”
  5. Date — specify the date value in the format yyyy-mm-dd, for example ‘’1993-05-31’’
  6. Custom — any arbitrary structures that can be created in the Structure builder or default structures.

Operations with properties

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:

  1. Add allows you to add a new property.
  2. Copy allows you to copy the property to transfer it later.
  3. Clone allows you to create a clone of the property. The cloned property will have the same name as the Name of the parent property + Clone(n).
  4. Paste allows you to paste property. It is not available unless you have previously used the Copy or Cut options.
  5. Delete allows you to delete the property.

How to import XSD?

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:

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.