Tuesday, May 3, 2016

Building business processes using RoboMQ Integration Flow Designer


RoboMQ Integration Flow Designer is world’s first Microservices based business process designer. The product feature allows you to build business processes by simple drag, drop and chaining of pre-built pallets of nodes representing Microservices. Each of the Microservice represents a business process or a function which is represented visually by a node on the designer palette. Complex Event Processing (CEP) can be achieved by chaining these nodes visually in a flow connecting the output of the predecessor to the input of next node in Flow Based Programming(FBP) style.  Integration Flow designer takes away the complexity of chaining Microservices through configuration and coding to a simple visual Lego style assembly. In this blog we will show you in just four simple steps the power of the Integration Flow Designer by building a simple business flow. 


Fig 1: Flow Based Programming makes building integration a Lego approach

The example use case or the business flow being illustrated here is a user registration flow. Our business process receives a user registration file containing the details of the users being registered in the system. The user information could be first name, last name, date of birth, address, phone and email. This information coming in a CSV file will be saved to the registration database. An email will also be sent to the person responsible for the registration process upon registration completion (I get the distinct privilege of being that person :) ).

This very simple use case consists of four steps:

  1. Receive the registration information in a CSV format
  2. Transform registration data in system usable JSON format
  3. Save the user information in the user database
  4. Send an email to registration point of contact 

Receive the registration information in a CSV format

The first step is receiving the user information in a CSV format to be processed through the user registration flow. 


Fig. 2: Input node to inject use information in CSV format


We will use the inject node for this purpose of sending the CSV data to the process. For a more complex processing, a FTP, SFTP or S3 adapter node could be used which will pull the CSV file from a file location and make it available as input to the process.

The inject node shown above sends the CSV data to the next node in the flow which converts the CSV data to JSON format for the next stages of the processing. You could give it any meaningful label, like “User Information” as shown in the picture below.

Transform registration data in more usable JSON format

The second step of the processing is transforming the input CSV data from into JSON format. This transformation is simple transformation or the purpose of demonstration. However, very complex transformation including data enrichment and substitution can be performed using nodes representing microservices providing complex data transformation capabilities.


Configuration of transformation step is very simple as shown in the picture below. All the magic or the processing is encapsulated in the Microservice. The transformation node in the pallet is just an abstraction which takes in an input and learns where to send the output in line with principles of Flow Based Programming (FBP).


Fig. 3: Data transformation node for CSV to JSON conversion



For transformation node “CSV to JSON” we configure Input as “Data”. It means that the node (or the represented Microservice) will get the input as data from the previous node which is the inject node pushing CSV data to the flow. CSV to JSON node will send the transformed output to a message queue hosted on RoboMQ messaging fabric from where the next node will pick it up as input. This input output linking is done by connecting the nodes as you will see in the step below. The processing of input data to the JSON formatted output is done by the Microservice running on the cloud that acts like a worker. 

Save the user information in user database

The next step is to save the user information in the user registration database. The user information to be saved is received from the last node “CSV to JSON”. CSV to JSON node is connected to RDBMS node in sequence configuring the input/output flow. 

We will use “RDBMS” node for data persistence. This node represents a microservice providing a database adapter using RoboMQ ThingsConnect suite of adapters and connectors. This microservice will accept JSON data as input and save this data into a relational database of your choice. 


Fig. 4: Database persistence node for saving the user data into a RDBMS

You might notice that the inout for the RDBMS Adapter is “Queue” which is same queue where the previous node will put the transformed JSON output. By specifying Queue as the input and linking the nodes( or the Microservices) we are able to chain or build the sequence of processing.

Send an email to registration point of contact 

The forth step is to send an email of the successful user registration to the person responsible for this process. 

Simply select the Email Adapter node that represents a microservice running on the container management platform that specializes in sending email. Once again drag and drop the node and connect it in the sequence. You could click on the node and configure it to specify the email parameters like the email notification receiver, sender and the email server configuration. 

Fig. 5: Sending email using the email Microservice

At this point you have setup the whole flow by simple drag and drop of the nodes. Under the hood, you have basically created a business process by chaining together a set pf microservices running in a container management platform providing all the cool features like auto scaling, auto healing, load balancing etc…


Now is the time to deploy the flow … This is the moment of the glory which is also very simple.  Click on red deploy button to deploy the new shiny business process that will make the flow run waiting for the input.

Once deployed it is time to test the tires. To initiate the flow, simply click on the Inject node to send some CSV data through user registration business process. 


Fig. 6: Run the flow by sending some data through the Inject node

The CSV data being processed is the payload for the inject node. In real life this would be direct read of a file using a file adapter node or an API call. Once you inject the payload the flow gets started and you should see the database entry in the use registration database as shown below.

Fig. 7: User data saved in the registration database

The CSV data being processed is the payload for the inject node. In real life this would be direct read of a file using a file adapter node or an API call. Once you inject the payload the flow gets started and you should see the database entry in the use registration database as shown below.

The person responsible for the business process (which in this case is myself) also receives an email notifying of  user registration as configured in the email adapter.


Fig. 8: Email send to the registration Point of Contact


As you saw, in just few simple drag and drop of nodes from the palette of RoboMQ Integration Flow designer, you were able to compete a user registration flow including data persistence and email capabilities. 

You could build complex process flows using Integration Flow Designer by simply chaining together the functionality provided by Microservices with absolutely no programming needed!!!


Got excited and want to try it? Simply sign up for RoboMQ or get in touch with us.

No comments:

Post a Comment