proto/gateway.proto in zeebe-client-0.19.0 vs proto/gateway.proto in zeebe-client-0.20.0
- old
+ new
@@ -6,10 +6,26 @@
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" />)
string type = 1;
// the name of the worker activating the jobs, mostly used for logging purposes
@@ -24,10 +40,12 @@
repeated string fetchVariable = 5;
// The request will be completed when at least one job is activated or after the requestTimeout (in ms).
// 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 {
// list of activated jobs
repeated ActivatedJob jobs = 1;
@@ -61,10 +79,12 @@
// when the job can be activated again, sent as a UNIX epoch timestamp
int64 deadline = 12;
// 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 {
// the process instance key (as, for example, obtained from
// CreateProcessInstanceResponse)
@@ -100,10 +120,12 @@
string variables = 4;
// List of start instructions. If empty (default) the process instance
// 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 {
// future extensions might include
@@ -126,10 +148,12 @@
// the version of the process definition which was used to create the process instance
int32 version = 3;
// 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 {
CreateProcessInstanceRequest request = 1;
// timeout (in ms). the request will be closed if the process is not completed
@@ -153,10 +177,12 @@
// needs a process instance key (e.g. CancelProcessInstanceRequest)
int64 processInstanceKey = 4;
// 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 {
// the unique key identifying the decision to be evaluated (e.g. returned
// from a decision in the DeployResourceResponse message)
@@ -168,10 +194,12 @@
// key-value fashion, e.g. { "a": 1, "b": 2 } will create two variables,
// named "a" and "b" respectively, with their associated values.
// [{ "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 {
// the unique key identifying the decision which was evaluated (e.g. returned
// from a decision in the DeployResourceResponse message)
@@ -197,10 +225,12 @@
// an optional string indicating the ID of the decision which
// failed during evaluation
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 {
// the unique key identifying the decision which was evaluated (e.g. returned
// from a decision in the DeployResourceResponse message)
@@ -219,10 +249,12 @@
string decisionOutput = 6;
// the decision rules that matched within this decision evaluation
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 {
// the id of the evaluated decision input
string inputId = 1;
@@ -276,10 +308,12 @@
}
message DeployResourceRequest {
// list of resources to deploy
repeated Resource resources = 1;
+ // the tenant id of the resources to deploy
+ string tenantId = 2;
}
message Resource {
// the resource name, e.g. myProcess.bpmn or myDecision.dmn
string name = 1;
@@ -290,10 +324,12 @@
message DeployResourceResponse {
// the unique key identifying the deployment
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 {
// each deployment has only one metadata
oneof Metadata {
@@ -301,10 +337,12 @@
ProcessMetadata process = 1;
// metadata of a deployed decision
DecisionMetadata decision = 2;
// metadata of a deployed decision requirements
DecisionRequirementsMetadata decisionRequirements = 3;
+ // metadata of a deployed form
+ FormMetadata form = 4;
}
}
message ProcessMetadata {
// the bpmn process ID, as parsed during deployment; together with the version forms a
@@ -315,10 +353,12 @@
// the assigned key, which acts as a unique identifier for this process
int64 processDefinitionKey = 3;
// 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 {
// the dmn decision ID, as parsed during deployment; together with the
// versions forms a unique identifier for a specific decision
@@ -334,10 +374,12 @@
// of, as parsed during deployment
string dmnDecisionRequirementsId = 5;
// 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 {
// the dmn decision requirements ID, as parsed during deployment; together
// with the versions forms a unique identifier for a specific decision
@@ -350,12 +392,28 @@
// for this decision requirements
int64 decisionRequirementsKey = 4;
// 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 {
// the unique job identifier, as obtained when activating the job
int64 jobKey = 1;
// the amount of retries the job should have left
int32 retries = 2;
@@ -405,15 +463,19 @@
// with the given ID will ever be published (during its lifetime)
string messageId = 4;
// 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 {
// the unique ID of the incident to resolve
int64 incidentKey = 1;
@@ -482,10 +544,20 @@
}
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
// elementInstanceKey on the job message)
int64 elementInstanceKey = 1;
@@ -547,32 +619,60 @@
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;
}
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 {
/*
Iterates through all known partitions round-robin and activates up to the requested
@@ -587,10 +687,22 @@
*/
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
Errors:
NOT_FOUND:
- no process instance exists with the given key
@@ -677,15 +789,21 @@
/*
Deploys one or more resources (e.g. processes or decision models) to Zeebe.
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) {
}
@@ -791,9 +909,50 @@
- ancestor of element for activation doesn't exist
- scope of variable is unknown
*/
rpc ModifyProcessInstance (ModifyProcessInstanceRequest) returns (ModifyProcessInstanceResponse) {
+ }
+
+ /*
+ 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