Skip to main content

Veritran Docs

About Blocks

Blocks represent a variety of operations and elements that combined perform a wide range of actions, from setting or obtaining the value of a token to executing call APIs or transactions. Lambda processes sequentially execute these actions to perform more complex tasks.

Blocks connect to each other vertically like a puzzle, where each block type has its own shape, and a specially shaped socket or slot for another block to be attached or inserted into it. To program your process, drag blocks from the left panel and drop them into the canvas, arranging them as needed.

Refer to the list of blocks to learn more about each the blocks available in the left panel of the lambda processes editor.

Blocks Anatomy
anatomy_block.png

Blocks present specific characteristics that allow you to understand where can you place them and with what information you can complete them. These characteristics include:

  • Block action or content description: Most blocks contain a brief description of the action they perform or the content they include. This allows you to understand their function and with what information they must be completed.

  • Bumps and notches: Blocks shaped with a bump on the bottom allow other blocks to be attached below them. The blocks attached below must contain a notch on the top that matches in shape with the bump of the block above.

  • Sockets: Certain blocks have a socket where one or more action blocks must be attached for them to be complete. These blocks include: execution blocks (on start, on error and function blocks) and control blocks (conditional and loop blocks). For example, a repeat N times loop block needs an action block attached within its socket to be executed the number of times defined in the loop.

  • Value slots: Blocks may contain a round shape that, depending on the block function, is either manually completed with a numberic value or by attaching a round-shaped value block. The information included within value slots completes the logic of the block that contains them.

  • Boolean slots: Blocks may contain an hexagonal shape that is either completed with a boolean value (true/false) or by attaching an hexagonal block that returns a boolean value. The information included within boolean slots completes the logic of the block that contains them.

  • Options drop-downs: Some blocks include a drop-down for you to select an option. For example, comparison blocks that compare two numeric values and return true or false based on whether the condition is met have a drop-down to select the condition for the comparison from the following options: equal to (=), not equal to (≠), greater than (>), greater than or equal to (≥), less than (<), and less than or equal to (≤).

Blocks Colors

The color of each block also gives you relevant information on what they can do:

  • Green blocks green.png: Allow the interaction with entities and elements outside the lambda process. For example, executing transactons or call APIs, obtaining the value of a parameter or constant, and setting or obtaining the value of a token.

  • Purple blocks purple.png: Allow the execution of internal operations within the lambda process. For example, executing mathematical operations, manipulating texts or lists, and setting or invoking variables.

  • Yellow blocks yellow.png: Define the actions to be performed as soon as the process is finished. For example, executing another process or rendering a screen.

  • Red blocks red.png: Define the actions to be performed in case of an error in the execution of any action within the lambda process. Refer to the error management section below to learn more.

  • Grey blocks grey.png: As with purple blocks, grey blocks allow the execution of internal operations within the lambda process, but specifically related to the manipulation of JSON attributes or lists.

Blocks Shapes

Blocks puzzle-piece shape helps you to easily identify which blocks connect with one another, thus allowing you to create logic faster as you do not need to write code. Refer to the list below to learn more about each block shape:

1_1.png

On start and Error blocks —two different types of initial (or execution) blocks— share this square shape with a flat top, as they initiate a statement and no other blocks can be placed on top of them. They also have a socket with a specific shape that coincides with the shape of the blocks that can be attached to them (which are action or control blocks). The content within these blocks can be collapsed to improve the readability of the process.

By default, the editor opens with the on start block placed on the canvas. From this initial block, you start connecting other blocks to create your main statement, which will run first when executing the lambda process.

2_1.png

Function blocks —another type of initial (or execution) blocks— have a round shape top to differentiate them from the other initial blocks. They also have a socket with a specific shape that coincides with that of the blocks that can be attached to them (action or control blocks). The content within these blocks can be collapsed to improve the readability of the process.

6_1.png

Control blocks -conditionals and loops- share a square shape, with a bump on the top to be attached to other blocks inside a statement and a a socket with a specific shape that coincides with the shape of the blocks that can be attached to them (action blocks or other control blocks). These blocks are attached to initial and other control blocks, and are used to manage the order in which different parts of the process are executed. They also include structures which help determine when certain actions should be carried out based on specific conditions.

3_1.png

Action blocks have a square shape with a notch at the top and a bump on the bottom, so that other blocks can be attached above and below them. These blocks are attached to initial and control blocks, and represent an action to be executed at that point of the process. Action blocks are completed by placing a round-shaped block or an hexagonal-shaped block within the slot or slots of the action block that share the same shape.

Note

The Transactions block is the only type of block placed within a slot with a different shape. Transaction blocks (square-shaped) are attached to round-shaped slots.

4_1.png

Value blocks have a round shape and include the value that completes the logic of an action. They are placed within the round value slot of another block. Round-shaped blocks return a string or a numeric value

5_1.png

Boolean blocks have an hexagonal shape and include the value that completes the logic of an action. They are placed within the hexagonal boolean slot of another block. Hexagonal-shaped blocks return a boolean value (true or false).

Error Management

Lambda processes allow you to set actions or events to be triggered if an error occurs. There are different types of errors that the app executes one after the other until one of them is detected as configured. The order of execution for these errors is:

  1. Error blocks within the main statement (connected to the on start block).

  2. Specific errors configured using the on error with type block (not connected to the on start block).

  3. Default errors configured using the on error default block (not connected to the on start block).

  4. App errors set in the Errors tab of your app Settings.

Note

In the case of lambda processes within modules interfaces, the first three steps are executed and, if no errors are identified in the lambda process, the app executes the errors set for the module or the module's parent app or module. The execution of errors in the module or the parent app depend on how you configured errors in the module that contains that lambda process. To learn more about modules error inheritance, refer to Create or Edit a Module .