Understanding the Process Editor
The Frends Process Editor is the place where developers spend most of their time, and it is important to understand what it consists of and how to navigate through all of its buttons and panels.
The screenshot above shows the Frends Process Editor as if you have just pressed the "Create new" Process button on the Process List View. Let's go over the visible elements and their purpose.
On the left of the Process Editor, you can see the vertical Toolbar (sometimes called a toolbox), which contains all of the available Elements that you can use in Process development.
The Elements in the Toolbar represent all of the possible actions and tasks that you can perform in your Process. Here is a quick list of these:
Connect tool connects Elements to one another.
Start Element denote the beginning of a Process, also known as a Trigger. A Process can have multiple Triggers (e.g. one for scheduled activations and one listening for incoming HTTP requests).
Return Element denote where a Process ends. A Process can have multiple branches, each with their own return Element.
Exclusive decision Element is, simply speaking, an "if" statement. It checks if a certain condition is true or false and routes Process execution to different branches based on the result.
Inclusive decision Element can have several outgoing branches, and each of those branches has its own condition for execution. This means that multiple branches can be executed if their respective conditions return true. If none of the branches evaluate to true, execution jumps to the step where all branches connect.
Throw Element allows creating an error in the Process (or in other words "throwing an exception").
Intermediate return Element is a special return Element for Processes handling HTTP requests. Using this Element, you can return an HTTP response to the caller before your Process completes. This is useful when handling the request is slow, but you want to respond to a client quickly.
Task Element can execute one Task. Tasks will be covered in more detail later, but in essence, they are small prepackaged code blocks that do one thing well. Task examples: make an HTTP request, query a database for some data, transform XML using XSLT.
Subprocess Element can execute one Subprocess. Subprocesses will be covered in more detail later, but essentially, they are reusable small Processes that can be used across different integrations.
Expression Element allows the execution of one line of C# code and optionally creates a variable with the result of the code.
Statement Element allows the execution of an entire C# statement, along with providing access to all C# language features such as if statements, foreach loops, and so on. It also allows assigning a variable containing the result of the code.
Shared state Element allows saving and retrieving key-value pairs to/from temporary storage. Note that this is not to be used for long periods of storage because all entries must have a TTL. The data is shared between Agents in the same Agent Group.
Catch Element allows handling errors from Tasks, Scopes, and Subprocesses.
Scope Element allows grouping several Elements together for both logical reasons and, for example, being able to catch all errors that occur in a Scope with a single catch Element.
While Element executes a set of Process steps while the set expression evaluates to true. The loop ends when the while expression evaluates to false.
Foreach Element allows you to loop through an array or collection of data and have some logic applied to each item. The loop ends when the iterated data ends.
Data object reference Element has no functionality other than illustrative. For example, when dealing with files, it is useful to have a short description in the form of a comment detailing which files are being handled and where they are located.
Data store reference Element has no functionality other than illustrative. For example, when dealing with some data source (e.g. an MSSQL database), it is useful to have a visual clue about it.
Group Element has no functionality other than illustrative. It is sometimes useful to visually group parts of a Process into logical groups.
In the middle of the Process Editor is the Canvas, the working area where the Process is built. You can build the Process by dragging new Elements from the Toolbar onto the Canvas.
On the top right corner of the Editor there are several panels available. Those include:
Settings opens the Settings Panel for the current Process.
Variables can be used to store Process variables instead of creating a new Expression Element for each of them.
Test opens the panel for running tests of single Tasks. Useful when developing the Process for understanding how to properly configure the Task in question.
Snippets is a panel where you can save your favourite snippets to reuse them later.
On the bottom left corner of the Editor there are 3 buttons:
Reset zoom and graph position
Toggle minimap
Show keyboard shortcuts
When you start the Canvas can be easily navigated but as your Process grows larger there might come a time when it becomes more and more difficult to navigate and find every part of the integration. Fortunately Minimap feature helps with this.
The next article is Example on What Tasks are