- Retrieve information about KIE Server templates, instances, and associated KIE containers
- Update, start, or stop KIE containers associated with KIE Server templates and instances
- Create, update, or delete KIE Server templates
- Create, update, or delete KIE Server instances
rest-alluser role if you installed Business Central and you want to use the built-in jBPM controllerkie-serveruser role if you installed the headless jBPM controller separately from Business Central
~/$SERVER_HOME/standalone/configuration/application-roles.properties and ~/application-users.properties.
To add a user with the kie-server role or the rest-all role or both (assuming a Keystore is already set), navigate to ~/$SERVER_HOME/bin and run the following command with the role or roles specified:
~/$SERVER_HOME/standalone/configuration/standalone-full.xml:
kie-server or rest-all user with jBPM controller access, navigate to ~/$SERVER_HOME/standalone/configuration/standalone-full.xml, uncomment the org.kie.server properties (if applicable), and add the controller user login credentials and controller location (if needed):
<version> for jBPM dependencies is the Maven artifact version for jBPM currently used in your project (for example, 7.67.2.Final).
Client request configuration
All Java client requests with the jBPM controller Java client API must define at least the following controller communication components:
- Credentials of the
rest-alluser if you installed Business Central, or thekie-serveruser if you installed the headless jBPM controller separately from Business Central - jBPM controller location for REST or WebSocket protocol:
- Example REST URL:
http://localhost:8080/business-central/rest/controller - Example WebSocket URL:
ws://localhost:8080/headless-controller/websocket/controller
- Example REST URL:
- Marshalling format for API requests and responses (JSON or JAXB)
- A
KieServerControllerClientobject, which serves as the entry point for starting the server communication using the Java client API - A
KieServerControllerClientFactorydefining REST or WebSocket protocol and user access - The jBPM controller client service or services used, such as
listServerTemplates,getServerTemplate, orgetServerInstances
Client configuration example with REST
Client configuration example with WebSocket
Sending requests with the jBPM controller Java client API
The jBPM controller Java client API enables you to connect to the jBPM controller using REST or WebSocket protocols from your Java client application. You can use the jBPM controller Java client API as an alternative to the jBPM controller REST API to interact with your KIE Server templates (configurations), KIE Server instances (remote servers), and associated KIE containers (deployment units) in jBPM without using the Business Central user interface. Prerequisites- KIE Server is installed and running.
- The jBPM controller or headless jBPM controller is installed and running.
- You have
rest-alluser role access to the jBPM controller if you installed Business Central, orkie-serveruser role access to the headless jBPM controller installed separately from Business Central. - You have a Java project with jBPM resources.
-
In your client application, ensure that the following dependencies have been added to the relevant classpath of your Java project:
-
In the
~/kie/server/controller/clientfolder of the Java client API in GitHub, identify the relevant Java client implementation for the request you want to send, such as theRestKieServerControllerClientimplementation to access client services for KIE Server templates and KIE containers in REST protocol. -
In your client application, create a
.javaclass for the API request. The class must contain the necessary imports, the jBPM controller location and user credentials, aKieServerControllerClientobject, and the client method to execute, such ascreateServerTemplateandcreateContainerfrom theRestKieServerControllerClientimplementation. Adjust any configuration details according to your use case.Creating and interacting with a KIE Server template and KIE containers -
Run the configured
.javaclass from your project directory to execute the request, and review the jBPM controller response. If you enabled debug logging, KIE Server responds with a detailed response according to your configured marshalling format, such as JSON. If you encounter request errors, review the returned error code messages and adjust your Java configurations accordingly.
Supported jBPM controller Java clients
The following are some of the Java client services available in theorg.kie.server.controller.client package of your jBPM distribution. You can use these services to interact with related resources in the jBPM controller similarly to the jBPM controller REST API.
KieServerControllerClient: Used as the entry point for communicating with the jBPM controllerRestKieServerControllerClient: Implementation used to interact with KIE Server templates and KIE containers in REST protocol (found in~/org/kie/server/controller/client/rest)WebSocketKieServerControllerClient: Implementation used to interact with KIE Server templates and KIE containers in WebSocket protocol (found in~/org/kie/server/controller/client/websocket)
Example requests with the jBPM controller Java client API
The following are examples of jBPM controller Java client API requests for basic interactions with the jBPM controller. For the full list of available jBPM controller Java clients, see the Java client API source in GitHub. Creating and interacting with KIE Server templates and KIE containers You can use theServerTemplate and ContainerSpec services in the REST or WebSocket jBPM controller clients to create, dispose, and update KIE Server templates and KIE containers, and to start and stop KIE containers, as illustrated in this example.
Example request to create and interact with a KIE Server template and KIE containers
javax.ws.rs.core.Configuration specification to modify the underlying REST client API, such as connection timeout.
Example REST request to return server templates and specify connection timeout
Example WebSocket request to return server templates and specify event notifications