Skip to main content
jBPM supports runtime commands that you can send to KIE Server for asset-related operations, such as executing all rules or inserting or retracting objects in a KIE session. The full list of supported runtime commands is located in the org.drools.core.command.runtime package in your jBPM instance. In the KIE Server REST API, you use the global org.drools.core.command.runtime commands or the rule-specific org.drools.core.command.runtime.rule commands as the request body for POST requests to http://SERVER:PORT/kie-server/services/rest/server/containers/instances/{containerId}. For more information about using the KIE Server REST API, see KIE Server REST API for KIE containers and business assets. In the KIE Server Java client API, you can embed these commands in your Java application along with the relevant Java client. For example, for rule-related commands, you use the RuleServicesClient Java client with the embedded commands. For more information about using the KIE Server Java client API, see KIE Server Java client API for KIE containers and business assets.

Sample runtime commands in jBPM

The following are sample runtime commands that you can use with the KIE Server REST API or Java client API for asset-related operations in KIE Server:
  • BatchExecutionCommand
  • InsertObjectCommand
  • RetractCommand
  • ModifyCommand
  • GetObjectCommand
  • GetObjectsCommand
  • InsertElementsCommand
  • FireAllRulesCommand
  • StartProcessCommand
  • SignalEventCommand
  • CompleteWorkItemCommand
  • AbortWorkItemCommand
  • QueryCommand
  • SetGlobalCommand
  • GetGlobalCommand
For the full list of supported runtime commands, see the org.drools.core.command.runtime package in your jBPM instance. Each command in this section includes a REST request body example (JSON) for the KIE Server REST API and an embedded Java command example for the KIE Server Java client API. The Java examples use an object org.drools.compiler.test.Person with the fields name (String) and age (Integer). BatchExecutionCommand Contains multiple commands to be executed together. Command attributes
KIE session IDs are in the kmodule.xml file of your jBPM project. To view or add a KIE session ID in Business Central to use with the lookup command attribute, navigate to the relevant project in Business Central and go to project SettingsKIE basesKIE sessions. If no KIE bases exist, click Add KIE baseKIE sessions to define the new KIE base and KIE sessions.
Example JSON request body
Example Java command
Example server response (JSON)
InsertObjectCommand Inserts an object into the KIE session. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
RetractCommand Retracts an object from the KIE session. Command attributes
Example JSON request body
Example Java command: Use FactHandleFromString
Example Java command: Use FactHandle from inserted object
Example server response (JSON)
ModifyCommand Modifies a previously inserted object in the KIE session. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
GetObjectCommand Retrieves an object from a KIE session. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
GetObjectsCommand Retrieves all objects from the KIE session as a collection. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
InsertElementsCommand Inserts a list of objects into the KIE session. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
FireAllRulesCommand Executes all rules in the KIE session. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
StartProcessCommand Starts a process using the process ID. You can also pass parameters and initial data to be inserted. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
SignalEventCommand Sends a signal event to the KIE session. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
CompleteWorkItemCommand Completes a work item in the KIE session. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
AbortWorkItemCommand Aborts a work item in the KIE session in the same way as ksession.getWorkItemManager().abortWorkItem(workItemId). Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
QueryCommand Executes a query defined in the KIE base. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
SetGlobalCommand Sets an object to a global state. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)
GetGlobalCommand Retrieves a previously defined global object. Command attributes
Example JSON request body
Example Java command
Example server response (JSON)