zeebe_bpmn_rspec 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9326bc3b39da887700ba4f953b851cb31bdfcf5c69f66072e32dd8186a230e3e
4
- data.tar.gz: abf9685a1f5d66fc1704afe29e2664e75ced661f959245689a9bbf9f35925ea4
3
+ metadata.gz: a8ab5c676ef52ca21100add177726c7443298348603c89e8a53e1692b2876e21
4
+ data.tar.gz: a9a7acca330b1377991b524cb9e31d91ccd7599ef0391ca58aef6700dc7da168
5
5
  SHA512:
6
- metadata.gz: a63baf2863a6ad3eda3a253c6ca5ae113bf25d082763686aacfcde3b57ece0d73970780a752712b73bd80fab51bc96f41a3ff04cb679c962d29d0cee3b0b4c83
7
- data.tar.gz: a0f1a2178661ae07958c6c1c3d0b9374a9c790ae3f58ffae418a145eb20b326656c754861c1e57302fc9d662bcd6a60192304cf8feb1f73b64d79611dae37dc3
6
+ metadata.gz: aae2aa7d081b9dd5cc342f955f060b0a605f23c680b3a7b9368857fc08ada31a58fb047cdd41e419d8394127786b29b76486c8feb0ce5aef1925e9ee3f88237d
7
+ data.tar.gz: 5639b3ee712ea0af3b961e3402d5c606d3b26f55279785d844909030557fa8054c2ab344c62d10afcf020408055c58491eba9dcfc288eef673d37fd5d3eca799
@@ -1,5 +1,10 @@
1
1
  # zeebe_bpmn_rspec
2
2
 
3
+ ## v0.4.1
4
+ - Allow `with_workflow_instance` to be called without a block.
5
+ - Allow `worker` to be specified when activating a job.
6
+ - Expose `workflow_instance_key` for activated jobs.
7
+
3
8
  ## v0.4.0
4
9
  - Add `ttl_ms` option for `publish_message`.
5
10
  - Add `update_retries` method to `ActivatedJob` class.
@@ -8,7 +8,7 @@ module ZeebeBpmnRspec
8
8
  class ActivatedJob
9
9
  include ::Zeebe::Client::GatewayProtocol # for direct reference of request classes
10
10
 
11
- attr_reader :job, :type, :workflow_instance_key
11
+ attr_reader :job, :type
12
12
 
13
13
  def initialize(job, type:, workflow_instance_key:, client:, context:, validate:) # rubocop:disable Metrics/ParameterLists
14
14
  @job = job
@@ -36,6 +36,10 @@ module ZeebeBpmnRspec
36
36
  job.key
37
37
  end
38
38
 
39
+ def workflow_instance_key
40
+ job.workflowInstanceKey
41
+ end
42
+
39
43
  def retries
40
44
  job.retries
41
45
  end
@@ -26,7 +26,7 @@ module ZeebeBpmnRspec
26
26
  variables: variables.to_json
27
27
  ))
28
28
  @__workflow_instance_key = workflow.workflowInstanceKey
29
- yield(workflow.workflowInstanceKey)
29
+ yield(workflow.workflowInstanceKey) if block_given?
30
30
  rescue Exception => e # rubocop:disable Lint/RescueException
31
31
  # exceptions are rescued to ensure that instances are cancelled
32
32
  # any error is re-raised below
@@ -64,10 +64,10 @@ module ZeebeBpmnRspec
64
64
  @__workflow_instance_key
65
65
  end
66
66
 
67
- def activate_job(type, fetch_variables: nil, validate: true)
67
+ def activate_job(type, fetch_variables: nil, validate: true, worker: "#{type}-#{SecureRandom.hex}")
68
68
  stream = _zeebe_client.activate_jobs(ActivateJobsRequest.new({
69
69
  type: type,
70
- worker: "#{type}-#{SecureRandom.hex}",
70
+ worker: worker,
71
71
  maxJobsToActivate: 1,
72
72
  timeout: 1000,
73
73
  fetchVariable: fetch_variables&.then { |v| Array(v) },
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ZeebeBpmnRspec
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zeebe_bpmn_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ezCater, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2020-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler