A closer look at Bonita 2021.2: How to use Maven and develop extensions
Let's continue diving into some of the new features of Bonita 2021.2. Whether you are using Bonita Community or Bonita Enterprise, you will find in this series of posts some great new functionalities and improvements.
Last time I introduced you with the management of extensions with Bonita Project composition and its extension manager. Bonita provides a large set of extensions by default. But as a developer, I guess you would like to develop your own extensions to make sure they meet your needs. Using Maven archetypes makes it easy for you to do it.
Let’s deep dive into an extension creation with the example of a Bonita connector creation, publish it on Maven and import into Bonita Studio.
Which extensions can you create?
- Connectors, Actor filters and Themes are built outside Bonita Studio with dedicated Maven archetypes
- REST API Extensions can be built in Bonita Studio or outside Bonita Studio with the dedicated Maven archetype.
- Custom pages and custom widget are developed in Bonita UI designer
For more information about all extension points, you can read our documentation.
How can you develop your extensions?
Today we focus on the extensions that are built using Maven archetypes and imported in Bonita Studio using Bonita Extension manager.
A maven archetype is a maven project templating toolkit. This archetype allows you to bootstrap a Bonita extension project on your file system.
Moreover, the maven connector archetype offers the possibility to develop the connector in Java, Groovy or Kotlin.
- Maven installed
- Java installed
Steps of development
- Generate the project using Maven archetype
- Develop your extension
- Build your extension
Where to store and use your artifacts
Build your project and publish it
You can build your project and keep your extension on your computer as a .zip file. But you can also publish your Bonita extension on a maven repository, to make it available for Bonita Studio users.
Configure Bonita Studio Maven repository
To import your extensions easily, connection to remote Maven repositories has to be setup in Bonita Studio Preferences.
To create a new repository, follow those instructions, using the following parameters (in our example, as we are using GitHub packages):
Name: 1Github packages1
https://maven.pkg.github.com/<strong>OWNER</strong>/*, OWNER is the name of the user or organization account that owns the repository.
Releases and Snapshots: keep default values, disable snapshots (artifacts in development) if you don’t want them.
Bonita Studio now knows that he can retrieve extensions from this repository, but he cannot do it until authentication is configured. In Servers tab you are going to add the credentials for this repository.
Before you create a server, make sure that you have an access token with at least read access.
To create a new server, follow those instructions, using the following parameters:
Username: Your github username
Password: The access token
Import your extension
Finally you can Import the extension in your Bonita Studio project, as described in our post about Project composition.
Want to try it by yourself?
This tutorial is available as a video as well
There is a full tutorial available in our documentation.
And if you want to download an example, try the starwars connector, developed by Adrien.
In our next post, we will switch to Bonita Runtime and deep dive into Bonita new users interfaces. Stay tuned!