@@ -8,6 +8,22 @@ option go_package = "./;pb";
8
8
// For a more complete documentation, refer to Zeebe documentation at:
9
9
// https://docs.camunda.io/docs/reference/grpc
10
10
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
+
11
27
message ActivateJobsRequest {
12
28
// the job type, as defined in the BPMN process (e.g. <zeebe:taskDefinition
13
29
// type="payment-service" />)
@@ -26,6 +42,8 @@ message ActivateJobsRequest {
26
42
// if the requestTimeout = 0, a default timeout is used.
27
43
// if the requestTimeout < 0, long polling is disabled and the request is completed immediately, even when no job is activated.
28
44
int64 requestTimeout = 6 ;
45
+ // a list of IDs of tenants for which to activate jobs
46
+ repeated string tenantIds = 7 ;
29
47
}
30
48
31
49
message ActivateJobsResponse {
@@ -63,6 +81,8 @@ message ActivatedJob {
63
81
// JSON document, computed at activation time, consisting of all visible variables to
64
82
// the task scope
65
83
string variables = 13 ;
84
+ // the id of the tenant that owns the job
85
+ string tenantId = 14 ;
66
86
}
67
87
68
88
message CancelProcessInstanceRequest {
@@ -102,6 +122,8 @@ message CreateProcessInstanceRequest {
102
122
// will start at the start event. If non-empty the process instance will apply start
103
123
// instructions after it has been created
104
124
repeated ProcessInstanceCreationStartInstruction startInstructions = 5 ;
125
+ // the tenant id of the process definition
126
+ string tenantId = 6 ;
105
127
}
106
128
107
129
message ProcessInstanceCreationStartInstruction {
@@ -128,6 +150,8 @@ message CreateProcessInstanceResponse {
128
150
// the unique identifier of the created process instance; to be used wherever a request
129
151
// needs a process instance key (e.g. CancelProcessInstanceRequest)
130
152
int64 processInstanceKey = 4 ;
153
+ // the tenant identifier of the created process instance
154
+ string tenantId = 5 ;
131
155
}
132
156
133
157
message CreateProcessInstanceWithResultRequest {
@@ -155,6 +179,8 @@ message CreateProcessInstanceWithResultResponse {
155
179
// JSON document
156
180
// consists of visible variables in the root scope
157
181
string variables = 5 ;
182
+ // the tenant identifier of the process definition
183
+ string tenantId = 6 ;
158
184
}
159
185
160
186
message EvaluateDecisionRequest {
@@ -170,6 +196,8 @@ message EvaluateDecisionRequest {
170
196
// [{ "a": 1, "b": 2 }] would not be a valid argument, as the root of the
171
197
// JSON document is an array and not an object.
172
198
string variables = 3 ;
199
+ // the tenant identifier of the decision
200
+ string tenantId = 4 ;
173
201
}
174
202
175
203
message EvaluateDecisionResponse {
@@ -199,6 +227,8 @@ message EvaluateDecisionResponse {
199
227
string failedDecisionId = 9 ;
200
228
// an optional message describing why the decision which was evaluated failed
201
229
string failureMessage = 10 ;
230
+ // the tenant identifier of the evaluated decision
231
+ string tenantId = 11 ;
202
232
}
203
233
204
234
message EvaluatedDecision {
@@ -221,6 +251,8 @@ message EvaluatedDecision {
221
251
repeated MatchedDecisionRule matchedRules = 7 ;
222
252
// the decision inputs that were evaluated within this decision evaluation
223
253
repeated EvaluatedDecisionInput evaluatedInputs = 8 ;
254
+ // the tenant identifier of the evaluated decision
255
+ string tenantId = 9 ;
224
256
}
225
257
226
258
message EvaluatedDecisionInput {
@@ -278,6 +310,8 @@ message DeployProcessResponse {
278
310
message DeployResourceRequest {
279
311
// list of resources to deploy
280
312
repeated Resource resources = 1 ;
313
+ // the tenant id of the resources to deploy
314
+ string tenantId = 2 ;
281
315
}
282
316
283
317
message Resource {
@@ -292,6 +326,8 @@ message DeployResourceResponse {
292
326
int64 key = 1 ;
293
327
// a list of deployed resources, e.g. processes
294
328
repeated Deployment deployments = 2 ;
329
+ // the tenant id of the deployed resources
330
+ string tenantId = 3 ;
295
331
}
296
332
297
333
message Deployment {
@@ -303,6 +339,8 @@ message Deployment {
303
339
DecisionMetadata decision = 2 ;
304
340
// metadata of a deployed decision requirements
305
341
DecisionRequirementsMetadata decisionRequirements = 3 ;
342
+ // metadata of a deployed form
343
+ FormMetadata form = 4 ;
306
344
}
307
345
}
308
346
@@ -317,6 +355,8 @@ message ProcessMetadata {
317
355
// the resource name (see: ProcessRequestObject.name) from which this process was
318
356
// parsed
319
357
string resourceName = 4 ;
358
+ // the tenant id of the deployed process
359
+ string tenantId = 5 ;
320
360
}
321
361
322
362
message DecisionMetadata {
@@ -336,6 +376,8 @@ message DecisionMetadata {
336
376
// the assigned key of the decision requirements graph that this decision is
337
377
// part of
338
378
int64 decisionRequirementsKey = 6 ;
379
+ // the tenant id of the deployed decision
380
+ string tenantId = 7 ;
339
381
}
340
382
341
383
message DecisionRequirementsMetadata {
@@ -352,6 +394,22 @@ message DecisionRequirementsMetadata {
352
394
// the resource name (see: Resource.name) from which this decision
353
395
// requirements was parsed
354
396
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 ;
355
413
}
356
414
357
415
message FailJobRequest {
@@ -407,11 +465,15 @@ message PublishMessageRequest {
407
465
// the message variables as a JSON document; to be valid, the root of the document must be an
408
466
// object, e.g. { "a": "foo" }. [ "foo" ] would not be valid.
409
467
string variables = 5 ;
468
+ // the tenant id of the message
469
+ string tenantId = 6 ;
410
470
}
411
471
412
472
message PublishMessageResponse {
413
473
// the unique ID of the message that was published
414
474
int64 key = 1 ;
475
+ // the tenant id of the message
476
+ string tenantId = 2 ;
415
477
}
416
478
417
479
message ResolveIncidentRequest {
@@ -484,6 +546,16 @@ message UpdateJobRetriesRequest {
484
546
message UpdateJobRetriesResponse {
485
547
}
486
548
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
+
487
559
message SetVariablesRequest {
488
560
// the unique identifier of a particular element; can be the process instance key (as
489
561
// obtained during instance creation), or a given element, such as a service task (see
@@ -549,9 +621,34 @@ message ModifyProcessInstanceResponse {
549
621
550
622
}
551
623
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
+
552
649
message DeleteResourceRequest {
553
650
// 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 .
555
652
int64 resourceKey = 1 ;
556
653
}
557
654
@@ -562,15 +659,18 @@ message DeleteResourceResponse {
562
659
message BroadcastSignalRequest {
563
660
// The name of the signal
564
661
string signalName = 1 ;
565
-
566
662
// the signal variables as a JSON document; to be valid, the root of the document must be an
567
663
// object, e.g. { "a": "foo" }. [ "foo" ] would not be valid.
568
664
string variables = 2 ;
665
+ // the id of the tenant that owns the signal.
666
+ string tenantId = 3 ;
569
667
}
570
668
571
669
message BroadcastSignalResponse {
572
670
// the unique ID of the signal that was broadcasted.
573
671
int64 key = 1 ;
672
+ // the tenant id of the signal that was broadcasted.
673
+ string tenantId = 2 ;
574
674
}
575
675
576
676
service Gateway {
@@ -588,6 +688,18 @@ service Gateway {
588
688
rpc ActivateJobs (ActivateJobsRequest ) returns (stream ActivateJobsResponse ) {
589
689
}
590
690
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
+
591
703
/*
592
704
Cancels a running process instance
593
705
@@ -679,11 +791,17 @@ service Gateway {
679
791
Note that this is an atomic call, i.e. either all resources are deployed, or none of them are.
680
792
681
793
Errors:
794
+ PERMISSION_DENIED:
795
+ - if a deployment to an unauthorized tenant is performed
682
796
INVALID_ARGUMENT:
683
797
- no resources given.
684
798
- if at least one resource is invalid. A resource is considered invalid if:
685
799
- the content is not deserializable (e.g. detected as BPMN, but it's broken XML)
686
800
- 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
687
805
*/
688
806
rpc DeployResource (DeployResourceRequest ) returns (DeployResourceResponse ) {
689
807
}
@@ -795,6 +913,47 @@ service Gateway {
795
913
796
914
}
797
915
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
+
798
957
/*
799
958
Deletes a resource from the state. Once a resource has been deleted it cannot
800
959
be recovered. If the resource needs to be available again, a new deployment
0 commit comments