# Data Structure Builder

**Structures** are models of data objects, can be both simple and complex, and contain elements of various types. The Structure builder is a built-in editor for structure creation. The builder helps to create structures by using basic data types: String, Integer, Float, Date, Boolean, Arrays, Maps, previously created structures, and pre-built system stuctures without limits of their use. Structures can be of any nesting.

Once a structure has been created, it is available for use by any entity within the platform. For example, in a Flow as an incoming structure or to define a local variable structure.

## How to Create a Data Structure

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FAuK86wldHDEs7yv0f1ls%2FStructure_Start.png?alt=media&#x26;token=74490cbc-9444-4dad-b74e-9c362c5c4937" alt=""><figcaption></figcaption></figure>

After a project has been created, you will be redirected to the Integrated Development Environment **(IDE**). Use it to create a data model, business logic, and manage the solution.

To create a new Structure, select the Structures icon on the Project Explorer panel — left vertical panel. Make sure you are in the Structures entity section. Create a structure by clicking on the **New Structure** <img src="https://processmix.com/wp-content/uploads/2023/02/image.webp" alt="" data-size="line"> button at the top of the Explorer panel. To create a structure in a folder, select or create the desired folder first, and then click on the **New Structure** <img src="https://processmix.com/wp-content/uploads/2023/02/image.webp" alt="" data-size="line"> button.&#x20;

Enter the Structure name and click on the **CREATE** button in the pop-up window.

<figure><img src="https://processmix.com/wp-content/uploads/2023/02/90724583-de3b-4949-a37d-181a92989044-1024x288.png" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
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. It should begin with a letter character.
{% endhint %}

As a result, a new data structure will be created, and you will be able to start populating its properties.

## How to Work With Structures

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

{% hint style="info" %}
Each structure can contain up to 255 properties.
{% endhint %}

Structures can inherit properties from any other structures created in the system, auto-generated ones, and those from the system structures. The inherited properties are listed in the 'Inherited Properties' block and cannot be edited from the current structure.

Some structures are auto-generated during creation of assets and some connectors (e.g. SOAP, REST, and EVM blockchain).

The inherited system classes are located in the structure selector PDK folder. While selecting a property type to access the structure selector, click on **See All** in the drop-down list.

### Operations With Structures <a href="#operations-with-structures" id="operations-with-structures"></a>

Select **Structure** on the Project Explorer panel (the left vertical panel). To see all available operations, open a context menu by clicking the right mouse button.

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FIeNWgONwVmUnHhEeVdHk%2FStructure_ContextM.png?alt=media&#x26;token=a98484aa-2602-48a4-88fc-661223941dce" alt=""><figcaption></figcaption></figure>

The menu contains a list of commands:

1. **Edit** or simply clicking on the name of the structure allows you to open the Structure Builder with the structure properties.
2. **Copy** allows you to copy the structure into the clipboard to make a copy of it in some other folder.
3. **Clone** allows you to create the clone structure. The cloned structure will have the same name as the parent structure + Clone(n).
4. **Cut** allows you to cut the structure into the clipboard to move it into another folder.
5. **Paste** allows you to paste the structure form the clipboard into the selected folder. It is only available if you have the previously used the Copy or Cut command.
6. **Rename** allows you to rename the structure.
7. **Export** —  allows exporting the selected structure in JSON format, enabling its further import into another folder, project or a different branch of the current project.
8. **Import** — allows importing a previously exported structure into another folder, project, or branch of the current project.
9. **Find Usage** — allows finding the usage of the selected structure across the entire project. The search results will be displayed in the search panel located at the bottom of the screen.
10. **Delete** allows you to delete the structure.

## How to Build Structures and Work With Properties

After creation, the new Structure has empty Inherited Properties and Own Properties.

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FHccL5WiwTLtMVk5DdJ5s%2FStructure_The%20Inherited%20Properties%20and%20Own%20Properties.png?alt=media&#x26;token=b0fd0d30-da47-4b6c-82e2-93f77c7034d5" alt=""><figcaption></figcaption></figure>

A structure can extend another structure, in this case parent structure properties will be available as inherited properties. To do this, click on the **Extends**, then select **See All**. Select the structure in the Structure Selector and click on the **CONFIRM** button. Then inherited properties section will be added with properties and their types from the selected structure. The inherited properties are not editable. To view the inherited structure, click on the extension icon right side to its name, the inherited structure will appear in a new tab.

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FLakalwHjIUtgHfSxdSVf%2FStructure_Selector.png?alt=media&#x26;token=b94646ac-4abc-4a1e-bd00-3e1b7bd78322" alt=""><figcaption></figcaption></figure>

To **filter** Inherited Properties to find the necessary data, сlick the Filter <img src="https://processmix.com/wp-content/uploads/2023/02/image-2.webp" alt="" data-size="line"> button, then enter the name of the element you need to find in the open field.&#x20;

**To add** a new property, click on the **Plus** <img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FI4Zm6WRm7pAvtzgkZ7km%2FFrame%2050720.png?alt=media&#x26;token=b596c2b1-3afb-4658-a2be-d622effd2d30" alt="" data-size="line"> 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 on **See All.**

If you need the property to be presented as an array of elements, open the structure selector, select pdk → Core → Array→ then the required type (optional). A constructor template will display your current selection at the top of the selector.

> For example.
>
> You wish to select String Array. In this case, open the structure selector, select pdk → Core → Array then String.

