busybee 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +23 -0
- data/LICENSE.txt +21 -0
- data/README.md +214 -0
- data/docs/grpc.md +106 -0
- data/docs/testing.md +680 -0
- data/lib/busybee/grpc/gateway_pb.rb +91 -0
- data/lib/busybee/grpc/gateway_services_pb.rb +278 -0
- data/lib/busybee/grpc.rb +4 -0
- data/lib/busybee/testing/activated_job.rb +140 -0
- data/lib/busybee/testing/helpers.rb +251 -0
- data/lib/busybee/testing/matchers/have_activated.rb +66 -0
- data/lib/busybee/testing/matchers/have_received_headers.rb +21 -0
- data/lib/busybee/testing/matchers/have_received_variables.rb +21 -0
- data/lib/busybee/testing.rb +54 -0
- data/lib/busybee/version.rb +5 -0
- data/lib/busybee.rb +7 -0
- metadata +94 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated by grpc_tools_ruby_protoc - DO NOT EDIT MANUALLY
|
|
4
|
+
# Regenerate with: rake grpc:generate
|
|
5
|
+
|
|
6
|
+
module Busybee
|
|
7
|
+
module GRPC
|
|
8
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
9
|
+
# source: gateway.proto
|
|
10
|
+
|
|
11
|
+
require "google/protobuf"
|
|
12
|
+
|
|
13
|
+
descriptor_data = "\n\rgateway.proto\x12\x10gateway_protocol\"u\n\x1aStreamActivatedJobsRequest\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0e\n\x06worker\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\x03\x12\x15\n\rfetchVariable\x18\x05 \x03(\t\x12\x11\n\ttenantIds\x18\x06 \x03(\t\"\xa1\x01\n\x13\x41\x63tivateJobsRequest\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0e\n\x06worker\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\x03\x12\x19\n\x11maxJobsToActivate\x18\x04 \x01(\x05\x12\x15\n\rfetchVariable\x18\x05 \x03(\t\x12\x16\n\x0erequestTimeout\x18\x06 \x01(\x03\x12\x11\n\ttenantIds\x18\x07 \x03(\t\"D\n\x14\x41\x63tivateJobsResponse\x12,\n\x04jobs\x18\x01 \x03(\x0b\x32\x1e.gateway_protocol.ActivatedJob\"\xfa\x05\n\x0c\x41\x63tivatedJob\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x1a\n\x12processInstanceKey\x18\x03 \x01(\x03\x12\x15\n\rbpmnProcessId\x18\x04 \x01(\t\x12 \n\x18processDefinitionVersion\x18\x05 \x01(\x05\x12\x1c\n\x14processDefinitionKey\x18\x06 \x01(\x03\x12\x11\n\telementId\x18\x07 \x01(\t\x12\x1a\n\x12\x65lementInstanceKey\x18\x08 \x01(\x03\x12\x15\n\rcustomHeaders\x18\t \x01(\t\x12\x0e\n\x06worker\x18\n \x01(\t\x12\x0f\n\x07retries\x18\x0b \x01(\x05\x12\x10\n\x08\x64\x65\x61\x64line\x18\x0c \x01(\x03\x12\x11\n\tvariables\x18\r \x01(\t\x12\x10\n\x08tenantId\x18\x0e \x01(\t\x12;\n\x08userTask\x18\x0f \x01(\x0b\x32$.gateway_protocol.UserTaskPropertiesH\x00\x88\x01\x01\x12\x34\n\x04kind\x18\x10 \x01(\x0e\x32&.gateway_protocol.ActivatedJob.JobKind\x12K\n\x11listenerEventType\x18\x11 \x01(\x0e\x32\x30.gateway_protocol.ActivatedJob.ListenerEventType\x12\x0c\n\x04tags\x18\x12 \x03(\t\"^\n\x07JobKind\x12\x10\n\x0c\x42PMN_ELEMENT\x10\x00\x12\x16\n\x12\x45XECUTION_LISTENER\x10\x01\x12\x11\n\rTASK_LISTENER\x10\x02\x12\x16\n\x12\x41\x44_HOC_SUB_PROCESS\x10\x03\"\x82\x01\n\x11ListenerEventType\x12\r\n\tASSIGNING\x10\x00\x12\r\n\tCANCELING\x10\x01\x12\x0e\n\nCOMPLETING\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x07\n\x03\x45ND\x10\x04\x12\t\n\x05START\x10\x05\x12\x0f\n\x0bUNSPECIFIED\x10\x06\x12\x0c\n\x08UPDATING\x10\x07\x42\x0b\n\t_userTask\"\xe2\x02\n\x12UserTaskProperties\x12\x13\n\x06\x61\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08\x61ssignee\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x17\n\x0f\x63\x61ndidateGroups\x18\x03 \x03(\t\x12\x16\n\x0e\x63\x61ndidateUsers\x18\x04 \x03(\t\x12\x19\n\x11\x63hangedAttributes\x18\x05 \x03(\t\x12\x14\n\x07\x64ueDate\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x19\n\x0c\x66ollowUpDate\x18\x07 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07\x66ormKey\x18\x08 \x01(\x03H\x04\x88\x01\x01\x12\x15\n\x08priority\x18\t \x01(\x05H\x05\x88\x01\x01\x12\x18\n\x0buserTaskKey\x18\n \x01(\x03H\x06\x88\x01\x01\x42\t\n\x07_actionB\x0b\n\t_assigneeB\n\n\x08_dueDateB\x0f\n\r_followUpDateB\n\n\x08_formKeyB\x0b\n\t_priorityB\x0e\n\x0c_userTaskKey\"r\n\x1c\x43\x61ncelProcessInstanceRequest\x12\x1a\n\x12processInstanceKey\x18\x01 \x01(\x03\x12\x1f\n\x12operationReference\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\x15\n\x13_operationReference\"\x1f\n\x1d\x43\x61ncelProcessInstanceResponse\"t\n\x12\x43ompleteJobRequest\x12\x0e\n\x06jobKey\x18\x01 \x01(\x03\x12\x11\n\tvariables\x18\x02 \x01(\t\x12\x30\n\x06result\x18\x03 \x01(\x0b\x32\x1b.gateway_protocol.JobResultH\x00\x88\x01\x01\x42\t\n\x07_result\"\xa3\x03\n\tJobResult\x12\x13\n\x06\x64\x65nied\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12@\n\x0b\x63orrections\x18\x02 \x01(\x0b\x32&.gateway_protocol.JobResultCorrectionsH\x01\x88\x01\x01\x12\x19\n\x0c\x64\x65niedReason\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x11\n\x04type\x18\x04 \x01(\tH\x03\x88\x01\x01\x12\x44\n\x10\x61\x63tivateElements\x18\x05 \x03(\x0b\x32*.gateway_protocol.JobResultActivateElement\x12+\n\x1eisCompletionConditionFulfilled\x18\x06 \x01(\x08H\x04\x88\x01\x01\x12\'\n\x1aisCancelRemainingInstances\x18\x07 \x01(\x08H\x05\x88\x01\x01\x42\t\n\x07_deniedB\x0e\n\x0c_correctionsB\x0f\n\r_deniedReasonB\x07\n\x05_typeB!\n\x1f_isCompletionConditionFulfilledB\x1d\n\x1b_isCancelRemainingInstances\"\xca\x02\n\x14JobResultCorrections\x12\x15\n\x08\x61ssignee\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x64ueDate\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0c\x66ollowUpDate\x18\x03 \x01(\tH\x02\x88\x01\x01\x12\x39\n\x0e\x63\x61ndidateUsers\x18\x04 \x01(\x0b\x32\x1c.gateway_protocol.StringListH\x03\x88\x01\x01\x12:\n\x0f\x63\x61ndidateGroups\x18\x05 \x01(\x0b\x32\x1c.gateway_protocol.StringListH\x04\x88\x01\x01\x12\x15\n\x08priority\x18\x06 \x01(\x05H\x05\x88\x01\x01\x42\x0b\n\t_assigneeB\n\n\x08_dueDateB\x0f\n\r_followUpDateB\x11\n\x0f_candidateUsersB\x12\n\x10_candidateGroupsB\x0b\n\t_priority\"@\n\x18JobResultActivateElement\x12\x11\n\telementId\x18\x01 \x01(\t\x12\x11\n\tvariables\x18\x02 \x01(\t\"\x1c\n\nStringList\x12\x0e\n\x06values\x18\x01 \x03(\t\"\x15\n\x13\x43ompleteJobResponse\"\xff\x02\n\x1c\x43reateProcessInstanceRequest\x12\x1c\n\x14processDefinitionKey\x18\x01 \x01(\x03\x12\x15\n\rbpmnProcessId\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x11\n\tvariables\x18\x04 \x01(\t\x12T\n\x11startInstructions\x18\x05 \x03(\x0b\x32\x39.gateway_protocol.ProcessInstanceCreationStartInstruction\x12\x10\n\x08tenantId\x18\x06 \x01(\t\x12\x1f\n\x12operationReference\x18\x07 \x01(\x04H\x00\x88\x01\x01\x12X\n\x13runtimeInstructions\x18\x08 \x03(\x0b\x32;.gateway_protocol.ProcessInstanceCreationRuntimeInstruction\x12\x0c\n\x04tags\x18\t \x03(\tB\x15\n\x13_operationReference\"<\n\'ProcessInstanceCreationStartInstruction\x12\x11\n\telementId\x18\x01 \x01(\t\"\x86\x01\n)ProcessInstanceCreationRuntimeInstruction\x12J\n\tterminate\x18\x01 \x01(\x0b\x32\x35.gateway_protocol.TerminateProcessInstanceInstructionH\x00\x42\r\n\x0binstruction\"=\n#TerminateProcessInstanceInstruction\x12\x16\n\x0e\x61\x66terElementId\x18\x01 \x01(\t\"\xa1\x01\n\x1d\x43reateProcessInstanceResponse\x12\x1c\n\x14processDefinitionKey\x18\x01 \x01(\x03\x12\x15\n\rbpmnProcessId\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x1a\n\x12processInstanceKey\x18\x04 \x01(\x03\x12\x10\n\x08tenantId\x18\x05 \x01(\t\x12\x0c\n\x04tags\x18\x06 \x03(\t\"\x99\x01\n&CreateProcessInstanceWithResultRequest\x12?\n\x07request\x18\x01 \x01(\x0b\x32..gateway_protocol.CreateProcessInstanceRequest\x12\x16\n\x0erequestTimeout\x18\x02 \x01(\x03\x12\x16\n\x0e\x66\x65tchVariables\x18\x03 \x03(\t\"\xbe\x01\n\'CreateProcessInstanceWithResultResponse\x12\x1c\n\x14processDefinitionKey\x18\x01 \x01(\x03\x12\x15\n\rbpmnProcessId\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x1a\n\x12processInstanceKey\x18\x04 \x01(\x03\x12\x11\n\tvariables\x18\x05 \x01(\t\x12\x10\n\x08tenantId\x18\x06 \x01(\t\x12\x0c\n\x04tags\x18\x07 \x03(\t\"g\n\x17\x45valuateDecisionRequest\x12\x13\n\x0b\x64\x65\x63isionKey\x18\x01 \x01(\x03\x12\x12\n\ndecisionId\x18\x02 \x01(\t\x12\x11\n\tvariables\x18\x03 \x01(\t\x12\x10\n\x08tenantId\x18\x04 \x01(\t\"\x8c\x03\n\x18\x45valuateDecisionResponse\x12\x13\n\x0b\x64\x65\x63isionKey\x18\x01 \x01(\x03\x12\x12\n\ndecisionId\x18\x02 \x01(\t\x12\x14\n\x0c\x64\x65\x63isionName\x18\x03 \x01(\t\x12\x17\n\x0f\x64\x65\x63isionVersion\x18\x04 \x01(\x05\x12\x1e\n\x16\x64\x65\x63isionRequirementsId\x18\x05 \x01(\t\x12\x1f\n\x17\x64\x65\x63isionRequirementsKey\x18\x06 \x01(\x03\x12\x16\n\x0e\x64\x65\x63isionOutput\x18\x07 \x01(\t\x12?\n\x12\x65valuatedDecisions\x18\x08 \x03(\x0b\x32#.gateway_protocol.EvaluatedDecision\x12\x18\n\x10\x66\x61iledDecisionId\x18\t \x01(\t\x12\x16\n\x0e\x66\x61ilureMessage\x18\n \x01(\t\x12\x10\n\x08tenantId\x18\x0b \x01(\t\x12\x1b\n\x13\x64\x65\x63isionInstanceKey\x18\x0c \x01(\x03\x12\x1d\n\x15\x64\x65\x63isionEvaluationKey\x18\r \x01(\x03\"\xd2\x02\n\x11\x45valuatedDecision\x12\x13\n\x0b\x64\x65\x63isionKey\x18\x01 \x01(\x03\x12\x12\n\ndecisionId\x18\x02 \x01(\t\x12\x14\n\x0c\x64\x65\x63isionName\x18\x03 \x01(\t\x12\x17\n\x0f\x64\x65\x63isionVersion\x18\x04 \x01(\x05\x12\x14\n\x0c\x64\x65\x63isionType\x18\x05 \x01(\t\x12\x16\n\x0e\x64\x65\x63isionOutput\x18\x06 \x01(\t\x12;\n\x0cmatchedRules\x18\x07 \x03(\x0b\x32%.gateway_protocol.MatchedDecisionRule\x12\x41\n\x0f\x65valuatedInputs\x18\x08 \x03(\x0b\x32(.gateway_protocol.EvaluatedDecisionInput\x12\x10\n\x08tenantId\x18\t \x01(\t\x12%\n\x1d\x64\x65\x63isionEvaluationInstanceKey\x18\n \x01(\t\"P\n\x16\x45valuatedDecisionInput\x12\x0f\n\x07inputId\x18\x01 \x01(\t\x12\x11\n\tinputName\x18\x02 \x01(\t\x12\x12\n\ninputValue\x18\x03 \x01(\t\"T\n\x17\x45valuatedDecisionOutput\x12\x10\n\x08outputId\x18\x01 \x01(\t\x12\x12\n\noutputName\x18\x02 \x01(\t\x12\x13\n\x0boutputValue\x18\x03 \x01(\t\"}\n\x13MatchedDecisionRule\x12\x0e\n\x06ruleId\x18\x01 \x01(\t\x12\x11\n\truleIndex\x18\x02 \x01(\x05\x12\x43\n\x10\x65valuatedOutputs\x18\x03 \x03(\x0b\x32).gateway_protocol.EvaluatedDecisionOutput\"U\n\x14\x44\x65ployProcessRequest\x12\x39\n\tprocesses\x18\x01 \x03(\x0b\x32&.gateway_protocol.ProcessRequestObject:\x02\x18\x01\"<\n\x14ProcessRequestObject\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ndefinition\x18\x02 \x01(\x0c:\x02\x18\x01\"^\n\x15\x44\x65ployProcessResponse\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x34\n\tprocesses\x18\x02 \x03(\x0b\x32!.gateway_protocol.ProcessMetadata:\x02\x18\x01\"X\n\x15\x44\x65ployResourceRequest\x12-\n\tresources\x18\x01 \x03(\x0b\x32\x1a.gateway_protocol.Resource\x12\x10\n\x08tenantId\x18\x02 \x01(\t\")\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\x0c\"j\n\x16\x44\x65ployResourceResponse\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x31\n\x0b\x64\x65ployments\x18\x02 \x03(\x0b\x32\x1c.gateway_protocol.Deployment\x12\x10\n\x08tenantId\x18\x03 \x01(\t\"\x86\x02\n\nDeployment\x12\x34\n\x07process\x18\x01 \x01(\x0b\x32!.gateway_protocol.ProcessMetadataH\x00\x12\x36\n\x08\x64\x65\x63ision\x18\x02 \x01(\x0b\x32\".gateway_protocol.DecisionMetadataH\x00\x12N\n\x14\x64\x65\x63isionRequirements\x18\x03 \x01(\x0b\x32..gateway_protocol.DecisionRequirementsMetadataH\x00\x12.\n\x04\x66orm\x18\x04 \x01(\x0b\x32\x1e.gateway_protocol.FormMetadataH\x00\x42\n\n\x08Metadata\"\x7f\n\x0fProcessMetadata\x12\x15\n\rbpmnProcessId\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12\x1c\n\x14processDefinitionKey\x18\x03 \x01(\x03\x12\x14\n\x0cresourceName\x18\x04 \x01(\t\x12\x10\n\x08tenantId\x18\x05 \x01(\t\"\xbe\x01\n\x10\x44\x65\x63isionMetadata\x12\x15\n\rdmnDecisionId\x18\x01 \x01(\t\x12\x17\n\x0f\x64mnDecisionName\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x13\n\x0b\x64\x65\x63isionKey\x18\x04 \x01(\x03\x12!\n\x19\x64mnDecisionRequirementsId\x18\x05 \x01(\t\x12\x1f\n\x17\x64\x65\x63isionRequirementsKey\x18\x06 \x01(\x03\x12\x10\n\x08tenantId\x18\x07 \x01(\t\"\xc0\x01\n\x1c\x44\x65\x63isionRequirementsMetadata\x12!\n\x19\x64mnDecisionRequirementsId\x18\x01 \x01(\t\x12#\n\x1b\x64mnDecisionRequirementsName\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\x05\x12\x1f\n\x17\x64\x65\x63isionRequirementsKey\x18\x04 \x01(\x03\x12\x14\n\x0cresourceName\x18\x05 \x01(\t\x12\x10\n\x08tenantId\x18\x06 \x01(\t\"h\n\x0c\x46ormMetadata\x12\x0e\n\x06\x66ormId\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x05\x12\x0f\n\x07\x66ormKey\x18\x03 \x01(\x03\x12\x14\n\x0cresourceName\x18\x04 \x01(\t\x12\x10\n\x08tenantId\x18\x05 \x01(\t\"p\n\x0e\x46\x61ilJobRequest\x12\x0e\n\x06jobKey\x18\x01 \x01(\x03\x12\x0f\n\x07retries\x18\x02 \x01(\x05\x12\x14\n\x0c\x65rrorMessage\x18\x03 \x01(\t\x12\x14\n\x0cretryBackOff\x18\x04 \x01(\x03\x12\x11\n\tvariables\x18\x05 \x01(\t\"\x11\n\x0f\x46\x61ilJobResponse\"_\n\x11ThrowErrorRequest\x12\x0e\n\x06jobKey\x18\x01 \x01(\x03\x12\x11\n\terrorCode\x18\x02 \x01(\t\x12\x14\n\x0c\x65rrorMessage\x18\x03 \x01(\t\x12\x11\n\tvariables\x18\x04 \x01(\t\"\x14\n\x12ThrowErrorResponse\"\x89\x01\n\x15PublishMessageRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x16\n\x0e\x63orrelationKey\x18\x02 \x01(\t\x12\x12\n\ntimeToLive\x18\x03 \x01(\x03\x12\x11\n\tmessageId\x18\x04 \x01(\t\x12\x11\n\tvariables\x18\x05 \x01(\t\x12\x10\n\x08tenantId\x18\x06 \x01(\t\"7\n\x16PublishMessageResponse\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x10\n\x08tenantId\x18\x02 \x01(\t\"e\n\x16ResolveIncidentRequest\x12\x13\n\x0bincidentKey\x18\x01 \x01(\x03\x12\x1f\n\x12operationReference\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\x15\n\x13_operationReference\"\x19\n\x17ResolveIncidentResponse\"\x11\n\x0fTopologyRequest\"\xa2\x01\n\x10TopologyResponse\x12-\n\x07\x62rokers\x18\x01 \x03(\x0b\x32\x1c.gateway_protocol.BrokerInfo\x12\x13\n\x0b\x63lusterSize\x18\x02 \x01(\x05\x12\x17\n\x0fpartitionsCount\x18\x03 \x01(\x05\x12\x19\n\x11replicationFactor\x18\x04 \x01(\x05\x12\x16\n\x0egatewayVersion\x18\x05 \x01(\t\"z\n\nBrokerInfo\x12\x0e\n\x06nodeId\x18\x01 \x01(\x05\x12\x0c\n\x04host\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\x05\x12/\n\npartitions\x18\x04 \x03(\x0b\x32\x1b.gateway_protocol.Partition\x12\x0f\n\x07version\x18\x05 \x01(\t\"\xa0\x02\n\tPartition\x12\x13\n\x0bpartitionId\x18\x01 \x01(\x05\x12=\n\x04role\x18\x02 \x01(\x0e\x32/.gateway_protocol.Partition.PartitionBrokerRole\x12\x41\n\x06health\x18\x03 \x01(\x0e\x32\x31.gateway_protocol.Partition.PartitionBrokerHealth\"=\n\x13PartitionBrokerRole\x12\n\n\x06LEADER\x10\x00\x12\x0c\n\x08\x46OLLOWER\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"=\n\x15PartitionBrokerHealth\x12\x0b\n\x07HEALTHY\x10\x00\x12\r\n\tUNHEALTHY\x10\x01\x12\x08\n\x04\x44\x45\x41\x44\x10\x02\"r\n\x17UpdateJobRetriesRequest\x12\x0e\n\x06jobKey\x18\x01 \x01(\x03\x12\x0f\n\x07retries\x18\x02 \x01(\x05\x12\x1f\n\x12operationReference\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\x15\n\x13_operationReference\"\x1a\n\x18UpdateJobRetriesResponse\"r\n\x17UpdateJobTimeoutRequest\x12\x0e\n\x06jobKey\x18\x01 \x01(\x03\x12\x0f\n\x07timeout\x18\x02 \x01(\x03\x12\x1f\n\x12operationReference\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\x15\n\x13_operationReference\"\x1a\n\x18UpdateJobTimeoutResponse\"\x8b\x01\n\x13SetVariablesRequest\x12\x1a\n\x12\x65lementInstanceKey\x18\x01 \x01(\x03\x12\x11\n\tvariables\x18\x02 \x01(\t\x12\r\n\x05local\x18\x03 \x01(\x08\x12\x1f\n\x12operationReference\x18\x04 \x01(\x04H\x00\x88\x01\x01\x42\x15\n\x13_operationReference\"#\n\x14SetVariablesResponse\x12\x0b\n\x03key\x18\x01 \x01(\x03\"\xd8\x04\n\x1cModifyProcessInstanceRequest\x12\x1a\n\x12processInstanceKey\x18\x01 \x01(\x03\x12`\n\x14\x61\x63tivateInstructions\x18\x02 \x03(\x0b\x32\x42.gateway_protocol.ModifyProcessInstanceRequest.ActivateInstruction\x12\x62\n\x15terminateInstructions\x18\x03 \x03(\x0b\x32\x43.gateway_protocol.ModifyProcessInstanceRequest.TerminateInstruction\x12\x1f\n\x12operationReference\x18\x04 \x01(\x04H\x00\x88\x01\x01\x1a\xae\x01\n\x13\x41\x63tivateInstruction\x12\x11\n\telementId\x18\x01 \x01(\t\x12\"\n\x1a\x61ncestorElementInstanceKey\x18\x02 \x01(\x03\x12`\n\x14variableInstructions\x18\x03 \x03(\x0b\x32\x42.gateway_protocol.ModifyProcessInstanceRequest.VariableInstruction\x1a\x39\n\x13VariableInstruction\x12\x11\n\tvariables\x18\x01 \x01(\t\x12\x0f\n\x07scopeId\x18\x02 \x01(\t\x1a\x32\n\x14TerminateInstruction\x12\x1a\n\x12\x65lementInstanceKey\x18\x01 \x01(\x03\x42\x15\n\x13_operationReference\"\x1f\n\x1dModifyProcessInstanceResponse\"\xa8\x03\n\x1dMigrateProcessInstanceRequest\x12\x1a\n\x12processInstanceKey\x18\x01 \x01(\x03\x12T\n\rmigrationPlan\x18\x02 \x01(\x0b\x32=.gateway_protocol.MigrateProcessInstanceRequest.MigrationPlan\x12\x1f\n\x12operationReference\x18\x03 \x01(\x04H\x00\x88\x01\x01\x1a\x94\x01\n\rMigrationPlan\x12\"\n\x1atargetProcessDefinitionKey\x18\x01 \x01(\x03\x12_\n\x13mappingInstructions\x18\x02 \x03(\x0b\x32\x42.gateway_protocol.MigrateProcessInstanceRequest.MappingInstruction\x1a\x46\n\x12MappingInstruction\x12\x17\n\x0fsourceElementId\x18\x01 \x01(\t\x12\x17\n\x0ftargetElementId\x18\x02 \x01(\tB\x15\n\x13_operationReference\" \n\x1eMigrateProcessInstanceResponse\"d\n\x15\x44\x65leteResourceRequest\x12\x13\n\x0bresourceKey\x18\x01 \x01(\x03\x12\x1f\n\x12operationReference\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\x15\n\x13_operationReference\"\x18\n\x16\x44\x65leteResourceResponse\"Q\n\x16\x42roadcastSignalRequest\x12\x12\n\nsignalName\x18\x01 \x01(\t\x12\x11\n\tvariables\x18\x02 \x01(\t\x12\x10\n\x08tenantId\x18\x03 \x01(\t\"8\n\x17\x42roadcastSignalResponse\x12\x0b\n\x03key\x18\x01 \x01(\x03\x12\x10\n\x08tenantId\x18\x02 \x01(\t2\xdb\x11\n\x07Gateway\x12\x61\n\x0c\x41\x63tivateJobs\x12%.gateway_protocol.ActivateJobsRequest\x1a&.gateway_protocol.ActivateJobsResponse\"\x00\x30\x01\x12g\n\x13StreamActivatedJobs\x12,.gateway_protocol.StreamActivatedJobsRequest\x1a\x1e.gateway_protocol.ActivatedJob\"\x00\x30\x01\x12z\n\x15\x43\x61ncelProcessInstance\x12..gateway_protocol.CancelProcessInstanceRequest\x1a/.gateway_protocol.CancelProcessInstanceResponse\"\x00\x12\\\n\x0b\x43ompleteJob\x12$.gateway_protocol.CompleteJobRequest\x1a%.gateway_protocol.CompleteJobResponse\"\x00\x12z\n\x15\x43reateProcessInstance\x12..gateway_protocol.CreateProcessInstanceRequest\x1a/.gateway_protocol.CreateProcessInstanceResponse\"\x00\x12\x98\x01\n\x1f\x43reateProcessInstanceWithResult\x12\x38.gateway_protocol.CreateProcessInstanceWithResultRequest\x1a\x39.gateway_protocol.CreateProcessInstanceWithResultResponse\"\x00\x12k\n\x10\x45valuateDecision\x12).gateway_protocol.EvaluateDecisionRequest\x1a*.gateway_protocol.EvaluateDecisionResponse\"\x00\x12\x65\n\rDeployProcess\x12&.gateway_protocol.DeployProcessRequest\x1a\'.gateway_protocol.DeployProcessResponse\"\x03\x88\x02\x01\x12\x65\n\x0e\x44\x65ployResource\x12\'.gateway_protocol.DeployResourceRequest\x1a(.gateway_protocol.DeployResourceResponse\"\x00\x12P\n\x07\x46\x61ilJob\x12 .gateway_protocol.FailJobRequest\x1a!.gateway_protocol.FailJobResponse\"\x00\x12Y\n\nThrowError\x12#.gateway_protocol.ThrowErrorRequest\x1a$.gateway_protocol.ThrowErrorResponse\"\x00\x12\x65\n\x0ePublishMessage\x12\'.gateway_protocol.PublishMessageRequest\x1a(.gateway_protocol.PublishMessageResponse\"\x00\x12h\n\x0fResolveIncident\x12(.gateway_protocol.ResolveIncidentRequest\x1a).gateway_protocol.ResolveIncidentResponse\"\x00\x12_\n\x0cSetVariables\x12%.gateway_protocol.SetVariablesRequest\x1a&.gateway_protocol.SetVariablesResponse\"\x00\x12S\n\x08Topology\x12!.gateway_protocol.TopologyRequest\x1a\".gateway_protocol.TopologyResponse\"\x00\x12k\n\x10UpdateJobRetries\x12).gateway_protocol.UpdateJobRetriesRequest\x1a*.gateway_protocol.UpdateJobRetriesResponse\"\x00\x12z\n\x15ModifyProcessInstance\x12..gateway_protocol.ModifyProcessInstanceRequest\x1a/.gateway_protocol.ModifyProcessInstanceResponse\"\x00\x12}\n\x16MigrateProcessInstance\x12/.gateway_protocol.MigrateProcessInstanceRequest\x1a\x30.gateway_protocol.MigrateProcessInstanceResponse\"\x00\x12k\n\x10UpdateJobTimeout\x12).gateway_protocol.UpdateJobTimeoutRequest\x1a*.gateway_protocol.UpdateJobTimeoutResponse\"\x00\x12\x65\n\x0e\x44\x65leteResource\x12\'.gateway_protocol.DeleteResourceRequest\x1a(.gateway_protocol.DeleteResourceResponse\"\x00\x12h\n\x0f\x42roadcastSignal\x12(.gateway_protocol.BroadcastSignalRequest\x1a).gateway_protocol.BroadcastSignalResponse\"\x00\x42,\n!io.camunda.zeebe.gateway.protocolP\x00Z\x05./;pbb\x06proto3"
|
|
14
|
+
|
|
15
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
16
|
+
pool.add_serialized_file(descriptor_data)
|
|
17
|
+
|
|
18
|
+
StreamActivatedJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.StreamActivatedJobsRequest").msgclass
|
|
19
|
+
ActivateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ActivateJobsRequest").msgclass
|
|
20
|
+
ActivateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ActivateJobsResponse").msgclass
|
|
21
|
+
ActivatedJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ActivatedJob").msgclass
|
|
22
|
+
ActivatedJob::JobKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ActivatedJob.JobKind").enummodule
|
|
23
|
+
ActivatedJob::ListenerEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ActivatedJob.ListenerEventType").enummodule
|
|
24
|
+
UserTaskProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.UserTaskProperties").msgclass
|
|
25
|
+
CancelProcessInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.CancelProcessInstanceRequest").msgclass
|
|
26
|
+
CancelProcessInstanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.CancelProcessInstanceResponse").msgclass
|
|
27
|
+
CompleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.CompleteJobRequest").msgclass
|
|
28
|
+
JobResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.JobResult").msgclass
|
|
29
|
+
JobResultCorrections = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.JobResultCorrections").msgclass
|
|
30
|
+
JobResultActivateElement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.JobResultActivateElement").msgclass
|
|
31
|
+
StringList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.StringList").msgclass
|
|
32
|
+
CompleteJobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.CompleteJobResponse").msgclass
|
|
33
|
+
CreateProcessInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.CreateProcessInstanceRequest").msgclass
|
|
34
|
+
ProcessInstanceCreationStartInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ProcessInstanceCreationStartInstruction").msgclass
|
|
35
|
+
ProcessInstanceCreationRuntimeInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ProcessInstanceCreationRuntimeInstruction").msgclass
|
|
36
|
+
TerminateProcessInstanceInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.TerminateProcessInstanceInstruction").msgclass
|
|
37
|
+
CreateProcessInstanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.CreateProcessInstanceResponse").msgclass
|
|
38
|
+
CreateProcessInstanceWithResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.CreateProcessInstanceWithResultRequest").msgclass
|
|
39
|
+
CreateProcessInstanceWithResultResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.CreateProcessInstanceWithResultResponse").msgclass
|
|
40
|
+
EvaluateDecisionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.EvaluateDecisionRequest").msgclass
|
|
41
|
+
EvaluateDecisionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.EvaluateDecisionResponse").msgclass
|
|
42
|
+
EvaluatedDecision = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.EvaluatedDecision").msgclass
|
|
43
|
+
EvaluatedDecisionInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.EvaluatedDecisionInput").msgclass
|
|
44
|
+
EvaluatedDecisionOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.EvaluatedDecisionOutput").msgclass
|
|
45
|
+
MatchedDecisionRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.MatchedDecisionRule").msgclass
|
|
46
|
+
DeployProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.DeployProcessRequest").msgclass
|
|
47
|
+
ProcessRequestObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ProcessRequestObject").msgclass
|
|
48
|
+
DeployProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.DeployProcessResponse").msgclass
|
|
49
|
+
DeployResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.DeployResourceRequest").msgclass
|
|
50
|
+
Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.Resource").msgclass
|
|
51
|
+
DeployResourceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.DeployResourceResponse").msgclass
|
|
52
|
+
Deployment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.Deployment").msgclass
|
|
53
|
+
ProcessMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ProcessMetadata").msgclass
|
|
54
|
+
DecisionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.DecisionMetadata").msgclass
|
|
55
|
+
DecisionRequirementsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.DecisionRequirementsMetadata").msgclass
|
|
56
|
+
FormMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.FormMetadata").msgclass
|
|
57
|
+
FailJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.FailJobRequest").msgclass
|
|
58
|
+
FailJobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.FailJobResponse").msgclass
|
|
59
|
+
ThrowErrorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ThrowErrorRequest").msgclass
|
|
60
|
+
ThrowErrorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ThrowErrorResponse").msgclass
|
|
61
|
+
PublishMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.PublishMessageRequest").msgclass
|
|
62
|
+
PublishMessageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.PublishMessageResponse").msgclass
|
|
63
|
+
ResolveIncidentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ResolveIncidentRequest").msgclass
|
|
64
|
+
ResolveIncidentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ResolveIncidentResponse").msgclass
|
|
65
|
+
TopologyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.TopologyRequest").msgclass
|
|
66
|
+
TopologyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.TopologyResponse").msgclass
|
|
67
|
+
BrokerInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.BrokerInfo").msgclass
|
|
68
|
+
Partition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.Partition").msgclass
|
|
69
|
+
Partition::PartitionBrokerRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.Partition.PartitionBrokerRole").enummodule
|
|
70
|
+
Partition::PartitionBrokerHealth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.Partition.PartitionBrokerHealth").enummodule
|
|
71
|
+
UpdateJobRetriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.UpdateJobRetriesRequest").msgclass
|
|
72
|
+
UpdateJobRetriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.UpdateJobRetriesResponse").msgclass
|
|
73
|
+
UpdateJobTimeoutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.UpdateJobTimeoutRequest").msgclass
|
|
74
|
+
UpdateJobTimeoutResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.UpdateJobTimeoutResponse").msgclass
|
|
75
|
+
SetVariablesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.SetVariablesRequest").msgclass
|
|
76
|
+
SetVariablesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.SetVariablesResponse").msgclass
|
|
77
|
+
ModifyProcessInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ModifyProcessInstanceRequest").msgclass
|
|
78
|
+
ModifyProcessInstanceRequest::ActivateInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ModifyProcessInstanceRequest.ActivateInstruction").msgclass
|
|
79
|
+
ModifyProcessInstanceRequest::VariableInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ModifyProcessInstanceRequest.VariableInstruction").msgclass
|
|
80
|
+
ModifyProcessInstanceRequest::TerminateInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ModifyProcessInstanceRequest.TerminateInstruction").msgclass
|
|
81
|
+
ModifyProcessInstanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.ModifyProcessInstanceResponse").msgclass
|
|
82
|
+
MigrateProcessInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.MigrateProcessInstanceRequest").msgclass
|
|
83
|
+
MigrateProcessInstanceRequest::MigrationPlan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.MigrateProcessInstanceRequest.MigrationPlan").msgclass
|
|
84
|
+
MigrateProcessInstanceRequest::MappingInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.MigrateProcessInstanceRequest.MappingInstruction").msgclass
|
|
85
|
+
MigrateProcessInstanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.MigrateProcessInstanceResponse").msgclass
|
|
86
|
+
DeleteResourceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.DeleteResourceRequest").msgclass
|
|
87
|
+
DeleteResourceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.DeleteResourceResponse").msgclass
|
|
88
|
+
BroadcastSignalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.BroadcastSignalRequest").msgclass
|
|
89
|
+
BroadcastSignalResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gateway_protocol.BroadcastSignalResponse").msgclass
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Generated by grpc_tools_ruby_protoc - DO NOT EDIT MANUALLY
|
|
4
|
+
# Regenerate with: rake grpc:generate
|
|
5
|
+
|
|
6
|
+
module Busybee
|
|
7
|
+
module GRPC
|
|
8
|
+
# Source: gateway.proto for package 'gateway_protocol'
|
|
9
|
+
|
|
10
|
+
require "grpc"
|
|
11
|
+
require "busybee/grpc/gateway_pb"
|
|
12
|
+
|
|
13
|
+
module Gateway
|
|
14
|
+
class Service
|
|
15
|
+
include ::GRPC::GenericService
|
|
16
|
+
|
|
17
|
+
self.marshal_class_method = :encode
|
|
18
|
+
self.unmarshal_class_method = :decode
|
|
19
|
+
self.service_name = "gateway_protocol.Gateway"
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Iterates through all known partitions round-robin and activates up to the requested
|
|
23
|
+
# maximum and streams them back to the client as they are activated.
|
|
24
|
+
#
|
|
25
|
+
# Errors:
|
|
26
|
+
# INVALID_ARGUMENT:
|
|
27
|
+
# - type is blank (empty string, null)
|
|
28
|
+
# - worker is blank (empty string, null)
|
|
29
|
+
# - timeout less than 1
|
|
30
|
+
# - maxJobsToActivate is less than 1
|
|
31
|
+
rpc :ActivateJobs, ActivateJobsRequest, stream(ActivateJobsResponse)
|
|
32
|
+
#
|
|
33
|
+
# Registers client to a job stream that will stream jobs back to the client as
|
|
34
|
+
# they become activatable.
|
|
35
|
+
#
|
|
36
|
+
# Errors:
|
|
37
|
+
# INVALID_ARGUMENT:
|
|
38
|
+
# - type is blank (empty string, null)
|
|
39
|
+
# - timeout less than 1
|
|
40
|
+
# - If multi-tenancy is enabled, and tenantIds is empty (empty list)
|
|
41
|
+
# - If multi-tenancy is enabled, and an invalid tenant ID is provided. A tenant ID is considered invalid if:
|
|
42
|
+
# - The tenant ID is blank (empty string, null)
|
|
43
|
+
# - The tenant ID is longer than 31 characters
|
|
44
|
+
# - The tenant ID contains anything other than alphanumeric characters, dot (.), dash (-), or underscore (_)
|
|
45
|
+
# - If multi-tenancy is disabled, and tenantIds is not empty (empty list), or has an ID other than <default>
|
|
46
|
+
rpc :StreamActivatedJobs, StreamActivatedJobsRequest, stream(ActivatedJob)
|
|
47
|
+
#
|
|
48
|
+
# Cancels a running process instance
|
|
49
|
+
#
|
|
50
|
+
# Errors:
|
|
51
|
+
# NOT_FOUND:
|
|
52
|
+
# - no process instance exists with the given key
|
|
53
|
+
rpc :CancelProcessInstance, CancelProcessInstanceRequest, CancelProcessInstanceResponse
|
|
54
|
+
#
|
|
55
|
+
# Completes a job with the given variables, which allows completing the associated service task.
|
|
56
|
+
#
|
|
57
|
+
# Errors:
|
|
58
|
+
# NOT_FOUND:
|
|
59
|
+
# - no job exists with the given job key. Note that since jobs are removed once completed,
|
|
60
|
+
# it could be that this job did exist at some point.
|
|
61
|
+
#
|
|
62
|
+
# FAILED_PRECONDITION:
|
|
63
|
+
# - the job was marked as failed. In that case, the related incident must be resolved before
|
|
64
|
+
# the job can be activated again and completed.
|
|
65
|
+
rpc :CompleteJob, CompleteJobRequest, CompleteJobResponse
|
|
66
|
+
#
|
|
67
|
+
# Creates and starts an instance of the specified process. The process definition to use to
|
|
68
|
+
# create the instance can be specified either using its unique key (as returned by
|
|
69
|
+
# DeployProcess), or using the BPMN process ID and a version. Pass -1 as the version to use the
|
|
70
|
+
# latest deployed version. Note that only processes with none start events can be started through
|
|
71
|
+
# this command.
|
|
72
|
+
#
|
|
73
|
+
# Errors:
|
|
74
|
+
# NOT_FOUND:
|
|
75
|
+
# - no process with the given key exists (if processDefinitionKey was given)
|
|
76
|
+
# - no process with the given process ID exists (if bpmnProcessId was given but version was -1)
|
|
77
|
+
# - no process with the given process ID and version exists (if both bpmnProcessId and version were given)
|
|
78
|
+
#
|
|
79
|
+
# FAILED_PRECONDITION:
|
|
80
|
+
# - the process definition does not contain a none start event; only processes with none
|
|
81
|
+
# start event can be started manually.
|
|
82
|
+
#
|
|
83
|
+
# INVALID_ARGUMENT:
|
|
84
|
+
# - the given variables argument is not a valid JSON document; it is expected to be a valid
|
|
85
|
+
# JSON document where the root node is an object.
|
|
86
|
+
rpc :CreateProcessInstance, CreateProcessInstanceRequest, CreateProcessInstanceResponse
|
|
87
|
+
#
|
|
88
|
+
# Behaves similarly to `rpc CreateProcessInstance`, except that a successful response is received when the process completes successfully.
|
|
89
|
+
rpc :CreateProcessInstanceWithResult, CreateProcessInstanceWithResultRequest,
|
|
90
|
+
CreateProcessInstanceWithResultResponse
|
|
91
|
+
#
|
|
92
|
+
# Evaluates a decision. The decision to evaluate can be specified either by
|
|
93
|
+
# using its unique key (as returned by DeployResource), or using the decision
|
|
94
|
+
# ID. When using the decision ID, the latest deployed version of the decision
|
|
95
|
+
# is used.
|
|
96
|
+
#
|
|
97
|
+
# Errors:
|
|
98
|
+
# INVALID_ARGUMENT:
|
|
99
|
+
# - no decision with the given key exists (if decisionKey was given)
|
|
100
|
+
# - no decision with the given decision ID exists (if decisionId was given)
|
|
101
|
+
# - both decision ID and decision KEY were provided, or are missing
|
|
102
|
+
rpc :EvaluateDecision, EvaluateDecisionRequest, EvaluateDecisionResponse
|
|
103
|
+
#
|
|
104
|
+
# Deploys one or more processes to Zeebe. Note that this is an atomic call,
|
|
105
|
+
# i.e. either all processes are deployed, or none of them are.
|
|
106
|
+
#
|
|
107
|
+
# Errors:
|
|
108
|
+
# INVALID_ARGUMENT:
|
|
109
|
+
# - no resources given.
|
|
110
|
+
# - if at least one resource is invalid. A resource is considered invalid if:
|
|
111
|
+
# - the resource data is not deserializable (e.g. detected as BPMN, but it's broken XML)
|
|
112
|
+
# - the process is invalid (e.g. an event-based gateway has an outgoing sequence flow to a task)
|
|
113
|
+
rpc :DeployProcess, DeployProcessRequest, DeployProcessResponse
|
|
114
|
+
#
|
|
115
|
+
# Deploys one or more resources (e.g. processes or decision models) to Zeebe.
|
|
116
|
+
# Note that this is an atomic call, i.e. either all resources are deployed, or none of them are.
|
|
117
|
+
#
|
|
118
|
+
# Errors:
|
|
119
|
+
# PERMISSION_DENIED:
|
|
120
|
+
# - if a deployment to an unauthorized tenant is performed
|
|
121
|
+
# INVALID_ARGUMENT:
|
|
122
|
+
# - no resources given.
|
|
123
|
+
# - if at least one resource is invalid. A resource is considered invalid if:
|
|
124
|
+
# - the content is not deserializable (e.g. detected as BPMN, but it's broken XML)
|
|
125
|
+
# - the content is invalid (e.g. an event-based gateway has an outgoing sequence flow to a task)
|
|
126
|
+
# - if multi-tenancy is enabled, and:
|
|
127
|
+
# - a tenant id is not provided
|
|
128
|
+
# - a tenant id with an invalid format is provided
|
|
129
|
+
# - if multi-tenancy is disabled and a tenant id is provided
|
|
130
|
+
rpc :DeployResource, DeployResourceRequest, DeployResourceResponse
|
|
131
|
+
#
|
|
132
|
+
# Marks the job as failed; if the retries argument is positive, then the job will be immediately
|
|
133
|
+
# activatable again, and a worker could try again to process it. If it is zero or negative however,
|
|
134
|
+
# an incident will be raised, tagged with the given errorMessage, and the job will not be
|
|
135
|
+
# activatable until the incident is resolved.
|
|
136
|
+
#
|
|
137
|
+
# Errors:
|
|
138
|
+
# NOT_FOUND:
|
|
139
|
+
# - no job was found with the given key
|
|
140
|
+
#
|
|
141
|
+
# FAILED_PRECONDITION:
|
|
142
|
+
# - the job was not activated
|
|
143
|
+
# - the job is already in a failed state, i.e. ran out of retries
|
|
144
|
+
rpc :FailJob, FailJobRequest, FailJobResponse
|
|
145
|
+
#
|
|
146
|
+
# Reports a business error (i.e. non-technical) that occurs while processing a job. The error is handled in the process by an error catch event. If there is no error catch event with the specified errorCode then an incident will be raised instead.
|
|
147
|
+
#
|
|
148
|
+
# Errors:
|
|
149
|
+
# NOT_FOUND:
|
|
150
|
+
# - no job was found with the given key
|
|
151
|
+
#
|
|
152
|
+
# FAILED_PRECONDITION:
|
|
153
|
+
# - the job is not in an activated state
|
|
154
|
+
rpc :ThrowError, ThrowErrorRequest, ThrowErrorResponse
|
|
155
|
+
#
|
|
156
|
+
# Publishes a single message. Messages are published to specific partitions computed from their
|
|
157
|
+
# correlation keys.
|
|
158
|
+
#
|
|
159
|
+
# Errors:
|
|
160
|
+
# ALREADY_EXISTS:
|
|
161
|
+
# - a message with the same ID was previously published (and is still alive)
|
|
162
|
+
rpc :PublishMessage, PublishMessageRequest, PublishMessageResponse
|
|
163
|
+
#
|
|
164
|
+
# Resolves a given incident. This simply marks the incident as resolved; most likely a call to
|
|
165
|
+
# UpdateJobRetries or SetVariables will be necessary to actually resolve the
|
|
166
|
+
# problem, following by this call.
|
|
167
|
+
#
|
|
168
|
+
# Errors:
|
|
169
|
+
# NOT_FOUND:
|
|
170
|
+
# - no incident with the given key exists
|
|
171
|
+
rpc :ResolveIncident, ResolveIncidentRequest, ResolveIncidentResponse
|
|
172
|
+
#
|
|
173
|
+
# Updates all the variables of a particular scope (e.g. process instance, flow element instance)
|
|
174
|
+
# from the given JSON document.
|
|
175
|
+
#
|
|
176
|
+
# Errors:
|
|
177
|
+
# NOT_FOUND:
|
|
178
|
+
# - no element with the given elementInstanceKey exists
|
|
179
|
+
# INVALID_ARGUMENT:
|
|
180
|
+
# - the given variables document is not a valid JSON document; valid documents are expected to
|
|
181
|
+
# be JSON documents where the root node is an object.
|
|
182
|
+
rpc :SetVariables, SetVariablesRequest, SetVariablesResponse
|
|
183
|
+
#
|
|
184
|
+
# Obtains the current topology of the cluster the gateway is part of.
|
|
185
|
+
rpc :Topology, TopologyRequest, TopologyResponse
|
|
186
|
+
#
|
|
187
|
+
# Updates the number of retries a job has left. This is mostly useful for jobs that have run out of
|
|
188
|
+
# retries, should the underlying problem be solved.
|
|
189
|
+
#
|
|
190
|
+
# Errors:
|
|
191
|
+
# NOT_FOUND:
|
|
192
|
+
# - no job exists with the given key
|
|
193
|
+
#
|
|
194
|
+
# INVALID_ARGUMENT:
|
|
195
|
+
# - retries is not greater than 0
|
|
196
|
+
rpc :UpdateJobRetries, UpdateJobRetriesRequest, UpdateJobRetriesResponse
|
|
197
|
+
#
|
|
198
|
+
# Modifies the process instance. This is done by activating and/or terminating specific elements of the instance.
|
|
199
|
+
#
|
|
200
|
+
# Errors:
|
|
201
|
+
# NOT_FOUND:
|
|
202
|
+
# - no process instance exists with the given key
|
|
203
|
+
#
|
|
204
|
+
# FAILED_PRECONDITION:
|
|
205
|
+
# - trying to activate element inside of a multi-instance
|
|
206
|
+
#
|
|
207
|
+
# INVALID_ARGUMENT:
|
|
208
|
+
# - activating or terminating unknown element
|
|
209
|
+
# - ancestor of element for activation doesn't exist
|
|
210
|
+
# - scope of variable is unknown
|
|
211
|
+
rpc :ModifyProcessInstance, ModifyProcessInstanceRequest, ModifyProcessInstanceResponse
|
|
212
|
+
#
|
|
213
|
+
# Migrates the process instance to the specified process definition.
|
|
214
|
+
# In simple terms, this is handled by updating the active element's process.
|
|
215
|
+
#
|
|
216
|
+
# Errors:
|
|
217
|
+
# NOT_FOUND:
|
|
218
|
+
# - no process instance exists with the given key, or it is not active
|
|
219
|
+
# - no process definition exists with the given target definition key
|
|
220
|
+
# - no process instance exists with the given key for the tenants the user is authorized to work with.
|
|
221
|
+
#
|
|
222
|
+
# FAILED_PRECONDITION:
|
|
223
|
+
# - not all active elements in the given process instance are mapped to the elements in the target process definition
|
|
224
|
+
# - a mapping instruction changes the type of an element or event
|
|
225
|
+
# - a mapping instruction changes the implementation of a task
|
|
226
|
+
# - a mapping instruction detaches a boundary event from an active element
|
|
227
|
+
# - a mapping instruction refers to an unsupported element (i.e. some elements will be supported later on)
|
|
228
|
+
# - a mapping instruction refers to element in unsupported scenarios.
|
|
229
|
+
# (i.e. migration is not supported when process instance or target process elements contains event subscriptions)
|
|
230
|
+
# - multiple mapping instructions target the same boundary event
|
|
231
|
+
#
|
|
232
|
+
# INVALID_ARGUMENT:
|
|
233
|
+
# - A `sourceElementId` does not refer to an element in the process instance's process definition
|
|
234
|
+
# - A `targetElementId` does not refer to an element in the target process definition
|
|
235
|
+
# - A `sourceElementId` is mapped by multiple mapping instructions.
|
|
236
|
+
# For example, the engine cannot determine how to migrate a process instance when the instructions are: [A->B, A->C].
|
|
237
|
+
rpc :MigrateProcessInstance, MigrateProcessInstanceRequest, MigrateProcessInstanceResponse
|
|
238
|
+
#
|
|
239
|
+
# Updates the deadline of a job using the timeout (in ms) provided. This can be used
|
|
240
|
+
# for extending or shortening the job deadline.
|
|
241
|
+
#
|
|
242
|
+
# Errors:
|
|
243
|
+
# NOT_FOUND:
|
|
244
|
+
# - no job exists with the given key
|
|
245
|
+
#
|
|
246
|
+
# INVALID_STATE:
|
|
247
|
+
# - no deadline exists for the given job key
|
|
248
|
+
rpc :UpdateJobTimeout, UpdateJobTimeoutRequest, UpdateJobTimeoutResponse
|
|
249
|
+
#
|
|
250
|
+
# Deletes a resource from the state. Once a resource has been deleted it cannot
|
|
251
|
+
# be recovered. If the resource needs to be available again, a new deployment
|
|
252
|
+
# of the resource is required.
|
|
253
|
+
#
|
|
254
|
+
# Deleting a process will cancel any running instances of this process
|
|
255
|
+
# definition. New instances of a deleted process are created using
|
|
256
|
+
# the lastest version that hasn't been deleted. Creating a new
|
|
257
|
+
# process instance is impossible when all versions have been
|
|
258
|
+
# deleted.
|
|
259
|
+
#
|
|
260
|
+
# Deleting a decision requirement definitions could cause incidents in process
|
|
261
|
+
# instances referencing these decisions in a business rule task. A decision
|
|
262
|
+
# will be evaluated with the latest version that hasn't been deleted. If all
|
|
263
|
+
# versions of a decision have been deleted the evaluation is rejected.
|
|
264
|
+
#
|
|
265
|
+
# Errors:
|
|
266
|
+
# NOT_FOUND:
|
|
267
|
+
# - No resource exists with the given key
|
|
268
|
+
#
|
|
269
|
+
rpc :DeleteResource, DeleteResourceRequest, DeleteResourceResponse
|
|
270
|
+
#
|
|
271
|
+
# Broadcasts a signal.
|
|
272
|
+
rpc :BroadcastSignal, BroadcastSignalRequest, BroadcastSignalResponse
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
Stub = Service.rpc_stub_class
|
|
276
|
+
end
|
|
277
|
+
end
|
|
278
|
+
end
|
data/lib/busybee/grpc.rb
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "json"
|
|
4
|
+
require "rspec/matchers"
|
|
5
|
+
require "busybee/grpc"
|
|
6
|
+
|
|
7
|
+
module Busybee
|
|
8
|
+
module Testing
|
|
9
|
+
# Wrapper around a raw GRPC ActivatedJob providing a fluent API for testing.
|
|
10
|
+
#
|
|
11
|
+
# @example Fluent style
|
|
12
|
+
# activate_job("my_task")
|
|
13
|
+
# .expect_variables(order_id: "123")
|
|
14
|
+
# .and_complete(result: "success")
|
|
15
|
+
#
|
|
16
|
+
# @example Standalone style
|
|
17
|
+
# job = activate_job("my_task")
|
|
18
|
+
# expect(job).to have_received_variables(order_id: "123")
|
|
19
|
+
# job.mark_completed(result: "success")
|
|
20
|
+
#
|
|
21
|
+
class ActivatedJob
|
|
22
|
+
include RSpec::Matchers
|
|
23
|
+
|
|
24
|
+
attr_reader :raw, :client
|
|
25
|
+
|
|
26
|
+
def initialize(raw_job, client:)
|
|
27
|
+
@raw = raw_job
|
|
28
|
+
@client = client
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def key
|
|
32
|
+
raw.key
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def process_instance_key
|
|
36
|
+
raw.processInstanceKey
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def variables
|
|
40
|
+
@variables ||= JSON.parse(raw.variables)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def headers
|
|
44
|
+
@headers ||= JSON.parse(raw.customHeaders)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def retries
|
|
48
|
+
raw.retries
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Assert that job variables include the expected values.
|
|
52
|
+
# Raises RSpec expectation failure if not matched.
|
|
53
|
+
#
|
|
54
|
+
# @param expected [Hash] expected variable key-value pairs
|
|
55
|
+
# @return [self] for chaining
|
|
56
|
+
def expect_variables(expected)
|
|
57
|
+
expect(variables).to include(stringify_keys(expected))
|
|
58
|
+
self
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Assert that job headers include the expected values.
|
|
62
|
+
# Raises RSpec expectation failure if not matched.
|
|
63
|
+
#
|
|
64
|
+
# @param expected [Hash] expected header key-value pairs
|
|
65
|
+
# @return [self] for chaining
|
|
66
|
+
def expect_headers(expected)
|
|
67
|
+
expect(headers).to include(stringify_keys(expected))
|
|
68
|
+
self
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Complete the job with optional output variables.
|
|
72
|
+
#
|
|
73
|
+
# @param variables [Hash] variables to merge into process state
|
|
74
|
+
# @return [self]
|
|
75
|
+
def mark_completed(variables = {})
|
|
76
|
+
request = Busybee::GRPC::CompleteJobRequest.new(
|
|
77
|
+
jobKey: key,
|
|
78
|
+
variables: JSON.generate(variables)
|
|
79
|
+
)
|
|
80
|
+
client.complete_job(request)
|
|
81
|
+
self
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
alias and_complete mark_completed
|
|
85
|
+
|
|
86
|
+
# Fail the job with optional message and retry count.
|
|
87
|
+
#
|
|
88
|
+
# @param message [String, nil] error message
|
|
89
|
+
# @param retries [Integer] number of retries remaining
|
|
90
|
+
# @return [self]
|
|
91
|
+
def mark_failed(message = nil, retries: 0)
|
|
92
|
+
request = Busybee::GRPC::FailJobRequest.new(
|
|
93
|
+
jobKey: key,
|
|
94
|
+
retries: retries,
|
|
95
|
+
errorMessage: message || ""
|
|
96
|
+
)
|
|
97
|
+
client.fail_job(request)
|
|
98
|
+
self
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
alias and_fail mark_failed
|
|
102
|
+
|
|
103
|
+
# Throw a BPMN error event.
|
|
104
|
+
#
|
|
105
|
+
# @param code [String] BPMN error code
|
|
106
|
+
# @param message [String, nil] error message
|
|
107
|
+
# @return [self]
|
|
108
|
+
def throw_error_event(code, message = nil)
|
|
109
|
+
request = Busybee::GRPC::ThrowErrorRequest.new(
|
|
110
|
+
jobKey: key,
|
|
111
|
+
errorCode: code,
|
|
112
|
+
errorMessage: message || ""
|
|
113
|
+
)
|
|
114
|
+
client.throw_error(request)
|
|
115
|
+
self
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
alias and_throw_error_event throw_error_event
|
|
119
|
+
|
|
120
|
+
# Update the job's retry count.
|
|
121
|
+
#
|
|
122
|
+
# @param count [Integer] new retry count
|
|
123
|
+
# @return [self]
|
|
124
|
+
def update_retries(count)
|
|
125
|
+
request = Busybee::GRPC::UpdateJobRetriesRequest.new(
|
|
126
|
+
jobKey: key,
|
|
127
|
+
retries: count
|
|
128
|
+
)
|
|
129
|
+
client.update_job_retries(request)
|
|
130
|
+
self
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
private
|
|
134
|
+
|
|
135
|
+
def stringify_keys(hash)
|
|
136
|
+
hash.transform_keys(&:to_s)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|