bizflow 0.0.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.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +27 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +5 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +105 -0
  7. data/Rakefile +2 -0
  8. data/bin/bizflow +28 -0
  9. data/bizflow.gemspec +29 -0
  10. data/lib/bizflow/business_model/handler.rb +13 -0
  11. data/lib/bizflow/business_model/head.rb +34 -0
  12. data/lib/bizflow/business_model/input_action.rb +47 -0
  13. data/lib/bizflow/business_model/process.rb +46 -0
  14. data/lib/bizflow/business_model/simple_wrapper.rb +22 -0
  15. data/lib/bizflow/business_model/task.rb +41 -0
  16. data/lib/bizflow/business_model/task_action.rb +36 -0
  17. data/lib/bizflow/command/build_command.rb +33 -0
  18. data/lib/bizflow/command/clean_command.rb +9 -0
  19. data/lib/bizflow/command/command_helper.rb +19 -0
  20. data/lib/bizflow/command/help_command.rb +11 -0
  21. data/lib/bizflow/command/install_command.rb +16 -0
  22. data/lib/bizflow/command/setup_command.rb +29 -0
  23. data/lib/bizflow/config_generator.rb +16 -0
  24. data/lib/bizflow/data_model/action.rb +22 -0
  25. data/lib/bizflow/data_model/action_blueprint.rb +22 -0
  26. data/lib/bizflow/data_model/handler.rb +16 -0
  27. data/lib/bizflow/data_model/handler_blueprint.rb +17 -0
  28. data/lib/bizflow/data_model/head.rb +16 -0
  29. data/lib/bizflow/data_model/next_action.rb +17 -0
  30. data/lib/bizflow/data_model/next_action_blueprint.rb +17 -0
  31. data/lib/bizflow/data_model/process.rb +31 -0
  32. data/lib/bizflow/data_model/process_blueprint.rb +17 -0
  33. data/lib/bizflow/data_model/task.rb +17 -0
  34. data/lib/bizflow/data_model/task_blueprint.rb +17 -0
  35. data/lib/bizflow/fakes/action.rb +23 -0
  36. data/lib/bizflow/fakes/action_blueprint.rb +24 -0
  37. data/lib/bizflow/fakes/handler.rb +15 -0
  38. data/lib/bizflow/fakes/handler_blueprint.rb +18 -0
  39. data/lib/bizflow/fakes/head.rb +14 -0
  40. data/lib/bizflow/fakes/process.rb +20 -0
  41. data/lib/bizflow/fakes/process_blueprint.rb +14 -0
  42. data/lib/bizflow/fakes/task.rb +16 -0
  43. data/lib/bizflow/fakes/task_blueprint.rb +19 -0
  44. data/lib/bizflow/interpreters/domain_interpreter.rb +19 -0
  45. data/lib/bizflow/interpreters/input_action_interpreter.rb +35 -0
  46. data/lib/bizflow/interpreters/process_interpreter.rb +37 -0
  47. data/lib/bizflow/interpreters/task_action_interpreter.rb +29 -0
  48. data/lib/bizflow/lib/blueprint_builder.rb +90 -0
  49. data/lib/bizflow/lib/callback_handler.rb +27 -0
  50. data/lib/bizflow/lib/callbackable.rb +25 -0
  51. data/lib/bizflow/lib/process_builder.rb +61 -0
  52. data/lib/bizflow/lib/semantic_builder.rb +36 -0
  53. data/lib/bizflow/migrations/001_create_processes.rb +21 -0
  54. data/lib/bizflow/migrations/002_create_actions.rb +17 -0
  55. data/lib/bizflow/migrations/003_create_process_heads.rb +15 -0
  56. data/lib/bizflow/migrations/004_create_tasks.rb +16 -0
  57. data/lib/bizflow/migrations/005_create_process_blueprints.rb +14 -0
  58. data/lib/bizflow/migrations/006_action_blueprints.rb +16 -0
  59. data/lib/bizflow/migrations/007_next_action_blueprints.rb +14 -0
  60. data/lib/bizflow/migrations/008_handler_blueprints.rb +15 -0
  61. data/lib/bizflow/migrations/009_task_blueprints.rb +16 -0
  62. data/lib/bizflow/migrations/010_create_handlers.rb +16 -0
  63. data/lib/bizflow/migrations/011_next_actions.rb +14 -0
  64. data/lib/bizflow/monkey_patch.rb +12 -0
  65. data/lib/bizflow/repos/repo.rb +21 -0
  66. data/lib/bizflow/semantic_model/action.rb +29 -0
  67. data/lib/bizflow/semantic_model/domain_repo.rb +19 -0
  68. data/lib/bizflow/semantic_model/handler.rb +21 -0
  69. data/lib/bizflow/semantic_model/input_action.rb +19 -0
  70. data/lib/bizflow/semantic_model/process.rb +29 -0
  71. data/lib/bizflow/semantic_model/task.rb +18 -0
  72. data/lib/bizflow/semantic_model/task_action.rb +26 -0
  73. data/lib/bizflow/source_generator.rb +62 -0
  74. data/lib/bizflow/source_presenters/process_template_presenter.rb +26 -0
  75. data/lib/bizflow/templates/js/descriptor.tt +9 -0
  76. data/lib/bizflow/templates/js/process.tt +41 -0
  77. data/lib/bizflow/templates/rb/config.tt +11 -0
  78. data/lib/bizflow/templates/rb/handler.tt +4 -0
  79. data/lib/bizflow/templates/rb/process.tt +53 -0
  80. data/lib/bizflow/version.rb +3 -0
  81. data/lib/bizflow.rb +15 -0
  82. data/spec/factories/factories.rb +38 -0
  83. data/spec/spec_config.rb +42 -0
  84. data/spec/spec_helper.rb +89 -0
  85. data/spec/unit/business/business_process_spec.rb +203 -0
  86. data/spec/unit/business/process_alternative_spec.rb +77 -0
  87. data/spec/unit/command/build_order_spec.rb +44 -0
  88. data/spec/unit/command/build_spec.rb +44 -0
  89. data/spec/unit/creating_processes_spec.rb +59 -0
  90. data/spec/unit/dsl_scripts/breakfast/process_file.rb +50 -0
  91. data/spec/unit/dsl_scripts/order/order.rb +41 -0
  92. data/spec/unit/interpreters/interpreters_spec.rb +105 -0
  93. data/text/Master.odt +0 -0
  94. data/text/prezentacija.odp +0 -0
  95. data/text/zbornik.doc +0 -0
  96. metadata +248 -0
