FLOW tool, the intuitive way to create bussiness logic

0. Introduction

Altair SmartWorks SDK (Software Development Kit) allows users to execute arbitrary code for listeners and rules, and it is developed with Groovy technology a “dynamic language for the Java Virtual Machine that builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby or Smalltalk”.

Where to use Altair SmartWorks bussines engine?

  • listener’s expressions
  • rule scripts
  • Altair SmartWorks test console

Smart behaviour and business logic is performed through expressions and rules coded in listeners.

FLOW tool is a simple way to generate Groovy code for users without experience.
However, if you are an advanced user and you like to program, do not be discouraged, we have created a special node designed for you, so you'll be able to write your own code in the traditional way.

  • Flow tool

KEEP READING ;-) to receive some "tips" to take into account to build business logic easily and quickly.



1. Highlights

  • Grouped into 4 categories of nodes to facilitate their location
  • If you are an advanced user, we have a special node for you
  • A section "Node Help" in each node with the all the necessary details
  • Custom input fields to help you


2. Categories

We have divided the nodes into 4 categories to facilitate their location, in addition, you have a search engine to help you in filtering.

Hierarchy

In this category you will find all the nodes needed to work with Altair SmartWorks entities, from creating a project to searching for a device.

Logic

Do you need to give logic to your business rule?, Here you will find everything you need, selective sentences, loops, casting, ...

Streams

A section created specifically for the streams management, especially useful to locate a data or to resend a stream.

Utils

Specially created nodes to further facilitate integration with external systems. Do you want to make an HTTP request? Send an alert SMS? here you will find the tools for it.



3. Advanced users

If you love to program and you just need a place to create your code, your favourite node will be the "function node". You can create all your code in a single node or combine it with other nodes if you wish.

  • Node function

Just drag the node to the workspace, double click on it, give it a nice name in the "Label" field and write your code in the "Payload" field. In addition, you can maximize this field by clicking on the expand icon and enjoy the syntax highlighting.

  • Custom code


4. Forms

Each node has a form with different fields that you must complete according to your needs. You always find a section "Node Help" with important information, do not forget to check it to know the details of that node.

  • Node Form - Node Help


5. Input fields

In the forms you will find different types of input fields, for what should I use each of them?

Free

To type whatever you want

Drop-down

You will only need to select a proposed value

Typed input fields

Are special types that offer different options to suit your needs:

  • String, number or boolean
    The simplest case, select any of them if in this field you want to add a text, a number or a boolean.
  • Payload data
    If you need to refer to a field that you will send in a data stream, this is your selection, just select it and include the key used in the request's payload
  • Last payload data
    One more step of the previous case. This option will show you the available keys in the last data stream sent, very useful if you have already sent a test stream.
  • Metadata
    Along with the information sent, Altair SmartWorks stores some metadata that may be useful in some business logics. Some of the metadata that you can find here are "X-real-Ip", "User-Agent", "device", ....
  • Env variable
    Have you stored something in some variable in your flow and it's time to use it? With this option you can recover its content and use it in this field.
  • Typed input fields


6. Groovy code

What code has my flow generated?
This is not a secret, so you can always see the code generated by your listener or rule, for that you just have to press the button "Generated Source Code".

  • Generated code


7. Starting point

Working with real examples is always a good starting point, so here you can find a set of tutorials to use as a base.