Composite Functions

Creating Function

To create a composite function:

  1. Make sure draft mode is enabled.

  2. Click the image3 "Create" button located at the bottom of the function list.

  3. The action will open a list of creation options.

  4. Select the "Composite" option.

  5. The action opens the window for setting the new function.

  6. Specify the basic settings of the function: Name, Display name, Description.

  7. Set the necessary processing modes of the function: global and/or local.

  8. Create the necessary function with the editor using ready-made functions, constants, conditions (see example).

  9. Save the changes. Click the image2 "Save" button in the upper right corner of the window.

  10. Once all data has been entered and saved, publish the draft.

Working with Function Editor

The composite function editor contains the main working area in the center of the screen; and the list of ready functions, constants and conditions blocks in the left part of the screen.

  • Adding a block to the workspace is done by the drag-n-drop method. To do this, select the necessary block from the list on the left, press the image4 button and drag it into the main working area. Blocks can be moved within the main working area of the editor.

  • Deleting a block is available by clicking the image5 button in the upper right corner of the element.

  • Input is always on the left side of the block, Output is always on the right side of the block.

  • Links between blocks are set from input to output. This is done by clamping the input circle and extending the line to the output circle. If the port types do not match each other, an error message will be displayed.

Function Blocks

  • Simple or composite function block can have one or more inputs and outputs each. The input is displayed as a white solid circle with a blue border, the output is a solid blue circle.

Function Block
  • Constant block has one output (solid blue circle), as it passes the data (constant) itself. When you click on "Select value", a modal window opens, in which the value type and the value of the constant itself are specified.

    • The constant is connected to the input of the function block or condition block. Connection means that the constant is transferred. The function block or condition block can be connected simultaneously with the constant block.

Constant Block
  • Conditions block always has one logical input (solid orange circle).

    • The logical input is used to control conditions, from it comes the value true or false, and depending on it the actions of the corresponding outputs are performed.

    • The condition is added by pressing the image3 button. The port parameters are set in the modal window.

    • The input is displayed as a white solid circle with a blue border.

    • Output is displayed on the right side and is divided into 2 branches: "True" - solid turquoise circle, "False" - solid red circle.

    • Not all created inputs/outputs must be used, i.e. they can be left empty.

Conditions Block

Cloning Function

To clone a composite function:

  1. Make sure draft mode is enabled.

  2. Move the cursor over the line of the desired composite function and click the image1 "Clone" button at the right end of the line.

  3. In the window that opens, fill in the Name and Display name of the new function.

  4. Click image2 "Save." The action will clone the function and open a window with the function parameters.

  5. After all the data has been entered and saved, publish the draft.

Example of Composite Function Creation

Below is an example of creating a composite function that checks the serial number of a passport and adds the signature "Passport" before the number to generate simplified reports.

  1. Create a new composite function.

  2. Specify the basic settings of the function:

    • Name - "pass_number".

    • Display name - "Passport number verification".

    • Description - "Depending on the string length, adds a sign before the passport serial number".

  3. Enable the processing modes of the function: Global and Local.

  4. The following steps are performed in the function editor area.

  5. Add a new port in the "Incoming Ports" block by clicking the image6 "Add" button. Fill in the port parameters and click "Continue":

    • Port name - enter "port1".

    • Display name - enter "String to check".

    • Port type - select "Simple" type.

    • Value type - select "String" type.

Composite Function Creation
  1. On the left side of the list of ready functions, find the function "CheckLength" and drag it into the main workspace while holding down the image4 button.

  2. Connect the output of the "String to check" incoming port with the function input of the same name. To do this, move the cursor over the blue circle of the incoming port, press the left mouse button and draw the connection to the white circle of the function input, then release the button. The other inputs and ports are connected using a similar method.

    • The function checks the number of characters of a string within a given range using the "Minimum allowed length" and "Maximum allowed length" inputs. In this case, an exact value is required, so both inputs must contain the same values.

Composite Function Creation
  1. Drag and drop the "Constant" block into the workspace. Set the constant value: select the value type - Integer, value - "12" (passport serial number with spaces).

  2. Connect the output of the constant with the inputs for the minimum and maximum values.

    • At the output, the string length check function returns the check sign: true (true) or false (false). The output is of type "Logical".

Composite Function Creation
  1. Drag the "Condition" block into the editor workspace.

  2. Connect the logical output of the length check function to the logical input of the condition (orange circle).

  3. Connect the input of the "Condition" block with the output of the "String to check" incoming port. The function will be processed according to the algorithm:

  • When the function starts, the attribute value from the incoming port is passed to the string length check function, the check is performed according to the specified conditions.

  • Then the result of the check is passed to the "Condition" block.

  • The "Condition" block requires input data to work. In the example under consideration, the block refers to the same attribute of the incoming port.

  • Then, depending on the result of the function "CheckString", actions from the branches true (turquoise circle) or false (red circle) are performed in the "Condition" block.

Composite Function Creation
  1. Drag and drop the "Concatenate" function into the editor workspace.

  • The added block can take up to 5 lines as input and subsequently merge them into one line. The inputs are arranged in merge order, i.e. the string from input 1 will be the first, the string from input 5 will be the last.

  1. Connect the output of the "Condition" block from the true branch to the second input of the "Merge" function.

  2. Specify a constant value for the first input: drag the "Constant" block, select the "String" type and enter the text "Passport " (with a space at the end, otherwise the strings will not contain spaces).

  3. Add a new port in the "Outgoing Ports" block by pressing the image6 "Add" button. Fill in the port parameters and click "Continue". The type of the outgoing port must correspond to the type of processing results. Accordingly, for the function block "Connect" the outgoing port will be of type "String".

    • Port name - enter "port2".

    • Displayed name - enter "Converted Value".

    • Port type - select the "Simple" type.

    • Value type - select the "String" type.

  4. Connect the output of the "Connect" function - "Result" to the input of the outgoing port "Converted Value".

Composite Function Creation
  1. Save your changes using the image2 "Save" button in the upper right corner of the window and publish the draft.

  • The saved composite function will be available in the list of functions and can be used both in data quality rules and as a block for other composite functions.