proto/gateway.proto in zeebe-client-0.3.0 vs proto/gateway.proto in zeebe-client-0.4.0
- old
+ new
@@ -95,12 +95,12 @@
int32 version = 3;
// JSON document that will instantiate the variables for the root variable scope of the
// workflow instance; it must be a JSON object, as variables will be mapped in a
// 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 payload, as the root of the JSON document is an array and not an object.
- string payload = 4;
+ // valid argument, as the root of the JSON document is an array and not an object.
+ string variables = 4;
}
message CreateWorkflowInstanceResponse {
// the key of the workflow definition which was used to create the workflow instance
int64 workflowKey = 1;
@@ -214,12 +214,12 @@
// how long the message should be buffered on the broker, in milliseconds
int64 timeToLive = 3;
// the unique ID of the message; can be omitted. only useful to ensure only one message
// with the given ID will ever be published (during its lifetime)
string messageId = 4;
- // the message payload as a JSON document; see CreateWorkflowInstanceRequest for the
- // rules about payloads
+ // the message payload 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 payload = 5;
}
message PublishMessageResponse {
}
@@ -277,21 +277,29 @@
}
message UpdateJobRetriesResponse {
}
-message UpdateWorkflowInstancePayloadRequest {
+message SetVariablesRequest {
// the unique identifier of a particular element; can be the workflow instance key (as
// obtained during instance creation), or a given element, such as a service task (see
// elementInstanceKey on the JobHeaders message)
int64 elementInstanceKey = 1;
- // the new payload as a JSON document; see CreateWorkflowInstanceRequest for the rules
- // about payloads
- string payload = 2;
+ // a JSON serialized document describing variables as key value pairs; the root of the document
+ // must be an object
+ string variables = 2;
+ // if true, the variables will be merged strictly into the local scope (as indicated by
+ // elementInstanceKey); this means the variables is not propagated to upper scopes.
+ // for example, let's say we have two scopes, '1' and '2', with each having effective variables as:
+ // 1 => `{ "foo" : 2 }`, and 2 => `{ "bar" : 1 }`. if we send an update request with
+ // elementInstanceKey = 2, variables `{ "foo" : 5 }`, and local is true, then scope 1 will
+ // be unchanged, and scope 2 will now be `{ "bar" : 1, "foo" 5 }`. if local was false, however,
+ // then scope 1 would be `{ "foo": 5 }`, and scope 2 would be `{ "bar" : 1 }`.
+ bool local = 3;
}
-message UpdateWorkflowInstancePayloadResponse {
+message SetVariablesResponse {
}
service Gateway {
/*
Iterates through all known partitions in a round-robin and activates up to the requested amount
@@ -348,12 +356,12 @@
FAILED_PRECONDITION:
- the workflow definition does not contain a none start event; only workflows with none
start event can be started manually.
INVALID_ARGUMENT:
- - the given payload is not a valid JSON document; all payloads are expected to be
- valid JSON documents where the root node is an object.
+ - the given variables argument is not a valid JSON document; it is expected to be a valid
+ JSON document where the root node is an object.
*/
rpc CreateWorkflowInstance (CreateWorkflowInstanceRequest) returns (CreateWorkflowInstanceResponse) {
}
/*
@@ -423,21 +431,35 @@
rpc PublishMessage (PublishMessageRequest) returns (PublishMessageResponse) {
}
/*
Resolves a given incident. This simply marks the incident as resolved; most likely a call to
- UpdateJobRetries or UpdateWorkflowInstancePayload will be necessary to actually resolve the
+ UpdateJobRetries or SetVariables will be necessary to actually resolve the
problem, following by this call.
Errors:
NOT_FOUND:
- no incident with the given key exists
*/
rpc ResolveIncident (ResolveIncidentRequest) returns (ResolveIncidentResponse) {
}
/*
+ Updates all the variables of a particular scope (e.g. workflow instance, flow element instance)
+ from the given JSON document.
+
+ Errors:
+ NOT_FOUND:
+ - no element with the given elementInstanceKey exists
+ INVALID_ARGUMENT:
+ - the given variables document is not a valid JSON document; valid documents are expected to
+ be JSON documents where the root node is an object.
+ */
+ rpc SetVariables (SetVariablesRequest) returns (SetVariablesResponse) {
+ }
+
+ /*
Obtains the current topology of the cluster the gateway is part of.
*/
rpc Topology (TopologyRequest) returns (TopologyResponse) {
}
@@ -451,20 +473,7 @@
INVALID_ARGUMENT:
- retries is not greater than 0
*/
rpc UpdateJobRetries (UpdateJobRetriesRequest) returns (UpdateJobRetriesResponse) {
- }
-
- /*
- Updates all the variables in the workflow instance scope from the given JSON document.
-
- Errors:
- NOT_FOUND:
- - no element with the given elementInstanceKey exists
- INVALID_ARGUMENT:
- - the given payload is not a valid JSON document; all payloads are expected to be
- valid JSON documents where the root node is an object.
- */
- rpc UpdateWorkflowInstancePayload (UpdateWorkflowInstancePayloadRequest) returns (UpdateWorkflowInstancePayloadResponse) {
}
}