- 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, navigate to ~/$SERVER_HOME/bin and run the following command with the role or roles specified:
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):
Accept: Data format accepted by your requesting client:application/json(JSON)application/xml(XML, for JAXB)
Content-Type: Data format of yourPOSTorPUTAPI request data:application/json(JSON)application/xml(XML, for JAXB)
GET: Retrieves specified information from a specified resource endpointPOST: Updates a resource or resource instancePUT: Creates a resource or resource instanceDELETE: Deletes a resource or resource instance
http://SERVER:PORT/CONTROLLER/rest/, such as http://localhost:8080/business-central/rest/ if you are using the jBPM controller built in to Business Central.
Endpoints
jBPM controller REST API endpoints, such as /controller/management/servers/{serverTemplateId} for a specified KIE Server template, are the URIs that you append to the jBPM controller REST API base URL to access the corresponding server resource or type of server resource in jBPM.
Example request URL for /controller/management/servers/{serverTemplateId} endpoint
http://localhost:8080/business-central/rest/controller/management/servers/default-kieserver
Request parameters and request data
Some jBPM controller REST API requests require specific parameters in the request URL path to identify or filter specific resources and to perform specific actions. You can append URL parameters to the endpoint in the format ?<PARAM>=<VALUE>&<PARAM>=<VALUE>.
Example DELETE request URL with parameters
http://localhost:8080/business-central/rest/controller/server/new-kieserver-instance?location=http://localhost:8080/kie-server/services/rest/server
HTTP POST and PUT requests may additionally require a request body or file with data to accompany the request.
Example PUT request URL and JSON request body data
http://localhost:8080/business-central/rest/controller/management/servers/new-kieserver
Sending requests with the jBPM controller REST API using a REST client or curl utility
The jBPM controller REST API enables you 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. You can send jBPM controller REST API requests using any REST client or curl utility. 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.
-
Identify the relevant API endpoint to which you want to send a request, such as
[GET] /controller/management/serversto retrieve KIE Server templates from the jBPM controller. -
In a REST client or curl utility, enter the following components for a
GETrequest tocontroller/management/servers. Adjust any request details according to your use case. For REST client:- Authentication: Enter the user name and password of the jBPM controller user with the
rest-allrole or the headless jBPM controller user with thekie-serverrole. - HTTP Headers: Set the following header:
Accept:application/json
- HTTP method: Set to
GET. - URL: Enter the jBPM controller REST API base URL and endpoint, such as
http://localhost:8080/business-central/rest/controller/management/servers.
-u: Enter the user name and password of the jBPM controller user with therest-allrole or the headless jBPM controller user with thekie-serverrole.-H: Set the following header:Accept:application/json
-X: Set toGET.- URL: Enter the jBPM controller REST API base URL and endpoint, such as
http://localhost:8080/business-central/rest/controller/management/servers.
- Authentication: Enter the user name and password of the jBPM controller user with the
-
Execute the request and review the jBPM controller response.
Example server response (JSON):
-
In your REST client or curl utility, send another API request with the following components for a
PUTrequest to/controller/management/servers/{serverTemplateId}to create a new KIE Server template. Adjust any request details according to your use case. For REST client:- Authentication: Enter the user name and password of the jBPM controller user with the
rest-allrole or the headless jBPM controller user with thekie-serverrole. - HTTP Headers: Set the following headers:
Accept:application/jsonContent-Type:application/json
- HTTP method: Set to
PUT. - URL: Enter the jBPM controller REST API base URL and endpoint, such as
http://localhost:8080/business-central/rest/controller/management/servers/new-kieserver. - Request body: Add a JSON request body with the configurations for the new KIE Server template:
For curl utility:-u: Enter the user name and password of the jBPM controller user with therest-allrole or the headless jBPM controller user with thekie-serverrole.-H: Set the following headers:Accept:application/jsonContent-Type:application/json
-X: Set toPUT.- URL: Enter the jBPM controller REST API base URL and endpoint, such as
http://localhost:8080/business-central/rest/controller/management/servers/new-kieserver. -d: Add a JSON request body or file (@file.json) with the configurations for the new KIE Server template:
- Authentication: Enter the user name and password of the jBPM controller user with the
- Execute the request and confirm the successful jBPM controller response. If you encounter request errors, review the returned error code messages and adjust your request accordingly.
Sending requests with the jBPM controller REST API using the Swagger interface
The jBPM controller REST API supports a Swagger web interface that you can use instead of a standalone REST client or curl utility to interact with your KIE Server templates, instances, and associated KIE containers in jBPM without using the Business Central user interface.By default, the Swagger web interface for the jBPM controller is enabled by the
org.kie.workbench.swagger.disabled=false system property. To disable the Swagger web interface for the jBPM controller, set this system property to true.- The 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.
-
In a web browser, navigate to
http://SERVER:PORT/CONTROLLER/docs, such ashttp://localhost:8080/business-central/docs, and log in with the user name and password of the jBPM controller user with therest-allrole or the headless jBPM controller user with thekie-serverrole.If you are using the jBPM controller built in to Business Central, the Swagger page associated with the jBPM controller is identified as the “Business Central API” for Business Central REST services. If you are using the headless jBPM controller without Business Central, the Swagger page associated with the headless jBPM controller is identified as the “Controller API”. In both cases, the jBPM controller REST API endpoints are the same. - In the Swagger page, select the relevant API endpoint to which you want to send a request, such as Controller :: KIE Server templates and KIE containers → [GET] /controller/management/servers to retrieve KIE Server templates from the jBPM controller.
- Click Try it out and provide any optional parameters by which you want to filter results, if applicable.
- In the Response content type drop-down menu, select the desired format of the server response, such as application/json for JSON format.
-
Click Execute and review the KIE Server response.
Example server response (JSON):
-
In the Swagger page, navigate to the Controller :: KIE Server templates and KIE containers → [PUT]
/controller/management/servers/{serverTemplateId}endpoint to send another request to create a new KIE Server template. Adjust any request details according to your use case. -
Click Try it out and enter the following components for the request:
- serverTemplateId: Enter the ID of the new KIE Server template, such as
new-kieserver. - body: Set the Parameter content type to the desired request body format, such as application/json for JSON format, and add a request body with the configurations for the new KIE Server template:
- serverTemplateId: Enter the ID of the new KIE Server template, such as
- In the Response content type drop-down menu, select the desired format of the server response, such as application/json for JSON format.
- Click Execute and confirm the successful jBPM controller response. If you encounter request errors, review the returned error code messages and adjust your request accordingly.
Supported jBPM controller REST API endpoints
The jBPM controller REST API provides endpoints for interacting with KIE Server templates (configurations), KIE Server instances (remote servers), and associated KIE containers (deployment units). The jBPM controller REST API base URL ishttp://SERVER:PORT/CONTROLLER/rest/. All requests require HTTP Basic authentication or token-based authentication for the rest-all user role if you installed Business Central and you want to use the built-in jBPM controller, or the kie-server user role if you installed the headless jBPM controller separately from Business Central.
For the full list of jBPM controller REST API endpoints and descriptions, use one of the following resources:
- Controller REST API on the jBPM Documentation page (static)
-
Swagger UI for the jBPM controller REST API at
http://SERVER:PORT/CONTROLLER/docs(dynamic, requires running jBPM controller)By default, the Swagger web interface for the jBPM controller is enabled by theorg.kie.workbench.swagger.disabled=falsesystem property. To disable the Swagger web interface for the jBPM controller, set this system property totrue.If you are using the jBPM controller built in to Business Central, the Swagger page associated with the jBPM controller is identified as the “Business Central API” for Business Central REST services. If you are using the headless jBPM controller without Business Central, the Swagger page associated with the headless jBPM controller is identified as the “Controller API”. In both cases, the jBPM controller REST API endpoints are the same.