Oresund Integration Platform
  • 🌉Overview of OIP
  • About
    • Functional Capabilities
    • Product & Developer Guide
      • Adapters
        • Rest Adapter
        • File Adapter
          • FTP Handler
          • SFTP Handler
          • EXCEL FTP & SFTP Handler
        • Database Adapter
          • DB Insert Handler
          • DB Retrieve Handler
        • SOAP Adapter
        • Quick Books Adapter
        • Mail Adapter
        • Subloop Helper
        • Global Variable Adapter
      • Monitoring Helper Service
        • Manual Monitoring
          • FTP/SFTP FLOW
          • API FLOW
          • DATABASE FLOW
          • General Monitoring
        • Scheduled / Automated Monitoring
          • Stopped job alert
          • File source Alert
      • Configurations & Business Specific terminologies
        • Business Specific terminologies
        • Configurations
          • Client & Client Setting configuration
          • Job & Job Setting Configuration
          • Step & Step Setting Configuration
          • Step Request Validator Configuration
          • Error Pattern Master Configuration
          • Failure Mail Configuration
      • Sample Description of I-Flows
        • API - API IFlow
        • API - FILE IFlow
        • DB - API IFlow
    • Dependencies
    • Product Roadmap
      • Summary of Features released / completed POC
        • New features planned for August 2023 - December 2023
Powered by GitBook
On this page
  • Sub handlers
  • Global Variable Screen
  • Flow Structure:
  1. About
  2. Product & Developer Guide
  3. Adapters

Global Variable Adapter

PreviousSubloop HelperNextMonitoring Helper Service

Last updated 2 years ago

The Global Variable adapter allows dynamic storage of values that can be used during runtime. This feature is useful for storing a specific key in OIP and reusing it in API filters by dynamically changing its values.

Sub handlers

  1. global variable retrieve - Fetch the value from DB during run time.

  2. global variable create - Create/ update the value during run time.

Interface Name: PrimaryOrders_Bizom_API_TO_EOSALES_FILE_Prod_V2

Requirement: To compensate for any delay at the Bizom GET API end, we implement Global variable logic to store the last created/modified time of the order. This will help OIP to fetch the orders based on the last received order time.

Global Variable Screen

In the left panel options, choose the Global Variable screen.

Click on the option to create and select the Client Name, Job Name and define the global variable name and global variable value which we need to configure and save.

Global variable values can accept only string data types. From bizom API, we will receive the time in HH:mm:ss format. As string data type can’t accept colon, hence we replace colon with R in global variable value. The same needs to be handled at the code level (freemarker template).

Flow Structure:

Step 1: Post the bizom access token API using REST adapter

By using the provided credentials we will hit the bizom token API and generate the token.

Request:

<User>

<username>eosalesintegration</username>

<password>E@$@ls</password>

</User>

Step 2 : globalVariableRetrieve Step

This step is used to retrieve the global variable we have configured in the global variable screen.

Step Type, Type: GLOBAL VARIABLE

Sub Type: globalVariableRetrieve

Request Template: We have to give the same name which we have defined in the global variable screen. eg: eosalesLastOrderDateKey.

Step 3 : Bizom List Order API

This step is used to get the data from the bizom list order API.

Parameters

Values

Access token

Get the token from first step

Fromdate

Value taken from global variable retrieve step

Fromtime

Value taken from global variable retrieve step

Todate

Next run time from job details

Totime

Next run time from job details

Start sequence

From job settings (Starts from 0 and iterates with each batch depending on the batch size.)

End Sequence

Calculated by OIP as, (Start Sequence + batch size) - 1

Date type

It can be created/modified based on the client requirements.

Hard coded as 1 (depends on the client)

Hard coded as 2 (depends on the client)

Based on the date type used in the API, read the date and time from Bizom API and add it to the list of data. This value can be utilized in the global variable create step.

Step 4: Nashorn Adapter

This step is used for creating headers and data for the list. This will be written to the file using the next 2 steps. The Nashorn step is used based on the logic requirements and is not a mandatory step.

Step 5: File Create Adapter

It is used to write the data to the file and create the file on the server.

Path:

eosales|B5HdfBcYIs|integrationftp.bizom.in|22|/integrationftp.bizom.in/eosales/bizom/Prod/Primaryorders|new|processed|inProcess

Step Settings:

Step 6: File Upload Adapter

It is used to upload the generated file to the target SFTP/FTP folder.

Path:

eosales|B5HdfBcYIs|integrationftp.bizom.in|22|/integrationftp.bizom.in/eosales/bizom/Prod/Primaryorders|new|processed|inProcess

Step Settings:

Step 7: globalVariableCreate Step:

This step is used to modify the global variable value based on the modified time of the last order.

Step Type, Type: GLOBAL VARIABLE

Sub Type: globalVariableCreate

Step Request Validation: For including dynamic batch count in the bizom get API parameters, we can add request validation in the create step. The global variable value is updated only after the last batch of each run. After each batch, this step throws a validation message as "Didn't try rest, validation error: Global Variable Will Update in Last Run".

At creation time, the value is taken from the object holder depending on the API step. If we receive data from Bizom API, the value can be taken from the last date in the current response, else it can be taken from the global variable retrieve step which is already stored in the database.

API:

API:

https://api.bizom.in/oauth/directLogin/xml
https://api.bizom.in/orders/listordersapi/?access_token=${configs['0'].values['1']['Token']}&responsetype=xml&fromdate=${startTime?number_to_date}&todate=${nextRunTime?date}&dateType=modified&startseq=${startSequence}&endseq=${endSequence}&fromtime=${startTime?number_to_time}&totime=${nextRunTime?time}&getPrimaryOrders=1&orderstate_id=2
getPrimaryOrders
orderstate_id