HATS can enable the support of SOA (Service Oriented Architecture) through its capability of creating Restful Web services. In the background, the functionality to be performed by Web services is achieved by recording actions through a HATS Macro. The Macro will take the input parameters which are input to web service and provides a result which is the output of a web service.
Integration Objects are used to create a wrapper around these macros to create a web service, as macros directly can’t be used to create a web service.
"Chained Integration Object" is a feature in HATS that allows users to link multiple Integration objects and run them in a sequence.
Steps to create a Chained Integration Object in HATS:
1. Create a separate Macro for each task.
2. In the Project explorer view, right-click the Macro, and click "Chained Integration Object".
3. In the next dialog box that appears, to "Create Chained Integration Object", select the Integration object, i.e., "Position in object chain" as "First" if it is an initial task, and then provide a label name in the "top State label" command box.
The label name can be anything based on the user’s choice, but the same label name must be used across all the integration objects in a single chained IO. For Example: TestLabel1
4. Repeat the above step for all the macros that are part of this chained Integration. Choose the "Position in object chain" as "Last" for the macro that should run as the last task. For all other macros in the chain that should execute after the First, and before the Last macro, choose the position as "Middle"
5. After creating the Chained Integration Object, right-click on each Integration object within the chain and choose the option "Create RESTful Service Files"
6. Add a POST method in the web service, and while doing so, for the First object in the integration chain, enable the “hPubLinkKey” parameter in the output properties list,
in the "Define RESTful Service Method" dialog box.
For all the "Middle" objects, the “hPubLinkKey” parameter must be enabled in both, the input & output properties, whereas, for the last object, the “hPubLinkKey” parameter must be selected only in the input properties. This will make sure that the value of “hPubLinkKey” is passed to all objects in the chain and are linked to each other.
7. Deploy the project onto the application server and then execute a web service using one of the methods that can execute a REST service (like Swagger).
The execution order of the services is as follows :
a. Service marked as "First" in the Chained IO
b. Service(s) marked as "Middle" in the chained IO (one or more services)
c. Service marked as "Last" in the chained IO.
The input parameters required by each of the service, is obtained from the “hPubLinkKey” parameter output of the previous service, in the following format:
Use Case Scenarios:
User requirement: To perform balance enquiry, deposit amount, initiate fund transfer through a Banking system.
Chained Integration Object Solution:
Using HATS macros and Chained Integration Objects, the above user requirement can be achieved by following the below steps:
Senior Test Lead