Configuring Relations
Relations in Neo define how blocks connect and determine the dataflow path during execution. They work like a switch statement, where each condition directs the execution to the next block based on the dataflow logic. You can define relations using DAO functions or JavaScript. All Neo blocks support Relations.
By default, Neo provides two path relations using DAO functions:
- isSuccess() – Executes when the operation succeeds.
- hasError() – Executes when an error occurs.
You can add, edit, or delete these default path relations based on your requirements. However, at least one path relation must always be defined.
Adding a Path Relation
To add a path relation,
-
Click + Add Path.
-
In Path Relation, enter the condition to be checked. You can also use the autocomplete feature to select a DAO function and block name from the dropdown list. To do this:
-
Select the expand icon to expand the text box
-
Start typing a DAO function starting with
.dao
to trigger the autocomplete dropdown for DAO functions.-
Select the required DAO function from the drop-down list or click on
tab
to select the highlighted function. You can hover over the DAO function to view its syntax, parameters, and usage examples. -
Start typing an open parenthesis
(
to trigger the autocomplete dropdown for block names. The dropdown lists the block name and the block type in the following format:blockName (Block Type)
. -
Select the required block name from the drop-down list or click on
tab
to select the highlighted block name. -
Select Done to save the changes.
NoteWhen writing relations, it is required to prefix function names with
dao.
. For example, for the DAO functiongetApiRequest
, define the function asdao.getApiRequest
.
-
-
Updated 16 days ago