From c027c21dc69e4cbf32d1488f38c72c2eee86b020 Mon Sep 17 00:00:00 2001 From: poorna2152 Date: Fri, 13 Dec 2024 11:57:41 +0530 Subject: [PATCH 1/2] Update the readme files --- README.md | 28 ++++++++++++++-------------- examples/price-calculation/README.md | 14 +++++++------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index cfe97f9..55da306 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -# Ballerina Connector SDK for WSO2 Micro Integrator +# WSO2 Micro Integrator Module Generator SDK for Ballerina ## Overview -The Ballerina Connector SDK for the WSO2 Micro Integrator enables the generation of connectors that allow the WSO2 MI to run Ballerina transformations. +The WSO2 Micro Integrator Module Generator SDK for Ballerina enables the generation of modules that allow the WSO2 MI to run Ballerina transformations. This integration enables you to leverage the powerful transformation capabilities of Ballerina within the environment of WSO2 Micro Integrator. -## Steps to Create Ballerina Connector +## Steps to Create Module for WSO2 MI from Ballerina -### Pull `mi` Tool +### Pull `mi-module-gen` Tool -First, you need to pull the `mi` tool which is used to create the Ballerina connector. +First, you need to pull the `mi-module-gen` tool which is used to create the WSO2 MI module. ```bash -bal tool pull mi +bal tool pull mi-module-gen ``` ### Write Ballerina Transformation @@ -31,21 +31,21 @@ public function gpa(xml rawMarks, xml credits) returns xml { Ballerina function that contains `@mi:ConnectorInfo` annotation maps with a component in Ballerina connector. -### Generate the connector +### Generate the module -Finally, use the `bal mi` command to generate the Ballerina connector for the WSO2 Micro Integrator. +Finally, use the `bal mi-module-gen` command to generate the WSO2 Micro Integrator module from Ballerina project. ```bash -bal mi -i +bal mi-module-gen ``` -Above command generates the connector zip in the same location. +Above command generates the module zip in the same location. -To add this generated connector to a WSO2 Micro Integrator project follow the instruction specified [here](https://mi.docs.wso2.com/en/latest/develop/creating-artifacts/adding-connectors/). +To add this generated module to a WSO2 Micro Integrator project follow the instruction specified [here](https://mi.docs.wso2.com/en/latest/develop/creating-artifacts/adding-connectors/). ## Local Build -1. Clone the repository [module-ballerinax-wso2.mi](https://github.com/ballerina-platform/module-ballerinax-wso2.mi.git) +1. Clone the repository [ballerina-module-wso2-mi](https://github.com/wso2-extensions/ballerina-module-wso2-mi.git) 2. Build the compiler plugin and publish locally: @@ -65,11 +65,11 @@ To add this generated connector to a WSO2 Micro Integrator project follow the in ./gradlew test ``` -## Performance Test Description for WSO2 MI Connector +## Performance Test Description for WSO2 MI Module ### Overview -The performance test for the WSO2 MI connector was conducted using JMeter with 60 users. +The performance test for the WSO2 MI module was conducted using JMeter with 60 users. The aim was to evaluate the throughput per second for different payload sizes using three different transformation methods: Ballerina JSON transformation, Ballerina record transformation, and Java class mediator. diff --git a/examples/price-calculation/README.md b/examples/price-calculation/README.md index f9b923d..e490a43 100644 --- a/examples/price-calculation/README.md +++ b/examples/price-calculation/README.md @@ -1,6 +1,6 @@ ## Overview -This sample demonstrates the use of a connector generated by the Ballerina MI SDK to perform price related calculation of an order. +This sample demonstrates the use of a module generated by the Ballerina MI SDK to perform price related calculation of an order. In this example, the resource `price-calculation` accepts an XML payload containing item details and calculates the total invoice value. This calculation is done by a function implemented in Ballerina, which processes an input payload of the following format: @@ -22,17 +22,17 @@ This would output a result in the following format. ## Steps to Invoke the Sample -Follow these steps to invoke the sample using the connector: +Follow these steps to invoke the sample using the module: -1. The `bal-price-calculation` folder contains the Ballerina code for the connector. Invoke the following command to generate the connector: +1. The `bal-price-calculation` folder contains the Ballerina code for the module. Invoke the following command to generate the module: ```bash - bal mi -i + bal mi-module-gen ``` -2. A ZIP file of the connector will be generated. Add this ZIP file to the MI project inside the folder `mi-price-calculation` following the approach described [here](https://mi.docs.wso2.com/en/latest/develop/creating-artifacts/adding-connectors/). +2. A ZIP file of the module will be generated. Add this ZIP file to the MI project inside the folder `mi-price-calculation` following the approach described [here](https://mi.docs.wso2.com/en/latest/develop/creating-artifacts/adding-connectors/). -3. Once the connector is added, run the MI project. +3. Once the module is added, run the MI project. 4. Send an HTTP POST request to the following resource with a payload as specified: @@ -52,7 +52,7 @@ Follow these steps to invoke the sample using the connector: pencil 12 - `' + ' ``` Output: From fe6cc8740ff6a87664b247faccb85d6b10299153 Mon Sep 17 00:00:00 2001 From: poorna2152 Date: Wed, 18 Dec 2024 14:26:26 +0530 Subject: [PATCH 2/2] Add why Ballerina module --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 55da306..d3988f8 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ The WSO2 Micro Integrator Module Generator SDK for Ballerina enables the generation of modules that allow the WSO2 MI to run Ballerina transformations. This integration enables you to leverage the powerful transformation capabilities of Ballerina within -the environment of WSO2 Micro Integrator. +the environment of WSO2 Micro Integrator. Unlike Class Mediators, Ballerina is a cloud-native programming language with +built-in support for JSON and XML, making data transformations simpler. It also allows the use of available Ballerina language +modules and connectors, enabling enhanced functionality and easier connectivity with external systems. ## Steps to Create Module for WSO2 MI from Ballerina @@ -29,7 +31,7 @@ public function gpa(xml rawMarks, xml credits) returns xml { } ``` -Ballerina function that contains `@mi:ConnectorInfo` annotation maps with a component in Ballerina connector. +Ballerina function that contains `@mi:ConnectorInfo` annotation maps with an operation in the Ballerina connector. ### Generate the module