ntswf 2.0.5 → 2.0.6

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.
@@ -47,6 +47,11 @@ module Ntswf
47
47
 
48
48
  protected
49
49
 
50
+ def activity_task_list
51
+ activity_task_lists[default_unit] or
52
+ raise "Missing activity task list configuration for default unit '#{default_unit}'"
53
+ end
54
+
50
55
  def process_single_task(activity_task)
51
56
  returned_hash = @task_callback.call(describe(activity_task)) if @task_callback
52
57
  process_returned_hash(activity_task, returned_hash)
data/lib/ntswf/base.rb CHANGED
@@ -10,6 +10,9 @@ module Ntswf
10
10
  # The task list names for activities as hash (see also *:unit*)
11
11
  # @option config [String] :decision_task_list The task list name for decisions
12
12
  # @option config [String] :domain The SWF domain name
13
+ # @option config [String] :execution_id_prefix
14
+ # (value of :unit) Workflow ID prefix
15
+ # (see {Client#start_execution}'s *:execution_id* for allowed values)
13
16
  # @option config [Numeric] :execution_version
14
17
  # Value allowing clients to reject future execution versions
15
18
  # @option config [String] :pidfile
@@ -45,7 +48,7 @@ module Ntswf
45
48
  end
46
49
 
47
50
  def workflow_name
48
- "#{default_unit}-workflow"
51
+ "#{execution_id_prefix}-workflow"
49
52
  end
50
53
 
51
54
  def workflow_version
@@ -64,14 +67,14 @@ module Ntswf
64
67
  @config.decision_task_list or raise "Missing decision task list configuration"
65
68
  end
66
69
 
67
- def activity_task_list
68
- activity_task_lists[default_unit] or raise "Missing activity task list configuration"
69
- end
70
-
71
70
  def default_unit
72
71
  @default_unit ||= @config.unit.to_s
73
72
  end
74
73
 
74
+ def execution_id_prefix
75
+ (@config.execution_id_prefix || default_unit).to_s
76
+ end
77
+
75
78
  def execution_version
76
79
  @config.execution_version
77
80
  end
@@ -104,7 +107,7 @@ module Ntswf
104
107
  protected
105
108
 
106
109
  def activity_name
107
- "#{default_unit}-activity"
110
+ "#{execution_id_prefix}-activity"
108
111
  end
109
112
 
110
113
  def announce(s)
data/lib/ntswf/client.rb CHANGED
@@ -63,10 +63,14 @@ module Ntswf
63
63
  tag_list: [options[:unit].to_s, options[:name].to_s],
64
64
  task_list: decision_task_list,
65
65
  task_start_to_close_timeout: 10 * 60,
66
- workflow_id: [activity_task_list, execution_id].join(separator),
66
+ workflow_id: workflow_id(execution_id_prefix, execution_id),
67
67
  )
68
68
  end
69
69
 
70
+ def workflow_id(prefix, suffix)
71
+ [prefix, suffix].join(separator)
72
+ end
73
+
70
74
  def execution_details(workflow_execution)
71
75
  {
72
76
  workflow_id: workflow_execution.workflow_id,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ntswf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-24 00:00:00.000000000 Z
12
+ date: 2014-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk