-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create README.md with a few examples
(cherry picked from commit 232cc80)
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Java Operate client | ||
|
||
## Build the client | ||
|
||
### SaaS Authentication | ||
|
||
```java | ||
JwtConfig jwtConfig = new JwtConfig(); | ||
jwtConfig.addProduct(Product.OPERATE, new JwtCredential(clientId, clientSecret)); | ||
targetOperateUrl = "https://" + region + ".operate.camunda.io/" + clusterId; | ||
auth = SaaSAuthentication.builder().jwtConfig(jwtConfig).build(); | ||
|
||
client = CamundaOperateClient.builder() | ||
.operateUrl(targetOperateUrl) | ||
.authentication(auth) | ||
.setup() | ||
.build(); | ||
``` | ||
|
||
### SelfManaged Authentication | ||
|
||
```java | ||
JwtConfig jwtConfig = new JwtConfig(); | ||
jwtConfig.addProduct(Product.OPERATE, new JwtCredential(clientId, clientSecret)); | ||
auth = SelfManagedAuthentication.builder().jwtConfig(jwtConfig).keycloakUrl(keycloakUrl).build(); | ||
|
||
client = CamundaOperateClient.builder() | ||
.operateUrl(operateUrl) | ||
.authentication(auth) | ||
.setup() | ||
.build(); | ||
``` | ||
|
||
## Use the client | ||
|
||
### List deployed process definitions | ||
|
||
```java | ||
ProcessDefinitionFilter processDefinitionFilter = ProcessDefinitionFilter.builder().build(); | ||
SearchQuery procDefQuery = new SearchQuery.Builder() | ||
.filter(processDefinitionFilter) | ||
.size(1000) | ||
.sort(new Sort("version", SortOrder.DESC)) | ||
.build(); | ||
return camundaOperateClient.searchProcessDefinitions(procDefQuery); | ||
``` | ||
|
||
### Read process definitions content | ||
|
||
```java | ||
camundaOperateClient.getProcessDefinitionXml(ProcessDefinitionKey); | ||
``` | ||
|
||
### List variables | ||
|
||
```java | ||
return camundaOperateClient.searchVariables(new SearchQuery.Builder().filter(new VariableFilter()).size(100).build()); | ||
``` |