Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 12 Next »

  1. Design Process flow

  2. Create REST Provider End-point

  3. Publish the Provider (REST URL) at UI

Design Process flow

Overview

Backend Service for Download Input file, V3 Target File, Combined Error Report, Unsupported Product Code Report, and Account Structure Report.

Process Overview

This process flow service, supported by a structured process, retrieves all input file attachments, as well as output and error reports.

The flow contains data formatted in JSON using ContextTarget, which will be called by the REST provider API. This API is consumed in the UI and functions as a backend service for the UI.

Backend Process Flow :

image-20240625-054814.png

Once the flow has been designed, it needs to be published for the REST provider.

image-20240621-060942.png

Front-End Interface:

image-20240621-102607.png

a. Default Flow: To Download Input File Attachment

Process Overview

The Process flow is designed to manage input file requests, allowing users to download file files from the User Interface (UI). This flow functions as a backend service for the REST provider API. When a user triggers the API, this flow is invoked to handle the request.

Process flow:

image-20240621-101910.png

User Interface:

image-20240625-071303.png
Process Steps
  1. User Initiates File Download Request

  • Action: User interacts with the User Interface (UI) to request an input file download.

  • Trigger: User clicks the download button or selects the download option.

image-20240625-061301.png
  1. UI Sends Request to REST Provider API

  • Action: The UI sends an HTTP request to the REST provider API endpoint.

  • HTTP Method: GET

  1. REST Provider API Calls Default Flow

  • Action: The REST provider API receives the request and invokes the default flow to handle the file retrieval process.

  • Process: The API calls the backend service associated with the default flow.

  1. Backend Service Retrieves Input File Attachment

  • Action: The backend service retrieves the specified input file attachment from the server or database.

  • File Types: Input file V3, Target File Combined Error Report, Unsupported Product Code Report, Account Structure Report.

  1. Backend Service Returns File to REST Provider API

  • Action: The backend service sends data back to the REST provider API.

  1. REST Provider API Sends Response to UI

  • Action: The REST provider API sends the response containing the file data back to the UI.

  1. UI Processes and Provides File Download to User

  • Action: The UI processes the response and initiates the file download for the user.

  • Result: User receives the requested input file.

image-20240625-061112.png

Process flow Activity:

  1. Source Activity - The source comprises a database. It is necessary to create DbInfo and DbLayout to be invoked in the source activity

image-20240625-061734.png

Go to edit query and to write tables joining query.

You must utilize the EDIT Query option to efficiently retrieve attributes from multiple tables and display relevant information on the user interface. Additionally, you implement where clauses conditions to filter the data as needed.

image-20240625-062200.png

Query Details:

Table Name: DB/file_queueFQ/

 SQL Query

SELECT ID,FILE_QUEUE_ID,LOCATION_TYPE,FILE_TYPE,FILE_PATH,FILE_NAME,CREATED_BY,CREATED_DATE,LAST_MODIFIED_BY,LAST_MODIFIED_DATE FROM "file_name_details"

 Where Clauses

WHERE FILE_QUEUE_ID =$$fileQueueId$$ and FILE_TYPE ='$$fileType$$'

  1. Stream Selector - Use the Steam selector to specify the input stream to be consumed by the activity when there are two sources (DB).

image-20240625-063514.png
  1. Target Layout - The JSON schema for the source data (database) will be designed to be utilized in the RESTful API for the user interface. JSON is selected for its compatibility with RESTful APIs.

image-20240625-062850.png
  1. Mapping - Load the database schema and the target schema (JSON) to do one-to-one mapping.

    1. Apply the foreach loop to fetch the data one by one.

image-20240625-064052.png
  1. Context Target Using ContextTarget to store data in the flow which will be carried by the REST provider.

image-20240621-072858.png

b. Flow to Download the Output & Error Reports File:

Process Overview

The Process flow is designed to manage output & error report file requests, allowing users to download output & error report files from the User Interface (UI). This flow functions as a backend service for the REST provider API. When a user triggers the API, this flow is invoked to handle the request.

Process Flow:

image-20240625-070841.png

FrondEnd:

