Direct Provider
The webclient talks to the process engine through a BPM provider. By default, this is SevenProvider, which sends every request to the engine REST API. The Direct Provider is an alternative: it calls the Java API of a process engine that runs in the same application, without HTTP and without the engine REST API.
| Edition | Class |
|---|---|
| Community Edition | org.cibseven.webapp.providers.SevenDirectProvider |
| Enterprise Edition | org.cibseven.webapp.providers.SevenDirectProviderEE |
The Direct Provider was introduced as a beta feature in CIB seven 2.2.0 and is no longer beta as of 3.0.0.
When to use it
Use the Direct Provider when the webclient and the process engine run in the same application, and you want to:
- avoid the overhead of an HTTP call for every webclient request,
- run without exposing the engine REST API, or without the webclient having to authenticate against it,
- save the configuration of an engine REST URL that only points back to the same application.
This is the case in:
- CIB seven Run, where the webclient and the engine are in the same Spring Boot application.
- Your own Spring Boot application that embeds both the engine and the webclient.
- The Tomcat and WildFly distributions with a shared process engine, where the webclient web application finds the engine through the BPM platform.
Keep the default SevenProvider when the webclient runs separately from the engine, for example in its own container or Kubernetes pod (as in the Helm charts), or when one webclient connects to several remote engines with additionalEngineRest. The Direct Provider cannot reach an engine in another process.
Configuration
Set the BPM provider class in the webclient configuration, for example in application.yaml (or default.yml / production.yml in CIB seven Run):
cibseven:
webclient:
bpm:
provider: org.cibseven.webapp.providers.SevenDirectProvider
In the Enterprise Edition, use org.cibseven.webapp.providers.SevenDirectProviderEE. If an Enterprise Edition configuration names the community class SevenDirectProvider, the webclient starts SevenDirectProviderEE in its place and logs a warning; set the enterprise class to silence it.
No further setting is needed. The Direct Provider is part of the webclient; there is no extra dependency to add.
engineRest.url is not needed
With the Direct Provider, the webclient does not use the engine REST API, so you do not need to set cibseven.webclient.engineRest.url or cibseven.webclient.engineRest.path. This includes the login: the user’s password is checked by the engine’s identity service directly. The engine REST API does not have to be deployed for the webclient, and it does not have to accept the webclient’s tokens.
The settings that are not about the REST connection still apply, for example cibseven.webclient.authentication.jwtSecret for the webclient’s own tokens, and cibseven.webclient.user.provider for the login method.
Engines
The Direct Provider lists the process engines that are registered in the same application, sorted by name. When there is an engine named default, it is the default engine; otherwise, it is the first one in the list. additionalEngineRest entries are REST connections and are not used by the Direct Provider.
Authorizations
Every call runs in the engine with the logged-in user and their groups and tenants set as the current authentication, so the engine enforces the same authorizations as with the REST API. Enable authorization checks in the engine configuration (authorizationEnabled) as you would for the engine REST API.
Example: CIB seven Run
In CIB seven Run, the webclient and the engine run in the same application. A minimal configuration in configuration/default.yml looks like this:
cibseven:
webclient:
bpm:
provider: org.cibseven.webapp.providers.SevenDirectProvider
authentication:
jwtSecret: <YOUR_SECRET>
There is no engineRest section.