The same sequence of operations is also true for Maps.

To rename own propert&#x79;**,** click on the property name, then enter the name you need.

To **filter** Own Properties for necessary data, сlick on the **Filter** <img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FTOWIc9TkwaUPFANn9brR%2Fimage.png?alt=media&#x26;token=4f36c5fc-b35a-4d57-8a09-0ceb6e297330" alt="" data-size="line"> button, then enter the name of the element you need to find in the open field.&#x20;

Simple data types are:

1. **Boolean** — value “true” or “false”
2. **String** — text, for example, “Peter Peterson”
3. **Integer** — whole number, for example, “22”
4. **Float** — real number which can have a fractional part, for example, “0.1234”
5. **Date** — specifies the date value in the format yyyy-MM-ddTHH:mm:ss.sssTZD, for example “1997-07-16T19:20:30.023+01:00” or “2013-12-24T09:12:14.232344Z”

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FMaxoQrqkYQoZ6v6Agkxn%2FTypes%20selector.png?alt=media&#x26;token=fd6c4e95-203d-4e9d-98b4-6b0a096c4d70" alt=""><figcaption></figcaption></figure>

### **Operations With Properties** <a href="#operations-with-properties" id="operations-with-properties"></a>

Select a **property** in the Own Properties section. You can see the number of available operations in a context menu, by clicking the right mouse button.

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2F2adm2kXuXfxFyE50fpxG%2FOperations%20with%20properties.png?alt=media&#x26;token=c6da2210-3bca-4991-a6ad-a473f585ee40" alt=""><figcaption></figcaption></figure>

**The list of ready-to-use operations**:

1. **Add** allows you to add a new property.
2. **Copy** allows you to copy the property for further transfer.
3. **Paste** allows you to paste property. It is not available unless you have the previously used Copy or Cut options.
4. **Clone** allows you to create the clone property. The cloned property will have the same name as the parent property + Clone(n).
5. **Find Usage** allows finding the usage of the selected property across the entire project. The search results will be displayed in the search panel located at the bottom of the screen.
6. **Delete** allows you to delete the property.

To perform the same operation on multiple entities simultaneously, select multiple entities. Drag and drop the entity to move it to another position in the list.

## How to Import an XSD Schema

You can import XSD structure to simplify the process of structure creation or to reuse your existing developments. To do this: select Project on the top panel → Import → XSD Structures.

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FBG4FkriC5lBp35nklnDR%2FImport_XSD%20structure%20(1).png?alt=media&#x26;token=8bcd1393-bba4-4267-ae4e-7a69ce1f0a74" alt=""><figcaption></figcaption></figure>

Enter the URL by hand, or click on the **BROWSE** button to select a file, then click on the **UPLOAD** button in the pop-up window.

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FI5DLMLsFiCS0Y1FvqIeI%2FImport%20XSD%20structure.png?alt=media&#x26;token=49a265dd-0c84-41a7-9956-2138ee3568cc" alt="" width="563"><figcaption></figcaption></figure>

Select the necessary structures using the checkbox and click on the **CONFIRM** butto&#x6E;**.** You can view the contents of each structure by navigating it before clicking on the **CONFIRM** button.

<figure><img src="https://processmix.com/wp-content/uploads/2023/02/dd69fce1-ceb5-4ff4-8dd4-b948beb54757.png" alt=""><figcaption></figcaption></figure>

Once the import has been successful, all imported structures can be viewed in the Structures section 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.

{% hint style="info" %}
xmltovariable function can automatically assign values to the generated structures because often they have a pair of XML VS XSD files.
{% endhint %}

### How to Import Structure From a JSON Record

To import structure from JSON object, click on the **Import Structure** <img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FPmdFWiopgIp74ptB8F8Q%2FButton.png?alt=media&#x26;token=e953a24f-2a74-4c60-ba86-aef4fb294fb3" alt="" data-size="line"> button at the end of the **Own Properties** section header.

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FH3AJ1FiRYVxwwRGP6bi5%2FImport%20structure%20button.png?alt=media&#x26;token=efc24531-8e80-4734-9fe6-d12cccb84166" alt=""><figcaption></figcaption></figure>

Paste the JSON object in the left part of the Import Properties pop-up window. The right side of the pop-up window will indicate the Properties List of the pasted JSON object. To add the properties in the structure, click on the **ADD** butto&#x6E;**.**

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2F0PiH4IbagdwnmYMrhw4b%2FPaste%20the%20JSON%20object.png?alt=media&#x26;token=990ffe19-35e8-4960-8e35-8235e3948704" alt=""><figcaption></figcaption></figure>

If your structure has previously created properties, to replace them, click on the **CONFIRM** butto&#x6E;**.** To cancel an operation, click on the **CANCEL** butto&#x6E;**.**

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FqpbrR2xFZMBEzKSsA7cd%2Fimage%20337.png?alt=media&#x26;token=52257f7d-2070-4992-873a-e402c65866fe" alt="" width="563"><figcaption></figcaption></figure>

Newly added properties can be viewed in the **Own Properties** section.

<figure><img src="https://3477030876-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYK40zKr4ZyVfqCRAUI9t%2Fuploads%2FhSTkX7tRCVQ3Cdsmit4c%2FOwn%20Properties%20sector.png?alt=media&#x26;token=fd862206-93c2-46c3-8580-ad3a859fdf1e" alt=""><figcaption></figcaption></figure>
