This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 08fb6ff7d0f9 CAMEL-27611: camel-bonita - exact process name, 
processVersion, basePath, required options checked at start (#30999)
08fb6ff7d0f9 is described below

commit 08fb6ff7d0f9df2d8025baf0096e34c1dedb379e
Author: allthingssecurity <[email protected]>
AuthorDate: Sat Nov 28 00:26:12 2026 +0530

    CAMEL-27611: camel-bonita - exact process name, processVersion, basePath, 
required options checked at start (#30999)
    
    2. BonitaAPI.getProcessDefinition() sent processName as the search term s
       of GET /API/bpm/process and took the first result, so a process whose 
name
       only contains processName, or another version, could get the case. It now
       filters on the exact name (f=name=...) and, with the new processVersion
       option, on the version (f=version=...). When several versions match and
       processVersion is not set, the first one that Bonita returns is used as
       before, and a WARN names the version used. As the lookup runs for every
       exchange, the WARN is logged once per process name and producer; later
       lookups log it at DEBUG, so the log is not flooded.
    
    3. processName, username and password are marked required, and the producer
       fails to start with an IllegalArgumentException that names the missing
       option, instead of failing every exchange.
    
    4. The base URI was always http://host:port/bonita. The new basePath option
       (default /bonita) sets the context path for the REST API, the login and
       the file uploads, for a server deployed under another path or behind a
       reverse proxy. BonitaAPIConfig gets a constructor with the base path; the
       old constructor keeps /bonita. 
BonitaAPIConfig.getProcessFileUploadBaseURI
       (not used by the component) missed the "/" between the base path and
       portal/resource, and now has it.
    
    5. BonitaConfiguration.setParameters(Map) is not called by Camel and handles
       three of the options only. It is deprecated, not removed, as the class is
       public.
    
    Not changed: 1 (a login before every request). Reusing the session needs
    session state shared by the concurrent exchanges of a producer, and a retry
    of the request that gets the 401 when the session expires, as a request
    filter cannot repeat a request. That touches every request path (lookup,
    uploads, instantiation) and is left for its own change.
    
    The process lookup stubs of the existing tests match the f=name=orders
    filter instead of s=orders. A new test checks that three exchanges log one
    WARN about the two versions and two DEBUG lines. Regenerated bonita.json 
(component and catalog
    copy), the endpoint configurer and URI factory, and the endpoint DSL.
    Upgrade guide entry for 4.24.
    
    CAMEL-27611: camel-bonita - review: test the missing username, split the 
upgrade guide sentence
    
    BonitaProcessLookupTest gets producerDoesNotStartWithoutUsername next to
    the password test: the producer does not start without username, the
    cause is an IllegalArgumentException that names the option, and no
    request was sent to the server. doStart() checks processName, username
    and password, and now each of them has a test.
    
    The first sentence of the upgrade guide entry is split at "A process
    whose name only contains the given name...", as suggested in the review.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 .../apache/camel/catalog/components/bonita.json    |  14 +-
 .../component/bonita/BonitaEndpointConfigurer.java |  12 ++
 .../component/bonita/BonitaEndpointUriFactory.java |   4 +-
 .../org/apache/camel/component/bonita/bonita.json  |  14 +-
 .../component/bonita/BonitaConfiguration.java      |  50 ++++-
 .../camel/component/bonita/api/BonitaAPI.java      |  46 ++++-
 .../component/bonita/api/util/BonitaAPIConfig.java |  39 +++-
 .../bonita/producer/BonitaStartProducer.java       |  17 +-
 .../component/bonita/BonitaProcessLookupTest.java  | 222 +++++++++++++++++++++
 .../bonita/BonitaStartCaseFileUploadTest.java      |  13 +-
 .../bonita/BonitaStartProducerClientTest.java      |   2 +-
 .../component/bonita/BonitaStartProducerTest.java  |   2 +-
 .../bonita/api/util/BonitaAPIConfigTest.java       |  16 ++
 .../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc    |  13 ++
 .../endpoint/dsl/BonitaEndpointBuilderFactory.java |  55 ++++-
 15 files changed, 478 insertions(+), 41 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bonita.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bonita.json
index b7d7e73c9f39..d424ee6e8de0 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bonita.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/bonita.json
@@ -36,11 +36,13 @@
   },
   "properties": {
     "operation": { "index": 0, "kind": "path", "displayName": "Operation", 
"group": "producer", "label": "", "required": true, "type": "enum", "javaType": 
"org.apache.camel.component.bonita.util.BonitaOperation", "enum": [ "startCase" 
], "deprecated": false, "autowired": false, "secret": false, 
"configurationClass": "org.apache.camel.component.bonita.BonitaConfiguration", 
"configurationField": "configuration", "description": "The operation to 
perform. Only startCase is supported: it star [...]
-    "hostname": { "index": 1, "kind": "parameter", "displayName": "Hostname", 
"group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "localhost", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The host name of the Bonita server. The 
producer calls the REST API under the \/bonita con [...]
-    "port": { "index": 2, "kind": "parameter", "displayName": "Port", "group": 
"producer", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "8080", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The HTTP port of the Bonita server." },
-    "processName": { "index": 3, "kind": "parameter", "displayName": "Process 
Name", "group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The name of the process to start a case of. 
The producer searches the processes of the Bonita REST API for this  [...]
-    "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "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 produc [...]
-    "password": { "index": 5, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The password of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
-    "username": { "index": 6, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The username of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
+    "basePath": { "index": 1, "kind": "parameter", "displayName": "Base Path", 
"group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "\/bonita", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The context path of the Bonita web application 
on the server, such as \/bonita or the path [...]
+    "hostname": { "index": 2, "kind": "parameter", "displayName": "Hostname", 
"group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "localhost", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The host name of the Bonita server. The 
producer calls the REST API under the context path [...]
+    "port": { "index": 3, "kind": "parameter", "displayName": "Port", "group": 
"producer", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "8080", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The HTTP port of the Bonita server." },
+    "processName": { "index": 4, "kind": "parameter", "displayName": "Process 
Name", "group": "producer", "label": "", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The exact name of the process to start a case 
of. When the process is deployed in several versions, processVersio [...]
+    "processVersion": { "index": 5, "kind": "parameter", "displayName": 
"Process Version", "group": "producer", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The version of the process to start a case of. 
If not set and the process is deployed in several versions, [...]
+    "lazyStartProducer": { "index": 6, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "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 produc [...]
+    "password": { "index": 7, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The password of the Bonita account. The 
producer logs in with it at the loginservice of Bon [...]
+    "username": { "index": 8, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The username of the Bonita account. The 
producer logs in with it at the loginservice of Bon [...]
   }
 }
diff --git 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointConfigurer.java
 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointConfigurer.java
index 0c7568573e61..357f594dd7ac 100644
--- 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointConfigurer.java
+++ 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointConfigurer.java
@@ -24,6 +24,8 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
     public boolean configure(CamelContext camelContext, Object obj, String 
name, Object value, boolean ignoreCase) {
         BonitaEndpoint target = (BonitaEndpoint) obj;
         switch (ignoreCase ? name.toLowerCase(Locale.ROOT) : name) {
+        case "basepath":
+        case "basePath": 
target.getConfiguration().setBasePath(property(camelContext, 
java.lang.String.class, value)); return true;
         case "hostname": 
target.getConfiguration().setHostname(property(camelContext, 
java.lang.String.class, value)); return true;
         case "lazystartproducer":
         case "lazyStartProducer": 
target.setLazyStartProducer(property(camelContext, boolean.class, value)); 
return true;
@@ -31,6 +33,8 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
         case "port": target.getConfiguration().setPort(property(camelContext, 
java.lang.String.class, value)); return true;
         case "processname":
         case "processName": 
target.getConfiguration().setProcessName(property(camelContext, 
java.lang.String.class, value)); return true;
+        case "processversion":
+        case "processVersion": 
target.getConfiguration().setProcessVersion(property(camelContext, 
java.lang.String.class, value)); return true;
         case "username": 
target.getConfiguration().setUsername(property(camelContext, 
java.lang.String.class, value)); return true;
         default: return false;
         }
@@ -39,6 +43,8 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
     @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase(Locale.ROOT) : name) {
+        case "basepath":
+        case "basePath": return java.lang.String.class;
         case "hostname": return java.lang.String.class;
         case "lazystartproducer":
         case "lazyStartProducer": return boolean.class;
@@ -46,6 +52,8 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
         case "port": return java.lang.String.class;
         case "processname":
         case "processName": return java.lang.String.class;
+        case "processversion":
+        case "processVersion": return java.lang.String.class;
         case "username": return java.lang.String.class;
         default: return null;
         }
@@ -55,6 +63,8 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
     public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
         BonitaEndpoint target = (BonitaEndpoint) obj;
         switch (ignoreCase ? name.toLowerCase(Locale.ROOT) : name) {
+        case "basepath":
+        case "basePath": return target.getConfiguration().getBasePath();
         case "hostname": return target.getConfiguration().getHostname();
         case "lazystartproducer":
         case "lazyStartProducer": return target.isLazyStartProducer();
@@ -62,6 +72,8 @@ public class BonitaEndpointConfigurer extends 
PropertyConfigurerSupport implemen
         case "port": return target.getConfiguration().getPort();
         case "processname":
         case "processName": return target.getConfiguration().getProcessName();
+        case "processversion":
+        case "processVersion": return 
target.getConfiguration().getProcessVersion();
         case "username": return target.getConfiguration().getUsername();
         default: return null;
         }
diff --git 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointUriFactory.java
 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointUriFactory.java
index 78c3eaa20d61..e6c19c1b08a7 100644
--- 
a/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointUriFactory.java
+++ 
b/components/camel-bonita/src/generated/java/org/apache/camel/component/bonita/BonitaEndpointUriFactory.java
@@ -24,13 +24,15 @@ public class BonitaEndpointUriFactory extends 
org.apache.camel.support.component
     private static final Set<String> ENDPOINT_IDENTITY_PROPERTY_NAMES;
     private static final Map<String, String> MULTI_VALUE_PREFIXES;
     static {
-        Set<String> props = new HashSet<>(7);
+        Set<String> props = new HashSet<>(9);
+        props.add("basePath");
         props.add("hostname");
         props.add("lazyStartProducer");
         props.add("operation");
         props.add("password");
         props.add("port");
         props.add("processName");
+        props.add("processVersion");
         props.add("username");
         PROPERTY_NAMES = Collections.unmodifiableSet(props);
         Set<String> secretProps = new HashSet<>(2);
diff --git 
a/components/camel-bonita/src/generated/resources/META-INF/org/apache/camel/component/bonita/bonita.json
 
b/components/camel-bonita/src/generated/resources/META-INF/org/apache/camel/component/bonita/bonita.json
index b7d7e73c9f39..d424ee6e8de0 100644
--- 
a/components/camel-bonita/src/generated/resources/META-INF/org/apache/camel/component/bonita/bonita.json
+++ 
b/components/camel-bonita/src/generated/resources/META-INF/org/apache/camel/component/bonita/bonita.json
@@ -36,11 +36,13 @@
   },
   "properties": {
     "operation": { "index": 0, "kind": "path", "displayName": "Operation", 
"group": "producer", "label": "", "required": true, "type": "enum", "javaType": 
"org.apache.camel.component.bonita.util.BonitaOperation", "enum": [ "startCase" 
], "deprecated": false, "autowired": false, "secret": false, 
"configurationClass": "org.apache.camel.component.bonita.BonitaConfiguration", 
"configurationField": "configuration", "description": "The operation to 
perform. Only startCase is supported: it star [...]
-    "hostname": { "index": 1, "kind": "parameter", "displayName": "Hostname", 
"group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "localhost", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The host name of the Bonita server. The 
producer calls the REST API under the \/bonita con [...]
-    "port": { "index": 2, "kind": "parameter", "displayName": "Port", "group": 
"producer", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "8080", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The HTTP port of the Bonita server." },
-    "processName": { "index": 3, "kind": "parameter", "displayName": "Process 
Name", "group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The name of the process to start a case of. 
The producer searches the processes of the Bonita REST API for this  [...]
-    "lazyStartProducer": { "index": 4, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "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 produc [...]
-    "password": { "index": 5, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The password of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
-    "username": { "index": 6, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The username of the Bonita account. The 
producer logs in with it at the loginservice of Bo [...]
+    "basePath": { "index": 1, "kind": "parameter", "displayName": "Base Path", 
"group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "\/bonita", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The context path of the Bonita web application 
on the server, such as \/bonita or the path [...]
+    "hostname": { "index": 2, "kind": "parameter", "displayName": "Hostname", 
"group": "producer", "label": "", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": "localhost", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The host name of the Bonita server. The 
producer calls the REST API under the context path [...]
+    "port": { "index": 3, "kind": "parameter", "displayName": "Port", "group": 
"producer", "label": "", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": "8080", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The HTTP port of the Bonita server." },
+    "processName": { "index": 4, "kind": "parameter", "displayName": "Process 
Name", "group": "producer", "label": "", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The exact name of the process to start a case 
of. When the process is deployed in several versions, processVersio [...]
+    "processVersion": { "index": 5, "kind": "parameter", "displayName": 
"Process Version", "group": "producer", "label": "", "required": false, "type": 
"string", "javaType": "java.lang.String", "deprecated": false, "autowired": 
false, "secret": false, "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The version of the process to start a case of. 
If not set and the process is deployed in several versions, [...]
+    "lazyStartProducer": { "index": 6, "kind": "parameter", "displayName": 
"Lazy Start Producer", "group": "producer (advanced)", "label": 
"producer,advanced", "required": false, "type": "boolean", "javaType": 
"boolean", "deprecated": false, "autowired": false, "secret": false, 
"defaultValue": false, "description": "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 produc [...]
+    "password": { "index": 7, "kind": "parameter", "displayName": "Password", 
"group": "security", "label": "security", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The password of the Bonita account. The 
producer logs in with it at the loginservice of Bon [...]
+    "username": { "index": 8, "kind": "parameter", "displayName": "Username", 
"group": "security", "label": "security", "required": true, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": true, "security": "secret", "configurationClass": 
"org.apache.camel.component.bonita.BonitaConfiguration", "configurationField": 
"configuration", "description": "The username of the Bonita account. The 
producer logs in with it at the loginservice of Bon [...]
   }
 }
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaConfiguration.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaConfiguration.java
index 6c64a1660a76..acf19a16bc9c 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaConfiguration.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/BonitaConfiguration.java
@@ -31,23 +31,36 @@ public class BonitaConfiguration implements Cloneable {
                            + " process that the processName option names, with 
the contract inputs from the message body.")
     @Metadata(required = true)
     private BonitaOperation operation;
-    @UriParam(description = "The host name of the Bonita server. The producer 
calls the REST API under the"
-                            + " /bonita context path of this host.",
+    @UriParam(description = "The host name of the Bonita server. The producer 
calls the REST API under the context path"
+                            + " of the basePath option on this host.",
               defaultValue = "localhost")
     private String hostname = "localhost";
     @UriParam(description = "The HTTP port of the Bonita server.", 
defaultValue = "8080")
     private String port = "8080";
-    @UriParam(description = "The name of the process to start a case of. The 
producer searches the processes of the Bonita"
-                            + " REST API for this name and uses the first one 
found, and fails if none is found or the"
-                            + " option is not set.")
+    @UriParam(description = "The context path of the Bonita web application on 
the server, such as /bonita or the path"
+                            + " that a reverse proxy maps to it. The producer 
calls the REST API, the login and the file"
+                            + " uploads under it. A missing leading slash is 
added and a trailing slash removed, and /"
+                            + " is the root of the server.",
+              defaultValue = "/bonita")
+    private String basePath = "/bonita";
+    @UriParam(description = "The exact name of the process to start a case of. 
When the process is deployed in several"
+                            + " versions, processVersion selects one. The 
producer fails when it starts if the option is"
+                            + " not set, and fails the exchange if no process 
has this name.")
+    @Metadata(required = true)
     private String processName;
+    @UriParam(description = "The version of the process to start a case of. If 
not set and the process is deployed in"
+                            + " several versions, the producer uses the first 
one that Bonita returns and logs a WARN"
+                            + " that names it.")
+    private String processVersion;
     @UriParam(description = "The username of the Bonita account. The producer 
logs in with it at the loginservice of"
-                            + " Bonita before each request, and fails if it is 
not set.",
+                            + " Bonita before each request, and fails when it 
starts if the option is not set.",
               label = "security", security = "secret")
+    @Metadata(required = true)
     private String username;
     @UriParam(description = "The password of the Bonita account. The producer 
logs in with it at the loginservice of"
-                            + " Bonita before each request, and fails if it is 
not set.",
+                            + " Bonita before each request, and fails when it 
starts if the option is not set.",
               label = "security", security = "secret")
+    @Metadata(required = true)
     private String password;
 
     public String getHostname() {
@@ -66,6 +79,22 @@ public class BonitaConfiguration implements Cloneable {
         this.port = port;
     }
 
+    public String getBasePath() {
+        return basePath;
+    }
+
+    public void setBasePath(String basePath) {
+        this.basePath = basePath;
+    }
+
+    public String getProcessVersion() {
+        return processVersion;
+    }
+
+    public void setProcessVersion(String processVersion) {
+        this.processVersion = processVersion;
+    }
+
     public String getProcessName() {
         return processName;
     }
@@ -82,6 +111,13 @@ public class BonitaConfiguration implements Cloneable {
         this.operation = operation;
     }
 
+    /**
+     * Sets hostname, port and processName from a map. Camel does not call 
this method: the options are set through the
+     * generated configurer.
+     *
+     * @deprecated not used by Camel, and it handles only three of the 
options. Use the setters.
+     */
+    @Deprecated(since = "4.24.0")
     public void setParameters(Map<String, Object> parameters) {
         if (parameters.get("hostname") != null) {
             this.hostname = (String) parameters.get("hostname");
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/BonitaAPI.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/BonitaAPI.java
index d051f6966031..e09d5822901a 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/BonitaAPI.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/BonitaAPI.java
@@ -19,6 +19,8 @@ package org.apache.camel.component.bonita.api;
 import java.io.Serializable;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 
 import jakarta.ws.rs.client.WebTarget;
 import jakarta.ws.rs.core.GenericType;
@@ -30,14 +32,20 @@ import 
org.apache.camel.component.bonita.api.model.ProcessDefinitionResponse;
 import org.apache.camel.component.bonita.api.util.BonitaAPIConfig;
 import org.apache.camel.component.bonita.api.util.BonitaAPIUtil;
 import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import static jakarta.ws.rs.client.Entity.entity;
 
 public class BonitaAPI {
 
+    private static final Logger LOG = LoggerFactory.getLogger(BonitaAPI.class);
+
     private BonitaAPIConfig bonitaApiConfig;
     private WebTarget webTarget;
     private final BonitaAPIUtil bonitaApiUtil;
+    // the process names already warned about having several versions, so that 
the WARN is not logged for every exchange
+    private final Set<String> warnedSeveralVersions = 
ConcurrentHashMap.newKeySet();
 
     /**
      * @deprecated the file inputs are uploaded with a JAX-RS client of their 
own, which is never closed. Use
@@ -63,20 +71,48 @@ public class BonitaAPI {
         return webTarget;
     }
 
+    /**
+     * The process with exactly this name, in any version: see {@link 
#getProcessDefinition(String, String)}.
+     */
     public ProcessDefinitionResponse getProcessDefinition(String processName) {
+        return getProcessDefinition(processName, null);
+    }
+
+    /**
+     * The process with exactly this name and, when processVersion is not 
empty, this version. The name and the version
+     * are filters ({@code f=name=...}, {@code f=version=...}) of the Bonita 
REST API, not a search term, so another
+     * process whose name only contains the given name is not used. When 
several versions match, the first one that
+     * Bonita returns is used, and a WARN is logged the first time for each 
process name (later at DEBUG).
+     */
+    public ProcessDefinitionResponse getProcessDefinition(String processName, 
String processVersion) {
         if (ObjectHelper.isEmpty(processName)) {
             throw new IllegalArgumentException("processName is empty.");
         }
-        WebTarget resource = getBaseResource().path("process").queryParam("s", 
processName);
+        WebTarget resource = getBaseResource().path("process").queryParam("f", 
"name=" + processName);
+        if (ObjectHelper.isNotEmpty(processVersion)) {
+            resource = resource.queryParam("f", "version=" + processVersion);
+        }
         List<ProcessDefinitionResponse> listProcess = 
resource.request().accept(MediaType.APPLICATION_JSON)
                 .get(new GenericType<List<ProcessDefinitionResponse>>() {
                 });
-        if (!listProcess.isEmpty()) {
-            return listProcess.get(0);
-        } else {
+        if (listProcess.isEmpty()) {
             throw new RuntimeCamelException(
-                    "The process with name " + processName + " has not been 
retrieved");
+                    "The process with name " + processName
+                                            + 
(ObjectHelper.isNotEmpty(processVersion) ? " and version " + processVersion : 
"")
+                                            + " has not been retrieved");
+        }
+        ProcessDefinitionResponse first = listProcess.get(0);
+        if (listProcess.size() > 1) {
+            if (warnedSeveralVersions.add(processName)) {
+                LOG.warn("{} versions of the process {} are deployed, using 
version {}. Set processVersion to choose one."
+                         + " This is logged once for this process, later 
lookups log it at DEBUG.",
+                        listProcess.size(), processName, first.getVersion());
+            } else {
+                LOG.debug("{} versions of the process {} are deployed, using 
version {}", listProcess.size(), processName,
+                        first.getVersion());
+            }
         }
+        return first;
     }
 
     public CaseCreationResponse startCase(
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfig.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfig.java
index aaf95aa17f87..c347e821c5f9 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfig.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfig.java
@@ -18,10 +18,13 @@ package org.apache.camel.component.bonita.api.util;
 
 public class BonitaAPIConfig {
 
+    public static final String DEFAULT_BASE_PATH = "/bonita";
+
     private String hostname;
     private String port;
     private String username;
     private String password;
+    private String basePath = DEFAULT_BASE_PATH;
 
     public BonitaAPIConfig(String hostname, String port, String username, 
String password) {
         this.hostname = hostname;
@@ -30,12 +33,44 @@ public class BonitaAPIConfig {
         this.password = password;
     }
 
+    /**
+     * @param basePath the context path of the Bonita web application, such as 
/bonita; null means /bonita
+     */
+    public BonitaAPIConfig(String hostname, String port, String username, 
String password, String basePath) {
+        this(hostname, port, username, password);
+        setBasePath(basePath);
+    }
+
     public String getBaseBonitaURI() {
-        return "http://"; + hostname + ":" + port + "/bonita";
+        return "http://"; + hostname + ":" + port + basePath;
+    }
+
+    public String getBasePath() {
+        return basePath;
+    }
+
+    /**
+     * The context path of the Bonita web application. A missing leading slash 
is added and a trailing slash removed, so
+     * that the paths of the REST API can be appended; an empty path or / is 
the root of the server, and null is
+     * /bonita.
+     */
+    public void setBasePath(String basePath) {
+        if (basePath == null) {
+            this.basePath = DEFAULT_BASE_PATH;
+            return;
+        }
+        String path = basePath.trim();
+        while (path.endsWith("/")) {
+            path = path.substring(0, path.length() - 1);
+        }
+        if (!path.isEmpty() && !path.startsWith("/")) {
+            path = "/" + path;
+        }
+        this.basePath = path;
     }
 
     public String getProcessFileUploadBaseURI(String processName, String 
processVersion) {
-        return getBaseBonitaURI() + "portal/resource/process/" + processName + 
"/" + processVersion
+        return getBaseBonitaURI() + "/portal/resource/process/" + processName 
+ "/" + processVersion
                + "/API/formFileUpload";
     }
 
diff --git 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/producer/BonitaStartProducer.java
 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/producer/BonitaStartProducer.java
index b1b80180e2c1..bc3b7a8e9f58 100644
--- 
a/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/producer/BonitaStartProducer.java
+++ 
b/components/camel-bonita/src/main/java/org/apache/camel/component/bonita/producer/BonitaStartProducer.java
@@ -34,6 +34,7 @@ import org.apache.camel.component.bonita.api.BonitaAPIBuilder;
 import org.apache.camel.component.bonita.api.model.CaseCreationResponse;
 import org.apache.camel.component.bonita.api.model.ProcessDefinitionResponse;
 import org.apache.camel.component.bonita.api.util.BonitaAPIConfig;
+import org.apache.camel.util.ObjectHelper;
 import tools.jackson.core.JacksonException;
 import tools.jackson.databind.JsonNode;
 import tools.jackson.databind.ObjectMapper;
@@ -59,7 +60,18 @@ public class BonitaStartProducer extends BonitaProducer {
         String port = this.configuration.getPort();
         String username = this.configuration.getUsername();
         String password = this.configuration.getPassword();
-        BonitaAPIConfig bonitaAPIConfig = new BonitaAPIConfig(hostname, port, 
username, password);
+        // without them every exchange fails, so fail when the route starts 
instead
+        if (ObjectHelper.isEmpty(this.configuration.getProcessName())) {
+            throw new IllegalArgumentException("The processName option must be 
set on " + getEndpoint());
+        }
+        if (ObjectHelper.isEmpty(username)) {
+            throw new IllegalArgumentException("The username option must be 
set on " + getEndpoint());
+        }
+        if (ObjectHelper.isEmpty(password)) {
+            throw new IllegalArgumentException("The password option must be 
set on " + getEndpoint());
+        }
+        BonitaAPIConfig bonitaAPIConfig
+                = new BonitaAPIConfig(hostname, port, username, password, 
this.configuration.getBasePath());
         client = ClientBuilder.newBuilder().build();
         bonitaApi = BonitaAPIBuilder.build(bonitaAPIConfig, client);
     }
@@ -80,7 +92,8 @@ public class BonitaStartProducer extends BonitaProducer {
         Map inputs = getInputs(exchange);
         String processName = this.configuration.getProcessName();
         BonitaAPI api = bonitaApi;
-        ProcessDefinitionResponse processDefinition = 
api.getProcessDefinition(processName);
+        ProcessDefinitionResponse processDefinition
+                = api.getProcessDefinition(processName, 
this.configuration.getProcessVersion());
         CaseCreationResponse response = api.startCase(processDefinition, 
inputs);
         if (response != null) {
             exchange.getMessage().setHeader(BonitaConstants.CASE_ID, 
response.getCaseId());
diff --git 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaProcessLookupTest.java
 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaProcessLookupTest.java
new file mode 100644
index 000000000000..ec1bb70a9b64
--- /dev/null
+++ 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaProcessLookupTest.java
@@ -0,0 +1,222 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.bonita;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import com.github.tomakehurst.wiremock.WireMockServer;
+import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
+import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.bonita.api.BonitaAPI;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.Logger;
+import org.apache.logging.log4j.core.appender.AbstractAppender;
+import org.apache.logging.log4j.core.config.Configurator;
+import org.apache.logging.log4j.core.config.Property;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.anyRequestedFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * Which process a bonita producer starts a case of, under which context path, 
and that it does not start without the
+ * options it needs. The Bonita server is a WireMock server.
+ */
+class BonitaProcessLookupTest {
+
+    private WireMockServer server;
+    private CamelContext context;
+    private ProducerTemplate template;
+
+    @BeforeEach
+    void setup() {
+        server = new 
WireMockServer(WireMockConfiguration.options().dynamicPort());
+        server.start();
+        for (String base : new String[] { "/bonita", "/bpm/engine" }) {
+            server.stubFor(post(urlEqualTo(base + "/loginservice"))
+                    .willReturn(aResponse().withHeader("Set-Cookie", 
"JSESSIONID=session", "X-Bonita-API-Token=token")));
+            // any other lookup, such as a search for "orders": a process 
whose name only contains "orders"
+            server.stubFor(get(urlPathEqualTo(base + 
"/API/bpm/process")).atPriority(10)
+                    
.willReturn(json("[{\"id\":\"9\",\"name\":\"orders-archive\",\"version\":\"1.0\"}]")));
+            // the process named exactly "orders", deployed in two versions
+            server.stubFor(get(urlPathEqualTo(base + 
"/API/bpm/process")).atPriority(5)
+                    .withQueryParam("f", equalTo("name=orders"))
+                    
.willReturn(json("[{\"id\":\"7\",\"name\":\"orders\",\"version\":\"1.0\"},"
+                                     + 
"{\"id\":\"8\",\"name\":\"orders\",\"version\":\"2.0\"}]")));
+            server.stubFor(get(urlPathEqualTo(base + 
"/API/bpm/process")).atPriority(1)
+                    .withQueryParam("f", 
equalTo("name=orders")).withQueryParam("f", equalTo("version=2.0"))
+                    
.willReturn(json("[{\"id\":\"8\",\"name\":\"orders\",\"version\":\"2.0\"}]")));
+            for (String id : new String[] { "7", "8", "9" }) {
+                server.stubFor(post(urlEqualTo(base + "/API/bpm/process/" + id 
+ "/instantiation"))
+                        .willReturn(json("{\"caseId\":\"" + id + "00\"}")));
+            }
+        }
+        context = new DefaultCamelContext();
+    }
+
+    private static ResponseDefinitionBuilder json(String body) {
+        return aResponse().withHeader("Content-Type", 
"application/json").withBody(body);
+    }
+
+    @AfterEach
+    void tearDown() {
+        if (template != null) {
+            template.stop();
+        }
+        context.stop();
+        server.stop();
+    }
+
+    private void start(String options) throws Exception {
+        context.addRoutes(new RouteBuilder() {
+            @Override
+            public void configure() {
+                
from("direct:start").to("bonita:startCase?hostname=localhost&port=" + 
server.port() + options);
+            }
+        });
+        context.start();
+        template = context.createProducerTemplate();
+    }
+
+    private String startCase() {
+        Map<String, Object> inputs = new HashMap<>();
+        inputs.put("amount", 1);
+        Exchange exchange = template.send("direct:start", e -> 
e.getIn().setBody(inputs));
+        assertNull(exchange.getException(), "exception of the exchange");
+        return exchange.getMessage().getHeader(BonitaConstants.CASE_ID, 
String.class);
+    }
+
+    @Test
+    void processNameIsMatchedExactly() throws Exception {
+        start("&processName=orders&username=user&password=pass");
+
+        assertEquals("700", startCase(), "case of the process named orders, 
not of orders-archive");
+    }
+
+    @Test
+    void severalVersionsAreWarnedOnceNotForEveryExchange() throws Exception {
+        Logger logger = (Logger) LogManager.getLogger(BonitaAPI.class);
+        Level level = logger.getLevel();
+        LogEventCaptor captor = new LogEventCaptor();
+        Configurator.setLevel(logger.getName(), Level.DEBUG);
+        logger.addAppender(captor);
+        try {
+            start("&processName=orders&username=user&password=pass");
+
+            for (int i = 0; i < 3; i++) {
+                assertEquals("700", startCase(), "case of the first version 
that Bonita returns");
+            }
+        } finally {
+            logger.removeAppender(captor);
+            Configurator.setLevel(logger.getName(), level);
+        }
+
+        assertEquals(1, captor.messages(Level.WARN).size(), "one WARN for 
three exchanges: " + captor.messages(Level.WARN));
+        assertTrue(captor.messages(Level.WARN).get(0).contains("2 versions of 
the process orders"),
+                captor.messages(Level.WARN).get(0));
+        assertEquals(2, captor.messages(Level.DEBUG).size(), "the later 
lookups log at DEBUG");
+    }
+
+    @Test
+    void processVersionSelectsTheVersion() throws Exception {
+        
start("&processName=orders&processVersion=2.0&username=user&password=pass");
+
+        assertEquals("800", startCase(), "case of version 2.0");
+    }
+
+    @Test
+    void basePathIsTheContextPathOfTheRequests() throws Exception {
+        
start("&basePath=/bpm/engine/&processName=orders&username=user&password=pass");
+
+        assertEquals("700", startCase());
+        assertEquals(1, 
server.findAll(anyRequestedFor(urlPathEqualTo("/bpm/engine/API/bpm/process"))).size());
+        
assertTrue(server.findAll(anyRequestedFor(urlEqualTo("/bpm/engine/loginservice"))).size()
 > 0, "login");
+        
assertTrue(server.findAll(anyRequestedFor(urlPathEqualTo("/bonita/API/bpm/process"))).isEmpty());
+    }
+
+    @Test
+    void producerDoesNotStartWithoutProcessName() {
+        Exception e = assertThrows(Exception.class, () -> 
start("&username=user&password=pass"));
+        assertCause(e, "processName");
+    }
+
+    @Test
+    void producerDoesNotStartWithoutPassword() {
+        Exception e = assertThrows(Exception.class, () -> 
start("&processName=orders&username=user"));
+        assertCause(e, "password");
+        assertTrue(server.getAllServeEvents().isEmpty(), "no request was 
sent");
+    }
+
+    @Test
+    void producerDoesNotStartWithoutUsername() {
+        Exception e = assertThrows(Exception.class, () -> 
start("&processName=orders&password=pass"));
+        assertCause(e, "username");
+        assertTrue(server.getAllServeEvents().isEmpty(), "no request was 
sent");
+    }
+
+    private static void assertCause(Throwable e, String option) {
+        Throwable cause = e;
+        while (cause.getCause() != null && !(cause instanceof 
IllegalArgumentException)) {
+            cause = cause.getCause();
+        }
+        assertInstanceOf(IllegalArgumentException.class, cause);
+        assertTrue(cause.getMessage().contains(option), cause.getMessage());
+    }
+
+    private static final class LogEventCaptor extends AbstractAppender {
+        private final List<LogEvent> events = new CopyOnWriteArrayList<>();
+
+        LogEventCaptor() {
+            super("BonitaProcessLookupTestCaptor", null, null, false, 
Property.EMPTY_ARRAY);
+            start();
+        }
+
+        @Override
+        public void append(LogEvent event) {
+            events.add(event.toImmutable());
+        }
+
+        List<String> messages(Level level) {
+            return events.stream()
+                    .filter(event -> event.getLevel() == level)
+                    .map(event -> event.getMessage().getFormattedMessage())
+                    .toList();
+        }
+    }
+}
diff --git 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartCaseFileUploadTest.java
 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartCaseFileUploadTest.java
index 62746c12f999..b7c047cfeee8 100644
--- 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartCaseFileUploadTest.java
+++ 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartCaseFileUploadTest.java
@@ -184,7 +184,7 @@ class BonitaStartCaseFileUploadTest {
         server.stubFor(post(urlEqualTo(LOGIN))
                 .willReturn(aResponse().withHeader("Set-Cookie", 
"JSESSIONID=session-" + id,
                         "X-Bonita-API-Token=token-" + id)));
-        server.stubFor(get(urlPathEqualTo(PROCESS)).withQueryParam("s", 
equalTo("orders"))
+        server.stubFor(get(urlPathEqualTo(PROCESS)).withQueryParam("f", 
equalTo("name=orders"))
                 .willReturn(aResponse().withHeader("Content-Type", 
"application/json")
                         
.withBody("[{\"id\":\"7\",\"name\":\"orders\",\"version\":\"1.0\"}]")));
         server.stubFor(post(urlEqualTo(UPLOAD))
@@ -230,11 +230,20 @@ class BonitaStartCaseFileUploadTest {
         String received = "requests received by the Bonita server on port " + 
server.port();
         assertEquals(uploads, count(requests, UPLOAD), "file uploads among the 
" + received);
         assertEquals(cases, count(requests, INSTANTIATION), "case creations 
among the " + received);
-        assertEquals(lookups, count(requests, PROCESS + "?s=orders"), "process 
lookups among the " + received);
+        assertEquals(lookups, countLookups(requests), "process lookups among 
the " + received);
         assertEquals(logins, count(requests, LOGIN), "logins among the " + 
received);
         assertEquals(logins + lookups + uploads + cases, requests.size(), 
received);
     }
 
+    /**
+     * The lookups of the process named exactly orders (the f=name=orders 
filter of the Bonita REST API).
+     */
+    private static long countLookups(List<LoggedRequest> requests) {
+        return requests.stream()
+                .filter(r -> r.getUrl().startsWith(PROCESS + "?") && 
r.queryParameter("f").containsValue("name=orders"))
+                .count();
+    }
+
     private static long count(List<LoggedRequest> requests, String url) {
         return requests.stream().filter(r -> url.equals(r.getUrl())).count();
     }
diff --git 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartProducerClientTest.java
 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartProducerClientTest.java
index 05552976cf02..b52de76d6526 100644
--- 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartProducerClientTest.java
+++ 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartProducerClientTest.java
@@ -78,7 +78,7 @@ class BonitaStartProducerClientTest {
         server.start();
         server.stubFor(post(urlEqualTo(LOGIN))
                 .willReturn(aResponse().withHeader("Set-Cookie", 
"JSESSIONID=session", "X-Bonita-API-Token=token")));
-        server.stubFor(get(urlPathEqualTo(PROCESS)).withQueryParam("s", 
equalTo("orders"))
+        server.stubFor(get(urlPathEqualTo(PROCESS)).withQueryParam("f", 
equalTo("name=orders"))
                 .willReturn(aResponse().withHeader("Content-Type", 
"application/json")
                         
.withBody("[{\"id\":\"7\",\"name\":\"orders\",\"version\":\"1.0\"}]")));
         server.stubFor(post(urlEqualTo(UPLOAD))
diff --git 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartProducerTest.java
 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartProducerTest.java
index 3f083124f04b..becbeecf71aa 100644
--- 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartProducerTest.java
+++ 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/BonitaStartProducerTest.java
@@ -70,7 +70,7 @@ class BonitaStartProducerTest {
         server.start();
         server.stubFor(post(urlEqualTo(LOGIN))
                 .willReturn(aResponse().withHeader("Set-Cookie", 
"JSESSIONID=session", "X-Bonita-API-Token=token")));
-        server.stubFor(get(urlPathEqualTo(PROCESS)).withQueryParam("s", 
equalTo("orders"))
+        server.stubFor(get(urlPathEqualTo(PROCESS)).withQueryParam("f", 
equalTo("name=orders"))
                 .willReturn(aResponse().withHeader("Content-Type", 
"application/json")
                         
.withBody("[{\"id\":\"7\",\"name\":\"orders\",\"version\":\"1.0\"}]")));
         server.stubFor(post(urlEqualTo(INSTANTIATION))
diff --git 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfigTest.java
 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfigTest.java
index bb9b4842227c..d965d912bca1 100644
--- 
a/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfigTest.java
+++ 
b/components/camel-bonita/src/test/java/org/apache/camel/component/bonita/api/util/BonitaAPIConfigTest.java
@@ -28,4 +28,20 @@ public class BonitaAPIConfigTest {
         assertEquals("http://host:port/bonita";, config.getBaseBonitaURI());
     }
 
+    @Test
+    public void testBasePath() {
+        assertEquals("http://host:port/bpm";, new BonitaAPIConfig("host", 
"port", "u", "p", "/bpm/").getBaseBonitaURI());
+        assertEquals("http://host:port/bpm";, new BonitaAPIConfig("host", 
"port", "u", "p", "bpm").getBaseBonitaURI());
+        assertEquals("http://host:port";, new BonitaAPIConfig("host", "port", 
"u", "p", "/").getBaseBonitaURI());
+        assertEquals("http://host:port/bonita";, new BonitaAPIConfig("host", 
"port", "u", "p", null).getBaseBonitaURI());
+    }
+
+    @Test
+    public void testProcessFileUploadBaseURI() {
+        
assertEquals("http://host:port/bonita/portal/resource/process/orders/1.0/API/formFileUpload";,
+                new BonitaAPIConfig("host", "port", "u", 
"p").getProcessFileUploadBaseURI("orders", "1.0"));
+        
assertEquals("http://host:port/portal/resource/process/orders/1.0/API/formFileUpload";,
+                new BonitaAPIConfig("host", "port", "u", "p", 
"/").getProcessFileUploadBaseURI("orders", "1.0"));
+    }
+
 }
diff --git 
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 12d1bbcbd0bd..103ec6885c40 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -11144,6 +11144,19 @@ null`, also when a body was sent. Unmarshal JSON text 
to a `Map` before the boni
 
 The id of the started case is now set in the `CamelBonitaCaseId` header.
 
+=== camel-bonita - exact process name, and processName, username and password 
checked when the producer starts
+
+The `startCase` producer now looks up the process with the exact name of 
`processName` (the `f=name=...` filter of the
+Bonita REST API) instead of searching for it and taking the first result. A 
process whose name only contains the
+given name is no longer used. When the process is deployed in several 
versions, the new `processVersion` option
+selects one; without it the first version that Bonita returns is used, as 
before, and a WARN is logged once.
+
+A `bonita` producer without `processName`, `username` or `password` now fails 
when it starts (with
+`lazyStartProducer=true`, on its first exchange), instead of failing every 
exchange. The context path of the Bonita
+server can be set with the new `basePath` option (default `/bonita`).
+
+`BonitaConfiguration.setParameters(Map)` is deprecated. Camel does not call 
it; use the setters.
+
 === camel-camunda - a failed operation fails the exchange, and the JSON uses 
camelCase property names
 
 The producer caught the error of the Camunda client, and gave a response with 
`success` set to `false` and the error
diff --git 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BonitaEndpointBuilderFactory.java
 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BonitaEndpointBuilderFactory.java
index 014bd5839dbe..ecf228f48289 100644
--- 
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BonitaEndpointBuilderFactory.java
+++ 
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/BonitaEndpointBuilderFactory.java
@@ -44,9 +44,28 @@ public interface BonitaEndpointBuilderFactory {
             return (AdvancedBonitaEndpointBuilder) this;
         }
 
+        /**
+         * The context path of the Bonita web application on the server, such 
as
+         * /bonita or the path that a reverse proxy maps to it. The producer
+         * calls the REST API, the login and the file uploads under it. A
+         * missing leading slash is added and a trailing slash removed, and / 
is
+         * the root of the server.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Default: /bonita
+         * Group: producer
+         * 
+         * @param basePath the value to set
+         * @return the dsl builder
+         */
+        default BonitaEndpointBuilder basePath(String basePath) {
+            doSetProperty("basePath", basePath);
+            return this;
+        }
         /**
          * The host name of the Bonita server. The producer calls the REST API
-         * under the /bonita context path of this host.
+         * under the context path of the basePath option on this host.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -76,12 +95,14 @@ public interface BonitaEndpointBuilderFactory {
             return this;
         }
         /**
-         * The name of the process to start a case of. The producer searches 
the
-         * processes of the Bonita REST API for this name and uses the first 
one
-         * found, and fails if none is found or the option is not set.
+         * The exact name of the process to start a case of. When the process 
is
+         * deployed in several versions, processVersion selects one. The
+         * producer fails when it starts if the option is not set, and fails 
the
+         * exchange if no process has this name.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
+         * Required: true
          * Group: producer
          * 
          * @param processName the value to set
@@ -91,13 +112,30 @@ public interface BonitaEndpointBuilderFactory {
             doSetProperty("processName", processName);
             return this;
         }
+        /**
+         * The version of the process to start a case of. If not set and the
+         * process is deployed in several versions, the producer uses the first
+         * one that Bonita returns and logs a WARN that names it.
+         * 
+         * The option is a: <code>java.lang.String</code> type.
+         * 
+         * Group: producer
+         * 
+         * @param processVersion the value to set
+         * @return the dsl builder
+         */
+        default BonitaEndpointBuilder processVersion(String processVersion) {
+            doSetProperty("processVersion", processVersion);
+            return this;
+        }
         /**
          * The password of the Bonita account. The producer logs in with it at
-         * the loginservice of Bonita before each request, and fails if it is
-         * not set.
+         * the loginservice of Bonita before each request, and fails when it
+         * starts if the option is not set.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
+         * Required: true
          * Group: security
          * 
          * @param password the value to set
@@ -109,11 +147,12 @@ public interface BonitaEndpointBuilderFactory {
         }
         /**
          * The username of the Bonita account. The producer logs in with it at
-         * the loginservice of Bonita before each request, and fails if it is
-         * not set.
+         * the loginservice of Bonita before each request, and fails when it
+         * starts if the option is not set.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
+         * Required: true
          * Group: security
          * 
          * @param username the value to set

Reply via email to