Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
client: update to Zeebe 8.4.x
Browse files Browse the repository at this point in the history
cmur2 committed Jan 19, 2024
1 parent 07d1cad commit 01ce44d
Showing 7 changed files with 226 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.20.0

- add support for [Zeebe 8.4.0](https://github.com/camunda/zeebe/releases/tag/8.4.0)

## 0.19.0 (June 5th, 2023)

- add support for [Zeebe 8.2.5](https://github.com/camunda/zeebe/releases/tag/8.2.5)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ Install the gem:
Run a Zeebe instance locally:

```sh
docker run -it --rm -p 26500:26500 camunda/zeebe:8.2.5
docker run -it --rm -p 26500:26500 camunda/zeebe:8.4.0
```

And then try the available [demo script](examples/demo.rb).
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ task ci: ['zeebe:start', :default, 'zeebe:stop']

desc 'Starts Zeebe Docker container'
task 'zeebe:start' do
sh 'docker run -d --name zeebe --rm -p 26500:26500 camunda/zeebe:8.2.5'
sh 'docker run -d --name zeebe --rm -p 26500:26500 camunda/zeebe:8.4.0'
sleep(10)
end

10 changes: 9 additions & 1 deletion lib/zeebe/client/proto/gateway_pb.rb

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions lib/zeebe/client/proto/gateway_services_pb.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/zeebe/client/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

module Zeebe
module Client
VERSION = '0.19.0'.freeze
VERSION = '0.20.0'.freeze
end
end
163 changes: 161 additions & 2 deletions proto/gateway.proto
Original file line number Diff line number Diff line change
@@ -8,6 +8,22 @@ option go_package = "./;pb";
// For a more complete documentation, refer to Zeebe documentation at:
// https://docs.camunda.io/docs/reference/grpc

message StreamActivatedJobsRequest {
// the job type, as defined in the BPMN process (e.g. <zeebe:taskDefinition
// type="payment-service" />)
string type = 1;
// the name of the worker activating the jobs, mostly used for logging purposes
string worker = 2;
// a job returned after this call will not be activated by another call until the
// timeout (in ms) has been reached
int64 timeout = 3;
// a list of variables to fetch as the job variables; if empty, all visible variables at
// the time of activation for the scope of the job will be returned
repeated string fetchVariable = 5;
// a list of identifiers of tenants for which to stream jobs
repeated string tenantIds = 6;
}

message ActivateJobsRequest {
// the job type, as defined in the BPMN process (e.g. <zeebe:taskDefinition
// type="payment-service" />)
@@ -26,6 +42,8 @@ message ActivateJobsRequest {
// if the requestTimeout = 0, a default timeout is used.
// if the requestTimeout < 0, long polling is disabled and the request is completed immediately, even when no job is activated.
int64 requestTimeout = 6;
// a list of IDs of tenants for which to activate jobs
repeated string tenantIds = 7;
}

message ActivateJobsResponse {
@@ -63,6 +81,8 @@ message ActivatedJob {
// JSON document, computed at activation time, consisting of all visible variables to
// the task scope
string variables = 13;
// the id of the tenant that owns the job
string tenantId = 14;
}

message CancelProcessInstanceRequest {
@@ -102,6 +122,8 @@ message CreateProcessInstanceRequest {
// will start at the start event. If non-empty the process instance will apply start
// instructions after it has been created
repeated ProcessInstanceCreationStartInstruction startInstructions = 5;
// the tenant id of the process definition
string tenantId = 6;
}

message ProcessInstanceCreationStartInstruction {
@@ -128,6 +150,8 @@ message CreateProcessInstanceResponse {
// the unique identifier of the created process instance; to be used wherever a request
// needs a process instance key (e.g. CancelProcessInstanceRequest)
int64 processInstanceKey = 4;
// the tenant identifier of the created process instance
string tenantId = 5;
}

message CreateProcessInstanceWithResultRequest {
@@ -155,6 +179,8 @@ message CreateProcessInstanceWithResultResponse {
// JSON document
// consists of visible variables in the root scope
string variables = 5;
// the tenant identifier of the process definition
string tenantId = 6;
}

message EvaluateDecisionRequest {
@@ -170,6 +196,8 @@ message EvaluateDecisionRequest {
// [{ "a": 1, "b": 2 }] would not be a valid argument, as the root of the
// JSON document is an array and not an object.
string variables = 3;
// the tenant identifier of the decision
string tenantId = 4;
}

message EvaluateDecisionResponse {
@@ -199,6 +227,8 @@ message EvaluateDecisionResponse {
string failedDecisionId = 9;
// an optional message describing why the decision which was evaluated failed
string failureMessage = 10;
// the tenant identifier of the evaluated decision
string tenantId = 11;
}

message EvaluatedDecision {
@@ -221,6 +251,8 @@ message EvaluatedDecision {
repeated MatchedDecisionRule matchedRules = 7;
// the decision inputs that were evaluated within this decision evaluation
repeated EvaluatedDecisionInput evaluatedInputs = 8;
// the tenant identifier of the evaluated decision
string tenantId = 9;
}

message EvaluatedDecisionInput {
@@ -278,6 +310,8 @@ message DeployProcessResponse {
message DeployResourceRequest {
// list of resources to deploy
repeated Resource resources = 1;
// the tenant id of the resources to deploy
string tenantId = 2;
}

message Resource {
@@ -292,6 +326,8 @@ message DeployResourceResponse {
int64 key = 1;
// a list of deployed resources, e.g. processes
repeated Deployment deployments = 2;
// the tenant id of the deployed resources
string tenantId = 3;
}

message Deployment {
@@ -303,6 +339,8 @@ message Deployment {
DecisionMetadata decision = 2;
// metadata of a deployed decision requirements
DecisionRequirementsMetadata decisionRequirements = 3;
// metadata of a deployed form
FormMetadata form = 4;
}
}

@@ -317,6 +355,8 @@ message ProcessMetadata {
// the resource name (see: ProcessRequestObject.name) from which this process was
// parsed
string resourceName = 4;
// the tenant id of the deployed process
string tenantId = 5;
}

message DecisionMetadata {
@@ -336,6 +376,8 @@ message DecisionMetadata {
// the assigned key of the decision requirements graph that this decision is
// part of
int64 decisionRequirementsKey = 6;
// the tenant id of the deployed decision
string tenantId = 7;
}

message DecisionRequirementsMetadata {
@@ -352,6 +394,22 @@ message DecisionRequirementsMetadata {
// the resource name (see: Resource.name) from which this decision
// requirements was parsed
string resourceName = 5;
// the tenant id of the deployed decision requirements
string tenantId = 6;
}

message FormMetadata {
// the form ID, as parsed during deployment; together with the
// versions forms a unique identifier for a specific form
string formId = 1;
// the assigned form version
int32 version = 2;
// the assigned key, which acts as a unique identifier for this form
int64 formKey = 3;
// the resource name
string resourceName = 4;
// the tenant id of the deployed form
string tenantId = 5;
}

message FailJobRequest {
@@ -407,11 +465,15 @@ message PublishMessageRequest {
// the message variables as a JSON document; to be valid, the root of the document must be an
// object, e.g. { "a": "foo" }. [ "foo" ] would not be valid.
string variables = 5;
// the tenant id of the message
string tenantId = 6;
}

message PublishMessageResponse {
// the unique ID of the message that was published
int64 key = 1;
// the tenant id of the message
string tenantId = 2;
}

message ResolveIncidentRequest {
@@ -484,6 +546,16 @@ message UpdateJobRetriesRequest {
message UpdateJobRetriesResponse {
}

message UpdateJobTimeoutRequest {
// the unique job identifier, as obtained from ActivateJobsResponse
int64 jobKey = 1;
// the duration of the new timeout in ms, starting from the current moment
int64 timeout = 2;
}

message UpdateJobTimeoutResponse {
}

message SetVariablesRequest {
// the unique identifier of a particular element; can be the process instance key (as
// obtained during instance creation), or a given element, such as a service task (see
@@ -549,9 +621,34 @@ message ModifyProcessInstanceResponse {

}

message MigrateProcessInstanceRequest {
// key of the process instance to migrate
int64 processInstanceKey = 1;
// the migration plan that defines target process and element mappings
MigrationPlan migrationPlan = 2;

message MigrationPlan {
// the key of process definition to migrate the process instance to
int64 targetProcessDefinitionKey = 1;
// the mapping instructions describe how to map elements from the source process definition to the target process definition
repeated MappingInstruction mappingInstructions = 2;
}

message MappingInstruction {
// the element id to migrate from
string sourceElementId = 1;
// the element id to migrate into
string targetElementId = 2;
}
}

message MigrateProcessInstanceResponse {

}

message DeleteResourceRequest {
// The key of the resource that should be deleted. This can either be the key
// of a process definition, or the key of a decision requirements definition.
// of a process definition, the key of a decision requirements definition or the key of a form.
int64 resourceKey = 1;
}

@@ -562,15 +659,18 @@ message DeleteResourceResponse {
message BroadcastSignalRequest {
// The name of the signal
string signalName = 1;

// the signal variables as a JSON document; to be valid, the root of the document must be an
// object, e.g. { "a": "foo" }. [ "foo" ] would not be valid.
string variables = 2;
// the id of the tenant that owns the signal.
string tenantId = 3;
}

message BroadcastSignalResponse {
// the unique ID of the signal that was broadcasted.
int64 key = 1;
// the tenant id of the signal that was broadcasted.
string tenantId = 2;
}

service Gateway {
@@ -588,6 +688,18 @@ service Gateway {
rpc ActivateJobs (ActivateJobsRequest) returns (stream ActivateJobsResponse) {
}

/*
Registers client to a job stream that will stream jobs back to the client as
they become activatable.
Errors:
INVALID_ARGUMENT:
- type is blank (empty string, null)
- timeout less than 1
*/
rpc StreamActivatedJobs (StreamActivatedJobsRequest) returns (stream ActivatedJob) {
}

/*
Cancels a running process instance
@@ -679,11 +791,17 @@ service Gateway {
Note that this is an atomic call, i.e. either all resources are deployed, or none of them are.
Errors:
PERMISSION_DENIED:
- if a deployment to an unauthorized tenant is performed
INVALID_ARGUMENT:
- no resources given.
- if at least one resource is invalid. A resource is considered invalid if:
- the content is not deserializable (e.g. detected as BPMN, but it's broken XML)
- the content is invalid (e.g. an event-based gateway has an outgoing sequence flow to a task)
- if multi-tenancy is enabled, and:
- a tenant id is not provided
- a tenant id with an invalid format is provided
- if multi-tenancy is disabled and a tenant id is provided
*/
rpc DeployResource (DeployResourceRequest) returns (DeployResourceResponse) {
}
@@ -795,6 +913,47 @@ service Gateway {

}

/*
Migrates the process instance to the specified process definition.
In simple terms, this is handled by updating the active element's process.
Errors:
NOT_FOUND:
- no process instance exists with the given key, or it is not active
- no process definition exists with the given target definition key
- no process instance exists with the given key for the tenants the user is authorized to work with.
FAILED_PRECONDITION:
- not all active elements in the given process instance are mapped to the elements in the target process definition
- a mapping instruction changes the type of an element or event
- a mapping instruction refers to an unsupported element (i.e. some elements will be supported later on)
- a mapping instruction refers to element in unsupported scenarios.
(i.e. migration is not supported when process instance or target process elements contains event subscriptions)
INVALID_ARGUMENT:
- A `sourceElementId` does not refer to an element in the process instance's process definition
- A `targetElementId` does not refer to an element in the target process definition
- A `sourceElementId` is mapped by multiple mapping instructions.
For example, the engine cannot determine how to migrate a process instance when the instructions are: [A->B, A->C].
*/
rpc MigrateProcessInstance (MigrateProcessInstanceRequest) returns (MigrateProcessInstanceResponse) {

}

/*
Updates the deadline of a job using the timeout (in ms) provided. This can be used
for extending or shortening the job deadline.
Errors:
NOT_FOUND:
- no job exists with the given key
INVALID_STATE:
- no deadline exists for the given job key
*/
rpc UpdateJobTimeout (UpdateJobTimeoutRequest) returns (UpdateJobTimeoutResponse) {
}

/*
Deletes a resource from the state. Once a resource has been deleted it cannot
be recovered. If the resource needs to be available again, a new deployment

0 comments on commit 01ce44d

Please sign in to comment.