[[bonita-component]]
= Bonita Component
:docTitle: Bonita
:artifactId: camel-bonita
:description: Communicate with a remote Bonita BPM process engine.
:since: 2.19
:supportLevel: Stable
:component-header: Only producer is supported
include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/bonita.adoc[opts=optional]

*Since Camel {since}*

*{component-header}*

Used for communicating with a remote Bonita BPM process engine.

== URI format

[source,java]
------------------------------
bonita://[operation]?[options]
------------------------------

Where *operation* is the specific action to perform on Bonita.

== General Options

// component options: START
The Bonita component supports 2 options, which are listed below.



[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
|===
// component options: END


// endpoint options: START
The Bonita endpoint is configured using URI syntax:

----
bonita:operation
----

with the following path and query parameters:

=== Path Parameters (1 parameters):


[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *operation* | *Required* Operation to use. There are 1 enums and the value can be one of: startCase |  | BonitaOperation
|===


=== Query Parameters (7 parameters):


[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
| *hostname* (producer) | Hostname where Bonita engine runs | localhost | String
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean
| *port* (producer) | Port of the server hosting Bonita engine | 8080 | String
| *processName* (producer) | Name of the process involved in the operation |  | String
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
| *password* (security) | Password to authenticate to Bonita engine. |  | String
| *username* (security) | Username to authenticate to Bonita engine. |  | String
|===
// endpoint options: END


== Body content

For the startCase operation, the input variables are retrieved from the body message. This one has to contains a Map<String,Serializable>.


== Examples

The following example start a new case in Bonita:

[source,java]
----------------------------------------------------------------------
from("direct:start").to("bonita:startCase?hostname=localhost&amp;port=8080&amp;processName=TestProcess&amp;username=install&amp;password=install")
----------------------------------------------------------------------

== Dependencies

To use Bonita in your Camel routes you need to add a dependency on
*camel-bonita*, which implements the component.

If you use Maven you can just add the following to your pom.xml,
substituting the version number for the latest and greatest release (see
the download page for the latest versions).

[source,java]
-------------------------------------
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-bonita</artifactId>
  <version>x.x.x</version>
</dependency>
-------------------------------------

include::camel-spring-boot::page$bonita-starter.adoc[]
