camunda-workflow 0.1.2 → 0.1.3
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 +4 -4
- data/CHANGELOG.md +1 -0
- data/lib/camunda/external_task.rb +9 -3
- data/lib/camunda/external_task_job.rb +3 -0
- data/lib/camunda/poller.rb +5 -1
- data/lib/camunda/task.rb +4 -1
- data/lib/camunda/workflow/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 258061e8801a974e302c84e184e90c60771aea045ac8ac51bd92afdcbfc4acc9
|
4
|
+
data.tar.gz: 9aa801c96ff96951ce08f7ed35d69d36772b9122aa4ac51addf62979ad7b63d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e77b9f038bad10d3e3606a4dc9ee3e594c050006dcaa0018733f41fc3f37d13db6392d3e76b15e1b88362b6623433e8495e664fa294e9197db849da7d71598e
|
7
|
+
data.tar.gz: 3769a359d104c320094b44a33b4145caa7d36cf4b96b5054d6df452325973ea0ec4efc3903ef180488bf112e90c3840fa94ca95f72ca2db97ac515a646d7e546
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
|
7
7
|
**Merged pull requests:**
|
8
8
|
|
9
|
+
- Correct find\_by\_business\_key\_and\_task\_definition\_key! [\#5](https://github.com/amalagaura/camunda-workflow/pull/5) ([amalagaura](https://github.com/amalagaura))
|
9
10
|
- added authentication via templates for spring\_boot generator and Her [\#4](https://github.com/amalagaura/camunda-workflow/pull/4) ([curatingbits](https://github.com/curatingbits))
|
10
11
|
- Refactor to return proper Her models after responses [\#3](https://github.com/amalagaura/camunda-workflow/pull/3) ([amalagaura](https://github.com/amalagaura))
|
11
12
|
- Added tests for Camunda workflow [\#2](https://github.com/amalagaura/camunda-workflow/pull/2) ([curatingbits](https://github.com/curatingbits))
|
@@ -17,11 +17,11 @@ class Camunda::ExternalTask < Camunda::Model
|
|
17
17
|
Camunda::Workflow.configuration.lock_duration.in_milliseconds
|
18
18
|
end
|
19
19
|
|
20
|
-
def failure(exception, input_variables)
|
21
|
-
variables_information = "Input variables are #{input_variables.inspect}\n\n"
|
20
|
+
def failure(exception, input_variables={})
|
21
|
+
variables_information = "Input variables are #{input_variables.inspect}\n\n" if input_variables.present?
|
22
22
|
self.class.post_raw("#{collection_path}/#{id}/failure",
|
23
23
|
workerId: worker_id, errorMessage: exception.message,
|
24
|
-
errorDetails: variables_information + exception.full_message)[:response]
|
24
|
+
errorDetails: variables_information.to_s + exception.full_message)[:response]
|
25
25
|
end
|
26
26
|
|
27
27
|
def bpmn_error(bpmn_exception)
|
@@ -33,6 +33,9 @@ class Camunda::ExternalTask < Camunda::Model
|
|
33
33
|
def complete(variables={})
|
34
34
|
self.class.post_raw("#{collection_path}/#{id}/complete",
|
35
35
|
workerId: worker_id, variables: serialize_variables(variables))[:response]
|
36
|
+
.tap do |response|
|
37
|
+
raise SubmissionError, response.body[:data][:message] unless response.success?
|
38
|
+
end
|
36
39
|
end
|
37
40
|
|
38
41
|
def worker_id
|
@@ -80,4 +83,7 @@ class Camunda::ExternalTask < Camunda::Model
|
|
80
83
|
raise Camunda::MissingImplementationClass, task_class_name unless klass
|
81
84
|
end
|
82
85
|
end
|
86
|
+
|
87
|
+
class SubmissionError < StandardError
|
88
|
+
end
|
83
89
|
end
|
@@ -7,6 +7,9 @@ module Camunda::ExternalTaskJob
|
|
7
7
|
report_completion id, output_variables
|
8
8
|
rescue Camunda::BpmnError => e
|
9
9
|
report_bpmn_error id, e
|
10
|
+
rescue Camunda::ExternalTask::SubmissionError => e
|
11
|
+
# We re-raise this so it is not rescued below
|
12
|
+
raise e
|
10
13
|
rescue StandardError => e
|
11
14
|
report_failure id, e, input_variables
|
12
15
|
end
|
data/lib/camunda/poller.rb
CHANGED
@@ -2,7 +2,11 @@ class Camunda::Poller
|
|
2
2
|
def self.fetch_and_execute(topics, lock_duration: nil, long_polling_duration: nil)
|
3
3
|
loop do
|
4
4
|
Camunda::ExternalTask
|
5
|
-
.fetch_and_lock(topics, lock_duration: lock_duration, long_polling_duration: long_polling_duration).each
|
5
|
+
.fetch_and_lock(topics, lock_duration: lock_duration, long_polling_duration: long_polling_duration).each do |task|
|
6
|
+
task.queue_task
|
7
|
+
rescue Camunda::MissingImplementationClass => e
|
8
|
+
task.failure(e)
|
9
|
+
end
|
6
10
|
end
|
7
11
|
end
|
8
12
|
end
|
data/lib/camunda/task.rb
CHANGED
@@ -14,10 +14,13 @@ class Camunda::Task < Camunda::Model
|
|
14
14
|
def complete!(vars={})
|
15
15
|
self.class.post_raw("#{self.class.collection_path}/#{id}/complete", variables: serialize_variables(vars))[:response]
|
16
16
|
.tap do |response|
|
17
|
-
raise
|
17
|
+
raise SubmissionError, response.body[:data][:message] unless response.success?
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
class MissingTask < StandardError
|
22
22
|
end
|
23
|
+
|
24
|
+
class SubmissionError < StandardError
|
25
|
+
end
|
23
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: camunda-workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ankur Sethi
|
@@ -129,14 +129,28 @@ dependencies:
|
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: 0.
|
132
|
+
version: '0.77'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: 0.
|
139
|
+
version: '0.77'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: rubocop-rspec
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - "~>"
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 1.37.0
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - "~>"
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 1.37.0
|
140
154
|
- !ruby/object:Gem::Dependency
|
141
155
|
name: simplecov
|
142
156
|
requirement: !ruby/object:Gem::Requirement
|