Integrating RestService with Mapper
Create an application.
Create an application named "RestServicewithMapper" to manage the workflow.

Create a workflow.
Within the application's Workflow folder, create a new workflow named "RestServicewithMapperWorkflow"

Trigger Selection
Select "REST Service" as the trigger option to initiate the workflow.

Add a RestService

Configure basic settings.
Name: Input a name for the RestService component.
Description: Add a description of the RestService, explaining its purpose or functionality.
Path: Specify the endpoint path for the RestService, indicating the URL where the service will be accessible.
Method: Select the HTTP method for the RestService (e.g., GET, POST, PUT, DELETE).
Media Type: Specify the media type or content type for the RestService, indicating the format of the data being sent or received (e.g., JSON, XML).
Name: "Product API"
Description: "RESTful API for managing product data"
Path: "/api/products"
Method: POST
Media Type: JSONAdd a Header
Name: Provide a field for users to input the header's name.
Value: Allow users to specify the value of the header.
Add Path Parameters
Name: Allow users to input the name of the path parameter.
Value: Provide a field for users to specify the value of the path parameter.
Add Query Parameters
Name: Provide a field for users to input the name of the query parameter.
Value: Allow users to specify the value of the query parameter.
{
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"price": {
"type": "number"
}
}
}
Note: Support common schema formats such as JSON schema or XML schema.
Validate the schema to ensure its correctness and compatibility with the RestService configuration.
Mapper Activity Integration
Mapper activity integration involves incorporating a mapping tool or activity into the workflow creation platform. The Mapper activity allows users to define transformation logic to manipulate data between input and output formats. Users can map fields, perform calculations, and apply other transformations to customize data processing within the workflow.

Name: Input a name for the Mapper component.
Description: Add a description of the Mapper.
Input Section:
Transform:
Source:
Select the source data for transformation. Source: Product Data
Target:
Select the target data for transformation. Target: Transformed Product Data
Mapping Expressions:
Define mapping expressions to transform data from the source to the target.

Mapping Expressions:
Source.id -> Target.productId
Source.name -> Target.productName
Source.price * 1.2 -> Target.priceWithTax
Response Configuration
Configuration Name: Input a name for the response configuration.
Description: Add a description of the response configuration.
Input Section:
Transform:
Source: Select the source data for transformation.
Target: Select the target data for transformation.
Mapping Expressions: Define mapping expressions to transform data from the source to the target.
Output Section
Select a Schema: Select a schema for the output data. You can choose either from existing schemas or upload a new schema.
Preview
Provide a preview of the transformed output data based on the selected schema and mapping expressions.

Last updated