NativeBPM Engine REST API
- API version: 1.0.1
- Generator version: 7.24.0-SNAPSHOT
REST API for managing, executing, and monitoring workflows, human tasks, incidents, and outgoing webhooks inside the NativeBPM Cloud-Native engine.
Requests must include a session cookie or a Bearer API token:
Authorization: Bearer <API_TOKEN>
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 1.8+
- Maven (3.8.3+)/Gradle (7.2+)
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>com.nativebpm</groupId>
<artifactId>nativebpm-java-client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
repositories {
mavenCentral() // Needed if the 'nativebpm-java-client' jar has been published to maven central.
mavenLocal() // Needed if the 'nativebpm-java-client' jar has been published to the local maven repo.
}
dependencies {
implementation "com.nativebpm:nativebpm-java-client:1.0.0"
}At first generate the JAR by executing:
mvn clean packageThen manually install the following JARs:
target/nativebpm-java-client-1.0.0.jartarget/lib/*.jar
Please follow the installation instruction and execute the following Java code:
// Import classes:
import com.nativebpm.client.ApiClient;
import com.nativebpm.client.ApiException;
import com.nativebpm.client.Configuration;
import com.nativebpm.client.model.*;
import com.nativebpm.client.api.DefaultApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
DefaultApi apiInstance = new DefaultApi(defaultClient);
String id = "id_example"; // String |
ClaimTaskRequest claimTaskRequest = new ClaimTaskRequest(); // ClaimTaskRequest |
try {
TaskRecord result = apiInstance.claimTask(id, claimTaskRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#claimTask");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | claimTask | POST /api/tasks/{id}/claim | Claim human task |
| DefaultApi | completeInstanceTask | POST /api/instances/{id}/complete | Complete a wait state / task activity in process instance |
| DefaultApi | completeTask | POST /api/tasks/{id}/complete | Complete human task |
| DefaultApi | createWebhook | POST /api/webhooks | Create webhook target |
| DefaultApi | deleteWebhook | DELETE /api/webhooks/{id} | Delete webhook target |
| DefaultApi | deployDefinition | POST /api/deploy | Deploy process definition |
| DefaultApi | getInstance | GET /api/instances/{id} | Get process instance |
| DefaultApi | getInstanceHistory | GET /api/instances/{id}/history | Get process instance execution history |
| DefaultApi | getInstanceVisualization | GET /api/instances/{id}/visualization | Get process instance visualization data |
| DefaultApi | getInstanceVisualizationWidget | GET /api/instances/{id}/visualization/widget | Get process instance visualization widget HTML |
| DefaultApi | getSMTPConfig | GET /api/smtp-config | Get SMTP configuration |
| DefaultApi | getUserGroups | GET /api/users/{username}/groups | Get user groups |
| DefaultApi | listDefinitions | GET /api/definitions | List process definitions |
| DefaultApi | listIncidents | GET /api/instances/{id}/incidents | List incidents for process instance |
| DefaultApi | listInstances | GET /api/instances | List process instances |
| DefaultApi | listTasks | GET /api/tasks | List human/user tasks |
| DefaultApi | listWebhookDeliveries | GET /api/webhooks/{id}/deliveries | List deliveries for webhook |
| DefaultApi | listWebhooks | GET /api/webhooks | List configured outgoing webhooks |
| DefaultApi | resolveIncident | POST /api/instances/{id}/incidents/{incidentId}/resolve | Resolve process incident |
| DefaultApi | resumeInstance | POST /api/instances/{id}/resume | Resume process instance |
| DefaultApi | startInstance | POST /api/definitions/{id}/start | Start process instance |
| DefaultApi | testWebhook | POST /api/webhooks/{id}/test | Test webhook target |
| DefaultApi | updateWebhook | PUT /api/webhooks/{id} | Update webhook target |
- ClaimTaskRequest
- CompleteInstanceTaskRequest
- CompleteTaskRequest
- CreateWebhookRequest
- HistoryRecord
- IncidentRecord
- ListDefinitions401Response
- ProcessDefinition
- ProcessInstance
- ResolveIncident200Response
- SMTPConfig
- StartInstanceRequest
- TaskRecord
- VisualizationData
- WebhookDeliveryRecord
- WebhookRecord
Endpoints do not require authorization.
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.
The SDK provides a high-level Fluent Client API and a type-safe Workflow-as-Code builder.
import com.nativebpm.client.ApiClient;
import com.nativebpm.client.Configuration;
import com.nativebpm.client.api.DefaultApi;
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("http://localhost:8080");
client.addDefaultHeader("Authorization", "Bearer your-api-token");
DefaultApi apiInstance = new DefaultApi(client);import com.nativebpm.client.builder.Workflow;
import static com.nativebpm.client.builder.Workflow.V;
Workflow workflow = new Workflow("my-process", "My Process");
workflow
.when(V("isPremium").eq(true)).then(b -> {
b.user("vipService", "VIP Support", ut -> {
ut.assignee("vip_manager");
});
})
.Else(b -> {
b.service("notify", "Send Email", "email_topic");
});import com.nativebpm.client.model.ProcessDefinition;
import com.nativebpm.client.model.ProcessInstance;
import com.nativebpm.client.model.StartInstanceRequest;
// Deploy (by sending serialized workflow JSON)
String workflowJson = workflow.toJson();
// Use apiInstance.deployDefinition(...)