bumbleworks 0.0.86 → 0.0.87
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddb99ff7e81ef79f450c5888713b862a3dd85673
|
4
|
+
data.tar.gz: 5b3de42cac468a392998375432725b33d1bbf501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b91712d329d034b868e3aa1579d7b2a84ec4eab9bea15aea43e72ff1c9187ee3546d3c1e36d53d3f12c7095d246b8d592c3903126f9ca2b9b49057f0f3147f09
|
7
|
+
data.tar.gz: ff019980495f03d0c3622329cc8d3e9f3d7e516758b329ef49ac8ac287d2b3d462887179d39ccc59dc6003f2fc4afb06f6b89eb92ef2941c7816bb7f7f9efc12
|
data/lib/bumbleworks.rb
CHANGED
@@ -186,6 +186,18 @@ module Bumbleworks
|
|
186
186
|
Bumbleworks::Process.new(pid)
|
187
187
|
end
|
188
188
|
|
189
|
+
# @public
|
190
|
+
# Instantiates a new Bumbleworks::Process::ErrorRecord for each error
|
191
|
+
# in the Ruote storage.
|
192
|
+
#
|
193
|
+
def errors
|
194
|
+
Bumbleworks.dashboard.context.storage.get_many('errors').map { |err|
|
195
|
+
Bumbleworks::Process::ErrorRecord.new(
|
196
|
+
::Ruote::ProcessError.new(err)
|
197
|
+
)
|
198
|
+
}
|
199
|
+
end
|
200
|
+
|
189
201
|
private
|
190
202
|
|
191
203
|
def extract_entity_from_fields!(fields)
|
@@ -3,6 +3,9 @@ module Bumbleworks
|
|
3
3
|
class ErrorRecord
|
4
4
|
attr_reader :process_error
|
5
5
|
|
6
|
+
extend Forwardable
|
7
|
+
delegate [:fei, :workitem, :wfid] => :process_error
|
8
|
+
|
6
9
|
# The initializer takes a Ruote::ProcessError instance.
|
7
10
|
def initialize(process_error)
|
8
11
|
@process_error = process_error
|
@@ -15,15 +18,14 @@ module Bumbleworks
|
|
15
18
|
Bumbleworks.dashboard.replay_at_error(@process_error)
|
16
19
|
end
|
17
20
|
|
18
|
-
# Returns the
|
19
|
-
def
|
20
|
-
|
21
|
+
# Returns the expression where this error occurred.
|
22
|
+
def expression
|
23
|
+
Bumbleworks::Expression.from_fei(fei)
|
21
24
|
end
|
22
25
|
|
23
|
-
# Returns the
|
24
|
-
|
25
|
-
|
26
|
-
@process_error.fei
|
26
|
+
# Returns the process in which this error occurred.
|
27
|
+
def process
|
28
|
+
Bumbleworks::Process.new(wfid)
|
27
29
|
end
|
28
30
|
|
29
31
|
# Returns the class name of the error that was actually raised
|
data/lib/bumbleworks/version.rb
CHANGED
@@ -49,6 +49,21 @@ describe Bumbleworks::Process::ErrorRecord do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
describe '#process' do
|
53
|
+
it 'returns the process in which the error occurred' do
|
54
|
+
expect(@error.process).to eq @process
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#expression' do
|
59
|
+
it 'returns the expression from when the error occurred' do
|
60
|
+
expression = @error.expression
|
61
|
+
expect(expression).to be_a(Bumbleworks::Expression)
|
62
|
+
expect(expression.process).to eq @process
|
63
|
+
expect(expression.expid).to eq '0_0'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
52
67
|
describe '#message' do
|
53
68
|
it 'returns the original error message' do
|
54
69
|
expect(@error.message).to eq 'Oh crumb.'
|
@@ -280,4 +280,29 @@ describe Bumbleworks do
|
|
280
280
|
expect(described_class.store_history?).to be_falsy
|
281
281
|
end
|
282
282
|
end
|
283
|
+
|
284
|
+
describe '.errors' do
|
285
|
+
it 'returns all errors as ErrorRecord instances' do
|
286
|
+
Bumbleworks.start_worker!
|
287
|
+
Bumbleworks.define_process 'error_process' do
|
288
|
+
concurrence do
|
289
|
+
error 'first error'
|
290
|
+
error 'second error'
|
291
|
+
end
|
292
|
+
end
|
293
|
+
bp1 = Bumbleworks.launch!('error_process')
|
294
|
+
bp2 = Bumbleworks.launch!('error_process')
|
295
|
+
Bumbleworks.dashboard.wait_for('error_intercepted')
|
296
|
+
errors = described_class.errors
|
297
|
+
expect(errors.map(&:class).uniq).to eq([
|
298
|
+
Bumbleworks::Process::ErrorRecord
|
299
|
+
])
|
300
|
+
expect(errors.map(&:message)).to match_array([
|
301
|
+
'first error',
|
302
|
+
'second error',
|
303
|
+
'first error',
|
304
|
+
'second error'
|
305
|
+
])
|
306
|
+
end
|
307
|
+
end
|
283
308
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bumbleworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.87
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maher Hawash
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-09-
|
14
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: ruote
|