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

Commit 01ce44d

Browse files
committedJan 19, 2024
client: update to Zeebe 8.4.x
1 parent 07d1cad commit 01ce44d

File tree

7 files changed

+226
-6
lines changed

7 files changed

+226
-6
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.20.0
4+
5+
- add support for [Zeebe 8.4.0](https://github.com/camunda/zeebe/releases/tag/8.4.0)
6+
37
## 0.19.0 (June 5th, 2023)
48

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

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Install the gem:
1313
Run a Zeebe instance locally:
1414

1515
```sh
16-
docker run -it --rm -p 26500:26500 camunda/zeebe:8.2.5
16+
docker run -it --rm -p 26500:26500 camunda/zeebe:8.4.0
1717
```
1818

1919
And then try the available [demo script](examples/demo.rb).

‎Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ task ci: ['zeebe:start', :default, 'zeebe:stop']
1313

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

‎lib/zeebe/client/proto/gateway_pb.rb

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/zeebe/client/proto/gateway_services_pb.rb

+49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/zeebe/client/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
module Zeebe
33
module Client
4-
VERSION = '0.19.0'.freeze
4+
VERSION = '0.20.0'.freeze
55
end
66
end

‎proto/gateway.proto

+161-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ option go_package = "./;pb";
88
// For a more complete documentation, refer to Zeebe documentation at:
99
// https://docs.camunda.io/docs/reference/grpc
1010

11+
message StreamActivatedJobsRequest {
12+
// the job type, as defined in the BPMN process (e.g. <zeebe:taskDefinition
13+
// type="payment-service" />)
14+
string type = 1;
15+
// the name of the worker activating the jobs, mostly used for logging purposes
16+
string worker = 2;
17+
// a job returned after this call will not be activated by another call until the
18+
// timeout (in ms) has been reached
19+
int64 timeout = 3;
20+
// a list of variables to fetch as the job variables; if empty, all visible variables at
21+
// the time of activation for the scope of the job will be returned
22+
repeated string fetchVariable = 5;
23+
// a list of identifiers of tenants for which to stream jobs
24+
repeated string tenantIds = 6;
25+
}
26+
1127
message ActivateJobsRequest {
1228
// the job type, as defined in the BPMN process (e.g. <zeebe:taskDefinition
1329
// type="payment-service" />)
@@ -26,6 +42,8 @@ message ActivateJobsRequest {
2642
// if the requestTimeout = 0, a default timeout is used.
2743
// if the requestTimeout < 0, long polling is disabled and the request is completed immediately, even when no job is activated.
2844
int64 requestTimeout = 6;
45+
// a list of IDs of tenants for which to activate jobs
46+
repeated string tenantIds = 7;
2947
}
3048

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

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

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

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

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

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

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

226258
message EvaluatedDecisionInput {
@@ -278,6 +310,8 @@ message DeployProcessResponse {
278310
message DeployResourceRequest {
279311
// list of resources to deploy
280312
repeated Resource resources = 1;
313+
// the tenant id of the resources to deploy
314+
string tenantId = 2;
281315
}
282316

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

297333
message Deployment {
@@ -303,6 +339,8 @@ message Deployment {
303339
DecisionMetadata decision = 2;
304340
// metadata of a deployed decision requirements
305341
DecisionRequirementsMetadata decisionRequirements = 3;
342+
// metadata of a deployed form
343+
FormMetadata form = 4;
306344
}
307345
}
308346

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

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

341383
message DecisionRequirementsMetadata {
@@ -352,6 +394,22 @@ message DecisionRequirementsMetadata {
352394
// the resource name (see: Resource.name) from which this decision
353395
// requirements was parsed
354396
string resourceName = 5;
397+
// the tenant id of the deployed decision requirements
398+
string tenantId = 6;
399+
}
400+
401+
message FormMetadata {
402+
// the form ID, as parsed during deployment; together with the
403+
// versions forms a unique identifier for a specific form
404+
string formId = 1;
405+
// the assigned form version
406+
int32 version = 2;
407+
// the assigned key, which acts as a unique identifier for this form
408+
int64 formKey = 3;
409+
// the resource name
410+
string resourceName = 4;
411+
// the tenant id of the deployed form
412+
string tenantId = 5;
355413
}
356414

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

412472
message PublishMessageResponse {
413473
// the unique ID of the message that was published
414474
int64 key = 1;
475+
// the tenant id of the message
476+
string tenantId = 2;
415477
}
416478

417479
message ResolveIncidentRequest {
@@ -484,6 +546,16 @@ message UpdateJobRetriesRequest {
484546
message UpdateJobRetriesResponse {
485547
}
486548

549+
message UpdateJobTimeoutRequest {
550+
// the unique job identifier, as obtained from ActivateJobsResponse
551+
int64 jobKey = 1;
552+
// the duration of the new timeout in ms, starting from the current moment
553+
int64 timeout = 2;
554+
}
555+
556+
message UpdateJobTimeoutResponse {
557+
}
558+
487559
message SetVariablesRequest {
488560
// the unique identifier of a particular element; can be the process instance key (as
489561
// obtained during instance creation), or a given element, such as a service task (see
@@ -549,9 +621,34 @@ message ModifyProcessInstanceResponse {
549621

550622
}
551623

624+
message MigrateProcessInstanceRequest {
625+
// key of the process instance to migrate
626+
int64 processInstanceKey = 1;
627+
// the migration plan that defines target process and element mappings
628+
MigrationPlan migrationPlan = 2;
629+
630+
message MigrationPlan {
631+
// the key of process definition to migrate the process instance to
632+
int64 targetProcessDefinitionKey = 1;
633+
// the mapping instructions describe how to map elements from the source process definition to the target process definition
634+
repeated MappingInstruction mappingInstructions = 2;
635+
}
636+
637+
message MappingInstruction {
638+
// the element id to migrate from
639+
string sourceElementId = 1;
640+
// the element id to migrate into
641+
string targetElementId = 2;
642+
}
643+
}
644+
645+
message MigrateProcessInstanceResponse {
646+
647+
}
648+
552649
message DeleteResourceRequest {
553650
// The key of the resource that should be deleted. This can either be the key
554-
// of a process definition, or the key of a decision requirements definition.
651+
// of a process definition, the key of a decision requirements definition or the key of a form.
555652
int64 resourceKey = 1;
556653
}
557654

@@ -562,15 +659,18 @@ message DeleteResourceResponse {
562659
message BroadcastSignalRequest {
563660
// The name of the signal
564661
string signalName = 1;
565-
566662
// the signal variables as a JSON document; to be valid, the root of the document must be an
567663
// object, e.g. { "a": "foo" }. [ "foo" ] would not be valid.
568664
string variables = 2;
665+
// the id of the tenant that owns the signal.
666+
string tenantId = 3;
569667
}
570668

571669
message BroadcastSignalResponse {
572670
// the unique ID of the signal that was broadcasted.
573671
int64 key = 1;
672+
// the tenant id of the signal that was broadcasted.
673+
string tenantId = 2;
574674
}
575675

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

691+
/*
692+
Registers client to a job stream that will stream jobs back to the client as
693+
they become activatable.
694+
695+
Errors:
696+
INVALID_ARGUMENT:
697+
- type is blank (empty string, null)
698+
- timeout less than 1
699+
*/
700+
rpc StreamActivatedJobs (StreamActivatedJobsRequest) returns (stream ActivatedJob) {
701+
}
702+
591703
/*
592704
Cancels a running process instance
593705
@@ -679,11 +791,17 @@ service Gateway {
679791
Note that this is an atomic call, i.e. either all resources are deployed, or none of them are.
680792
681793
Errors:
794+
PERMISSION_DENIED:
795+
- if a deployment to an unauthorized tenant is performed
682796
INVALID_ARGUMENT:
683797
- no resources given.
684798
- if at least one resource is invalid. A resource is considered invalid if:
685799
- the content is not deserializable (e.g. detected as BPMN, but it's broken XML)
686800
- the content is invalid (e.g. an event-based gateway has an outgoing sequence flow to a task)
801+
- if multi-tenancy is enabled, and:
802+
- a tenant id is not provided
803+
- a tenant id with an invalid format is provided
804+
- if multi-tenancy is disabled and a tenant id is provided
687805
*/
688806
rpc DeployResource (DeployResourceRequest) returns (DeployResourceResponse) {
689807
}
@@ -795,6 +913,47 @@ service Gateway {
795913

796914
}
797915

916+
/*
917+
Migrates the process instance to the specified process definition.
918+
In simple terms, this is handled by updating the active element's process.
919+
920+
Errors:
921+
NOT_FOUND:
922+
- no process instance exists with the given key, or it is not active
923+
- no process definition exists with the given target definition key
924+
- no process instance exists with the given key for the tenants the user is authorized to work with.
925+
926+
FAILED_PRECONDITION:
927+
- not all active elements in the given process instance are mapped to the elements in the target process definition
928+
- a mapping instruction changes the type of an element or event
929+
- a mapping instruction refers to an unsupported element (i.e. some elements will be supported later on)
930+
- a mapping instruction refers to element in unsupported scenarios.
931+
(i.e. migration is not supported when process instance or target process elements contains event subscriptions)
932+
933+
INVALID_ARGUMENT:
934+
- A `sourceElementId` does not refer to an element in the process instance's process definition
935+
- A `targetElementId` does not refer to an element in the target process definition
936+
- A `sourceElementId` is mapped by multiple mapping instructions.
937+
For example, the engine cannot determine how to migrate a process instance when the instructions are: [A->B, A->C].
938+
*/
939+
rpc MigrateProcessInstance (MigrateProcessInstanceRequest) returns (MigrateProcessInstanceResponse) {
940+
941+
}
942+
943+
/*
944+
Updates the deadline of a job using the timeout (in ms) provided. This can be used
945+
for extending or shortening the job deadline.
946+
947+
Errors:
948+
NOT_FOUND:
949+
- no job exists with the given key
950+
951+
INVALID_STATE:
952+
- no deadline exists for the given job key
953+
*/
954+
rpc UpdateJobTimeout (UpdateJobTimeoutRequest) returns (UpdateJobTimeoutResponse) {
955+
}
956+
798957
/*
799958
Deletes a resource from the state. Once a resource has been deleted it cannot
800959
be recovered. If the resource needs to be available again, a new deployment

0 commit comments

Comments
 (0)
This repository has been archived.