image-20240625-064854.png
Process Steps
  1. User Initiates File Download Request

  • Action: User interacts with the User Interface (UI) to request an Output & Error Report file download.

  • Trigger: User clicks the download button or selects the download option.

image-20240625-061301.png
  1. UI Sends Request to REST Provider API

  • Action: The UI sends an HTTP request to the REST provider API endpoint.

  • HTTP Method: GET

  1. REST Provider API Calls Default Flow

  • Action: The REST provider API receives the request and invokes the default flow to handle the file retrieval process.

  • Process: The API calls the backend service associated with the default flow.

  1. Backend Service Retrieves Input File Attachment

  • Action: The backend service retrieves the specified input file attachment from the server or database.

  • File Types: v3 Output file, EBMR output file, Dropped record file, Error file, Filtered product list, Dropped record, DBQUERY_FILE

  1. Backend Service Returns File to REST Provider API

  • Action: The backend service sends data back to the REST provider API.

  1. REST Provider API Sends Response to UI

  • Action: The REST provider API sends the response containing the file data back to the UI.

  1. UI Processes and Provides File Download to User

  • Action: The UI processes the response and initiates the file download for the user.

  • Result: User receives the requested input file.

image-20240625-070656.png

Process flow Activity:

  1. Source Activity - The source comprises a database. It is necessary to create DbInfo and DbLayout to be invoked in the source activity.

image-20240625-073205.png

Go to edit query and to write tables joining query.

You must utilize the EDIT Query option to efficiently retrieve attributes from multiple tables and display relevant information on the user interface. Additionally, you implement where clauses conditions to filter the data as needed.

image-20240625-072546.png

Query Details:

Table Name: DB/file_queueFQ/

 SQL Query

SELECT ID,FILE_QUEUE_ID,LOCATION_TYPE,FILE_TYPE,FILE_PATH,FILE_NAME,CREATED_BY,CREATED_DATE,LAST_MODIFIED_BY,LAST_MODIFIED_DATE FROM "file_name_details"

 Where Clause

WHERE FILE_QUEUE_ID =$$fileQueueId$$ and FILE_TYPE IN('ERROR_REPORT_FILE','V3_OUTPUT_FILE','FILTERED_PRODUCTS_LIST','DBQUERY_FILE','EBMR_OUTPUT_FILE')

  1. Stream Selector - Use the Steam selector to specify the input stream to be consumed by the activity when there are two sources (DB).

image-20240625-063514.png
  1. Target Layout - The JSON schema for the source data (database) will be designed to be utilized in the RESTful API for the user interface. JSON is selected for its compatibility with RESTful APIs.

image-20240625-062850.png
  1. Mapping - Load the database schema and the target schema (JSON) to do one-to-one mapping.

    1. Apply the for each loop to fetch the data one by one.

image-20240625-064052.png
  1. Context Target Using ContextTarget to store data in the flow which will be carried by the REST provider.

image-20240621-072858.png

3. Create REST Provider End-point

In this particular use case, the process flow is shared by developing a REST provider that will eventually be integrated with the user interface.

Follow the steps below to create a REST Provider:

  1. Click Configure > WEB SERVICES > REST Provider.

  2. Click Create REST Provider

  3. In the Create REST Provider window, type the name and description of the new Web Service Provider service in the Name and Description fields respectively.

image-20240625-071814.png
  1. Type API Version, for example, your API version can be 1

  2. Type the resource end path URL in the Resource End Path field. The URL can be static or dynamic. Static URL example:  /get/File 

  3. Select the process flow name to trigger with the web service from the Process Flow Name field. example: Pf_Attachment

    1. Set parameterName attribute of the context source should be restRequest

      1. fileQueueId-This process will generate a unique File ID for each file.

      2. fileType - Type of file downloading such as Input, Output, and Report files.

image-20240625-085143.png

The above variables need to be bound in the user interface to process requests from the user.

  1. Click Add Method and select GET as the method type.

image-20240621-063007.png
  1. Select the Response Schema (For example, we are opting for the schema that has been utilized in the process flow as the target schema)

image-20240625-090245.png
  1. Save it.

Publish REST

  • No labels