@@ -0,0 +1,105 @@
1
+ require "bizflow/semantic_model/domain_repo"
2
+ require "bizflow/lib/semantic_builder"
3
+
4
+ describe Bizflow::Lib::SemanticBuilder, interpreter: true do
5
+
6
+ before :each do
7
+ @repo = Bizflow::SemanticModel::DomainRepo.new
8
+ @builder = Bizflow::Lib::SemanticBuilder.new(File.expand_path("#{File.dirname(__FILE__)}/../dsl_scripts/breakfast"))
9
+ @builder.repo = @repo
10
+ end
11
+
12
+ it "fills the semantic repo with processes while building the semantic model" do
13
+
14
+ @builder.build
15
+ expect(@repo.processes.count).to eq(1)
16
+
17
+ process = @repo.processes[0]
18
+
19
+ expect(process.name).to eq("make_breakfast")
20
+ expect(process.description).to eq("creates breakfast")
21
+ expect(process.start).to eq("check_supplies")
22
+
23
+ end
24
+
25
+ it "fills the semantic repo with actions" do
26
+
27
+ @builder.build
28
+ process = @repo.processes[0]
29
+ actions = process.actions
30
+
31
+ expect(actions.count).to eq 4
32
+
33
+ # name
34
+ expect(actions.map(&:name)).to eq(["check_supplies", "get_supplies", "make_breakfast", "serve_breakfast"])
35
+ expect(actions.map(&:type)).to eq(["input", "task", "task", "task"])
36
+
37
+ # descritpion
38
+ expect(actions.map(&:description)).to eq([
39
+ "checks if there are enaugh eggs, bacon and bread",
40
+ "get enaugh eggs, bacon and bread",
41
+ "sets stove, fry eggs, roast bacon",
42
+ nil
43
+ ])
44
+
45
+ expect(actions.map(&:question)).to eq([
46
+ "Are there enaugh supplies?",
47
+ nil,
48
+ nil,
49
+ nil
50
+ ])
51
+
52
+ input_actions = actions.select { |a| a.type == "input"}.first
53
+ expect(input_actions.next_actions).to eq(
54
+ not_enaugh_supplies: "get_supplies",
55
+ enaugh_supplies: "make_breakfast"
56
+ )
57
+
58
+ task_action_next_actions = actions.select { |a| a.type == "task"}.map(&:next_action)
59
+ expect(task_action_next_actions).to eq ["make_breakfast", "serve_breakfast", "process:finish"]
60
+
61
+ end
62
+
63
+ it "fills the semantic repo with tasks" do
64
+
65
+ @builder.build
66
+ process = @repo.processes[0]
67
+ actions = process.actions
68
+ tasks = actions.select { |a| a.type == "task" }.map(&:tasks).flatten
69
+
70
+ expect(tasks.count).to eq(6)
71
+
72
+ expect(tasks.map(&:name)).to eq(["get_bacon", "get_eggs", "get_bread", "make_breakfast", "prepare_table", "slice_bread"])
73
+
74
+ expect(tasks.map(&:description)).to eq([
75
+ "optional description",
76
+ nil,
77
+ nil,
78
+ nil,
79
+ nil,
80
+ nil
81
+ ])
82
+
83
+ expect(tasks.map(&:auto_assign)).to eq([
84
+ true,
85
+ false,
86
+ false,
87
+ false,
88
+ false,
89
+ false
90
+ ])
91
+
92
+ expect(tasks.map {|t| [t.name, t.roles]}).to eq([
93
+ ["get_bacon", ["storage", "kitchen"]],
94
+ ["get_eggs", ["storage", "kitchen"]],
95
+ ["get_bread", ["storage"]],
96
+ ["make_breakfast", ["kitchen"]],
97
+ ["prepare_table", ["servers"]],
98
+ ["slice_bread", ["kitchen"]]
99
+ ])
100
+
101
+ end
102
+
103
+
104
+
105
+ end
data/text/Master.odt ADDED
Binary file
Binary file
data/text/zbornik.doc ADDED
Binary file
metadata ADDED
@@ -0,0 +1,248 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bizflow
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - DSljukic
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sqlite3
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.3.10
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.3.10
27
+ - !ruby/object:Gem::Dependency
28
+ name: sequel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: factory_girl
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: database_cleaner
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: DSL for buisness processes.
112
+ email:
113
+ - uraniumsheep@gmail.com
114
+ executables:
115
+ - bizflow
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - ".gitignore"
120
+ - ".rspec"
121
+ - Gemfile
122
+ - LICENSE.txt
123
+ - README.md
124
+ - Rakefile
125
+ - bin/bizflow
126
+ - bizflow.gemspec
127
+ - lib/bizflow.rb
128
+ - lib/bizflow/business_model/handler.rb
129
+ - lib/bizflow/business_model/head.rb
130
+ - lib/bizflow/business_model/input_action.rb
131
+ - lib/bizflow/business_model/process.rb
132
+ - lib/bizflow/business_model/simple_wrapper.rb
133
+ - lib/bizflow/business_model/task.rb
134
+ - lib/bizflow/business_model/task_action.rb
135
+ - lib/bizflow/command/build_command.rb
136
+ - lib/bizflow/command/clean_command.rb
137
+ - lib/bizflow/command/command_helper.rb
138
+ - lib/bizflow/command/help_command.rb
139
+ - lib/bizflow/command/install_command.rb
140
+ - lib/bizflow/command/setup_command.rb
141
+ - lib/bizflow/config_generator.rb
142
+ - lib/bizflow/data_model/action.rb
143
+ - lib/bizflow/data_model/action_blueprint.rb
144
+ - lib/bizflow/data_model/handler.rb
145
+ - lib/bizflow/data_model/handler_blueprint.rb
146
+ - lib/bizflow/data_model/head.rb
147
+ - lib/bizflow/data_model/next_action.rb
148
+ - lib/bizflow/data_model/next_action_blueprint.rb
149
+ - lib/bizflow/data_model/process.rb
150
+ - lib/bizflow/data_model/process_blueprint.rb
151
+ - lib/bizflow/data_model/task.rb
152
+ - lib/bizflow/data_model/task_blueprint.rb
153
+ - lib/bizflow/fakes/action.rb
154
+ - lib/bizflow/fakes/action_blueprint.rb
155
+ - lib/bizflow/fakes/handler.rb
156
+ - lib/bizflow/fakes/handler_blueprint.rb
157
+ - lib/bizflow/fakes/head.rb
158
+ - lib/bizflow/fakes/process.rb
159
+ - lib/bizflow/fakes/process_blueprint.rb
160
+ - lib/bizflow/fakes/task.rb
161
+ - lib/bizflow/fakes/task_blueprint.rb
162
+ - lib/bizflow/interpreters/domain_interpreter.rb
163
+ - lib/bizflow/interpreters/input_action_interpreter.rb
164
+ - lib/bizflow/interpreters/process_interpreter.rb
165
+ - lib/bizflow/interpreters/task_action_interpreter.rb
166
+ - lib/bizflow/lib/blueprint_builder.rb
167
+ - lib/bizflow/lib/callback_handler.rb
168
+ - lib/bizflow/lib/callbackable.rb
169
+ - lib/bizflow/lib/process_builder.rb
170
+ - lib/bizflow/lib/semantic_builder.rb
171
+ - lib/bizflow/migrations/001_create_processes.rb
172
+ - lib/bizflow/migrations/002_create_actions.rb
173
+ - lib/bizflow/migrations/003_create_process_heads.rb
174
+ - lib/bizflow/migrations/004_create_tasks.rb
175
+ - lib/bizflow/migrations/005_create_process_blueprints.rb
176
+ - lib/bizflow/migrations/006_action_blueprints.rb
177
+ - lib/bizflow/migrations/007_next_action_blueprints.rb
178
+ - lib/bizflow/migrations/008_handler_blueprints.rb
179
+ - lib/bizflow/migrations/009_task_blueprints.rb
180
+ - lib/bizflow/migrations/010_create_handlers.rb
181
+ - lib/bizflow/migrations/011_next_actions.rb
182
+ - lib/bizflow/monkey_patch.rb
183
+ - lib/bizflow/repos/repo.rb
184
+ - lib/bizflow/semantic_model/action.rb
185
+ - lib/bizflow/semantic_model/domain_repo.rb
186
+ - lib/bizflow/semantic_model/handler.rb
187
+ - lib/bizflow/semantic_model/input_action.rb
188
+ - lib/bizflow/semantic_model/process.rb
189
+ - lib/bizflow/semantic_model/task.rb
190
+ - lib/bizflow/semantic_model/task_action.rb
191
+ - lib/bizflow/source_generator.rb
192
+ - lib/bizflow/source_presenters/process_template_presenter.rb
193
+ - lib/bizflow/templates/js/descriptor.tt
194
+ - lib/bizflow/templates/js/process.tt
195
+ - lib/bizflow/templates/rb/config.tt
196
+ - lib/bizflow/templates/rb/handler.tt
197
+ - lib/bizflow/templates/rb/process.tt
198
+ - lib/bizflow/version.rb
199
+ - spec/factories/factories.rb
200
+ - spec/spec_config.rb
201
+ - spec/spec_helper.rb
202
+ - spec/unit/business/business_process_spec.rb
203
+ - spec/unit/business/process_alternative_spec.rb
204
+ - spec/unit/command/build_order_spec.rb
205
+ - spec/unit/command/build_spec.rb
206
+ - spec/unit/creating_processes_spec.rb
207
+ - spec/unit/dsl_scripts/breakfast/process_file.rb
208
+ - spec/unit/dsl_scripts/order/order.rb
209
+ - spec/unit/interpreters/interpreters_spec.rb
210
+ - text/Master.odt
211
+ - text/prezentacija.odp
212
+ - text/zbornik.doc
213
+ homepage: ''
214
+ licenses:
215
+ - MIT
216
+ metadata: {}
217
+ post_install_message:
218
+ rdoc_options: []
219
+ require_paths:
220
+ - lib
221
+ required_ruby_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: '0'
226
+ required_rubygems_version: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ requirements: []
232
+ rubyforge_project:
233
+ rubygems_version: 2.4.5
234
+ signing_key:
235
+ specification_version: 4
236
+ summary: DSL for business processes.
237
+ test_files:
238
+ - spec/factories/factories.rb
239
+ - spec/spec_config.rb
240
+ - spec/spec_helper.rb
241
+ - spec/unit/business/business_process_spec.rb
242
+ - spec/unit/business/process_alternative_spec.rb
243
+ - spec/unit/command/build_order_spec.rb
244
+ - spec/unit/command/build_spec.rb
245
+ - spec/unit/creating_processes_spec.rb
246
+ - spec/unit/dsl_scripts/breakfast/process_file.rb
247
+ - spec/unit/dsl_scripts/order/order.rb
248
+ - spec/unit/interpreters/interpreters_spec.rb