Skip to content

bonitasoft/bonita-connector-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Rest Connector

A multi-connector project for the Bonita BPM platform to execute REST requests from a process.

Actions Status Sonarcloud Status GitHub release Maven Central License: GPL v2


πŸ“¦ Available Connectors

This project builds 9 distinct connector packages from one unified codebase:

REST API Connectors (8)

Connector Definition ID Purpose Has Body
GET rest-get Retrieve resources ❌
POST rest-post Create resources βœ…
PUT rest-put Update resources βœ…
DELETE rest-delete Delete resources ❌
PATCH rest-patch Partial updates βœ…
HEAD rest-head Check resource existence ❌
File POST rest-file-post Upload files via POST βœ…
File PUT rest-file-put Upload files via PUT βœ…

OAuth2 Token Connector (1)

Connector Definition ID Purpose Output
OAuth2 Auth oauth-auth Retrieve OAuth2 access tokens token

✨ Features

Authentication

  • βœ… None - No authentication
  • βœ… Basic Auth - Username/password authentication
  • βœ… Digest Auth - Challenge-response authentication
  • βœ… Custom Header - API key or custom token authentication
  • βœ… OAuth2 Client Credentials - Automated token acquisition for service-to-service
  • βœ… OAuth2 Authorization Code - User authentication with PKCE support
  • βœ… OAuth2 Bearer - Pre-obtained token usage

Security & SSL/TLS

  • βœ… Trust strategies: DEFAULT, TRUST_SELF_SIGNED, TRUST_ALL
  • βœ… Custom keystores and truststores
  • βœ… Hostname verification modes
  • βœ… Client certificate authentication

Networking

  • βœ… Proxy support - HTTP/HTTPS/SOCKS with authentication
  • βœ… Timeout configuration - Connection, socket, and request timeouts
  • βœ… Retry logic - Configurable retry strategies for transient failures

Request Configuration

  • βœ… Custom headers - Multiple headers with expression support
  • βœ… Cookies - Cookie management and injection
  • βœ… Content negotiation - JSON/XML/form-urlencoded/multipart
  • βœ… File uploads - Multipart form data with binary file support
  • βœ… Bonita document integration - Read request body from process documents

Response Handling

  • βœ… JSON auto-detection - Automatic parsing based on Content-Type
  • βœ… Status code extraction - HTTP status code and message capture
  • βœ… Header extraction - Response header access
  • βœ… Body capture - Raw string or parsed object output

Advanced

  • βœ… Bonita context injection - Process/activity metadata in headers
  • βœ… Sensitive data masking - Automatic log sanitization for tokens/passwords
  • βœ… Token caching - In-memory OAuth2 token reuse with expiration management
  • βœ… Multi-language support - EN, FR, ES, JA localization

πŸ”§ Build

Requirements

  • Java: 11+
  • Maven: 3.6+ (wrapper included)
  • Target Bonita: 7.14.0

Clone or fork this repository

git clone https://github.com/bonitasoft/bonita-connector-rest.git

Build all connectors (runs unit + integration tests)

./mvnw

Clean build and package (with tests)

./mvnw clean verify

Run unit tests only

./mvnw test

Build and package only (skiping tests)

./mvnw package -DskipTests

Run specific test class

./mvnw test -Dtest=RESTConnectorTest

Run specific test method

./mvnw test -Dtest=RESTConnectorTest#testExecuteBusinessLogic

Sonar analysis

./mvnw sonar:sonar

Build Output

The build produces 9 ZIP packages in target/

Each ZIP contains:

  • {connector-name}.impl - Connector implementation descriptor
  • classpath/ - All required JAR dependencies

πŸ“‹ Versioning Strategy

This project uses a dual-versioning approach to maintain backward compatibility:

Definition Version ({connector}.def.version)

  • Purpose: Stable version for connector definition (UI contract)
  • Stability: Only incremented when input/output parameters change
  • Scope: Bonita Studio connector configuration compatibility
  • Example: get.def.version=1.4.0 (stable)

Implementation Version ({connector}.impl.version)

  • Purpose: Tracks project version and implementation changes
  • Value: Always set to ${project.version} from POM
  • Scope: Internal logic, bug fixes, feature enhancements, New featues
  • Example: get.impl.version=1.5.0-SNAPSHOT (tracks POM version)

Versioning Rules

Increment definition version when:

  • βœ… Adding new parameters
  • βœ… Removing parameters
  • βœ… Changing parameter types
  • βœ… Changing output parameter schema

Do NOT increment definition version for:

  • ❌ Internal logic improvements
  • ❌ Bug fixes
  • ❌ Performance optimizations

Always increment implementation version (via project version) for:

  • βœ… Any code change
  • βœ… Bug fixes
  • βœ… New features
  • βœ… Dependency updates

Release

In order to create a new release:

  • On the release branch, make sure to update the pom version (remove the -SNAPSHOT)
  • Run the release action, set the version to release as parameter. The release will be published to Maven Central.
  • Update the master branch with the next SNAPSHOT version.

Once this is done, update the Bonita marketplace repository with the new version of the connector.

Contributing

We would love you to contribute, pull requests are welcome! Please see the CONTRIBUTING.md for more information.

License

The sources and documentation in this project are released under the GPLv2 License