wso2/mi_module_gen Ballerina Tool

0.4.3
Package Overview

Build License

The mi-module-gen package provides a Ballerina tool for generating WSO2 Micro Integrator modules from Ballerina code.

Overview

This tool enables developers to:

  • Write transformation and integration logic using Ballerina
  • Generate deployable modules for WSO2 Micro Integrator
  • Generate MI connectors from Ballerina connectors
  • Leverage Ballerina's type safety and expressiveness for MI development

Quick Start

Prerequisites

  • Ballerina 2201.13.1 or later
  • Java 21 or later
  • WSO2 Micro Integrator 4.4.0 or later

Installation

Pull the tool using the Ballerina CLI:

Copy
$ bal tool pull mi-module-gen

Usage

  1. Create a Ballerina project with your transformation logic:
Copy
import wso2/mi;

@mi:Operation
public function transform(xml input) returns xml {
    // Your transformation logic here
}
  1. Generate the MI module:
Copy
$ bal mi-module-gen -i <path_to_ballerina_project>
  1. Deploy the generated module to WSO2 Micro Integrator.

Generate MI Connector from Ballerina Connector

You can generate an MI connector from an existing Ballerina connector:

  1. Pull the Ballerina connector from Ballerina Central:
Copy
$ bal pull ballerinax/<connector_name>
  1. Generate the MI connector:
Copy
$ bal mi-module-gen -i {user.home}/.ballerina/repositories/central.ballerina.io/bala/ballerinax/<connector_name>/<version>/any -t <output_directory>

For example, to generate an MI connector from the ballerinax/github connector:

Copy
$ bal pull ballerinax/github
$ bal mi-module-gen -i {user.home}/.ballerina/repositories/central.ballerina.io/bala/ballerinax/github/6.0.0/any -t generatedMiConnector

Command Options

OptionDescription
-i, --inputPath to the Ballerina project or pulled connector
-t, --targetOutput directory for the generated MI connector

Building from Source

Copy
$ git clone https://github.com/wso2-extensions/ballerina-mi-module-gen-tool.git
$ cd ballerina-mi-module-gen-tool
$ ./gradlew clean :tool-mi-module-gen:localPublish

Contributing

Contributions are welcome! Please read the contribution guidelines before submitting a pull request.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Other versions

Metadata

Released date: 11 days ago

Version: 0.4.3


Compatibility

Platform: java21

Ballerina version: 2201.13.1

GraalVM compatible: Yes


Pull count

Total: 4775

Current verison: 77


Weekly downloads