rails_workflow 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/concerns/rails_workflow/operation_status.rb +2 -50
- data/app/concerns/rails_workflow/operation_templates/default_builder.rb +14 -0
- data/app/concerns/rails_workflow/operation_templates/dependencies.rb +7 -8
- data/app/concerns/rails_workflow/operations/default_runner.rb +19 -6
- data/app/concerns/rails_workflow/operations/dependencies.rb +12 -12
- data/app/concerns/rails_workflow/processes/default_runner.rb +1 -1
- data/app/concerns/rails_workflow/processes/dependency_resolver.rb +12 -17
- data/app/concerns/rails_workflow/status.rb +63 -0
- data/app/concerns/rails_workflow/user/assignment.rb +11 -5
- data/app/controllers/rails_workflow/errors_controller.rb +1 -1
- data/app/controllers/rails_workflow/operation_templates_controller.rb +45 -34
- data/app/controllers/rails_workflow/operations_controller.rb +37 -31
- data/app/controllers/rails_workflow/process_templates_controller.rb +41 -14
- data/app/controllers/rails_workflow/processes_controller.rb +53 -32
- data/app/decorators/rails_workflow/context_decorator.rb +6 -1
- data/app/decorators/rails_workflow/operation_decorator.rb +7 -15
- data/app/decorators/rails_workflow/operation_template_decorator.rb +1 -1
- data/app/decorators/rails_workflow/process_decorator.rb +1 -2
- data/app/decorators/rails_workflow/status_decorator.rb +17 -18
- data/app/models/rails_workflow/error.rb +5 -3
- data/app/models/rails_workflow/operation_template.rb +11 -22
- data/app/models/rails_workflow/process.rb +1 -1
- data/app/views/application/_context.html.slim +11 -0
- data/app/views/rails_workflow/operation_templates/_default_form.html.slim +12 -6
- data/app/views/rails_workflow/operation_templates/_user_group_form.html.slim +10 -5
- data/app/views/rails_workflow/operation_templates/_user_role_form.html.slim +10 -5
- data/app/views/rails_workflow/operation_templates/edit.html.slim +10 -10
- data/app/views/rails_workflow/operation_templates/index.html.slim +9 -9
- data/app/views/rails_workflow/operation_templates/new.html.slim +10 -10
- data/app/views/rails_workflow/operation_templates/show.html.slim +12 -12
- data/app/views/rails_workflow/operations/index.html.slim +1 -1
- data/app/views/rails_workflow/operations/show.html.slim +24 -33
- data/app/views/rails_workflow/process_templates/_form.html.slim +3 -3
- data/app/views/rails_workflow/process_templates/edit.html.slim +5 -5
- data/app/views/rails_workflow/process_templates/index.html.slim +2 -2
- data/app/views/rails_workflow/process_templates/new.html.slim +2 -2
- data/app/views/rails_workflow/process_templates/show.html.slim +9 -9
- data/app/views/rails_workflow/processes/index.html.slim +2 -2
- data/app/views/rails_workflow/processes/show.html.slim +16 -25
- data/app/workers/rails_workflow/error_worker.rb +1 -8
- data/db/migrate/20150215164401_add_partial_name_to_context.rb +6 -0
- data/db/migrate/20150217161051_change_dependencies_to_json.rb +6 -0
- data/lib/generators/rails_workflow/install/templates/create_workflow_processes.rb +132 -99
- data/lib/rails_workflow/version.rb +1 -1
- data/lib/rails_workflow.rb +20 -8
- data/spec/controllers/rails_workflow/operation_templates_controller_spec.rb +1 -2
- data/spec/controllers/rails_workflow/operations_controller_spec.rb +0 -1
- data/spec/controllers/rails_workflow/process_templates_controller_spec.rb +0 -1
- data/spec/controllers/rails_workflow/processes_controller_spec.rb +0 -1
- data/spec/core/rails_workflow/process_manager_spec.rb +17 -1
- data/spec/dummy/app/controllers/application_controller.rb +7 -1
- data/spec/dummy/app/models/user.rb +5 -5
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/{database.sample.yml → database.yml.sample} +0 -0
- data/spec/dummy/config/database.yml.semaphore +16 -0
- data/spec/dummy/config/routes.rb +0 -1
- data/spec/dummy/db/schema.rb +14 -12
- data/spec/dummy/log/development.log +23189 -0
- data/spec/dummy/log/test.log +86228 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0e4b210a8dc7adf45911c7c4ba8f7420 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1616e4e42ff5363173d1d39e6e2a03d4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/22bb4a1009f389151658be54233630d8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/310eee609d7bb0cabf2f8e68b83998b6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/31922eca362eb4de37a5021cccef630d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4de81d9fc089c3a5ba8d42b0056a9865 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5a73175a9ff8699c8927d3a0a876d868 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/68446d3bc756b2b4ac2b1844f17db53b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6a733df9ba21863060bf032f05171bfa +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8227b2b943e2ea911b543eb82228c432 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/94b7a81dd8f8ff07304196359c39ab38 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/94d08b6a05042055bc46262852b983ce +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/96232456037b81cdd1370e99ec2dcc02 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9a2014c7524f2e0958daed330fb0e02e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9b7130a48df56ce8511f3fd6ef903c95 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a2fe1c22fbe6c6a7cb9b8f02a6acf646 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ab0c70eaae03da94a23f832513ff652b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ab2060acff429fdb2590db736072bc0c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b1add619756a502780e48fb4677d62d4 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b60aa6e3697ec580ac86be62a6f625f6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c36f232ed7926598f96095a8cc300c3e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ca09843ddbf5238fe84bc305118283ba +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cb0e266c16c56852a172fc789b601cba +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cb6ceea5ffc8a15e06b98ee6e1312290 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d0897c7c9960a927f82986088379f93e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d46bdc6254b6d822735475e06f2e7100 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d8f3150c250e5b7c730f1c8b883bf033 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e4ffa3e3b8053576aae12c9bdb64a075 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e9f705ee81f399edce42ea0b96f52f3b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/eda59a87268a2b4353ab0f5d8cf6bf97 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ef1957bb05e4fcd673c473e82a72e49a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f036d4fc72ce4649ae8186f985e60612 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f3664d9ecf05e354e7668dc11a76044a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f794c7b05987535f7000622afe6630d1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fc4a9cfb03faaeb5136786c085d7a289 +0 -0
- data/spec/models/rails_workflow/operation_spec.rb +11 -13
- data/spec/models/rails_workflow/operation_template_spec.rb +1 -1
- data/spec/rails_helper.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/support/controller_macros.rb +0 -7
- metadata +83 -18
- data/app/concerns/rails_workflow/process_status.rb +0 -66
- data/app/controllers/application_controller.rb +0 -3
- data/config/initializers/will_paginate.rb +0 -29
- data/spec/dummy/tmp/pids/server.pid +0 -1
@@ -3,32 +3,32 @@ ol.breadcrumb.alert-warning
|
|
3
3
|
li
|
4
4
|
= link_to "Configuration", process_templates_path
|
5
5
|
li
|
6
|
-
= link_to "Template: #{
|
6
|
+
= link_to "Template: #{@process_template.title}", process_template_path(@process_template)
|
7
7
|
li.active
|
8
|
-
= "Add #{
|
8
|
+
= "Add #{@operation_template.type_title}"
|
9
9
|
|
10
|
-
= render partial: "flash", locals: {notice: notice}
|
10
|
+
= render partial: "application/flash", locals: {notice: notice}
|
11
11
|
|
12
12
|
.row
|
13
13
|
.col-md-10
|
14
14
|
.panel
|
15
15
|
.panel-heading
|
16
16
|
h1.panel-title
|
17
|
-
= "Add #{
|
17
|
+
= "Add #{@operation_template.type_title}"
|
18
18
|
.panel-body
|
19
19
|
|
20
|
-
= form_for [
|
21
|
-
= render partial:
|
20
|
+
= form_for [@process_template, @operation_template], html: {class: "form-horizontal clearfix"} do |f|
|
21
|
+
= render partial: @operation_template.form, locals: {f: f}
|
22
22
|
.form-group
|
23
23
|
= f.label :dependencies, class: "control-label col-sm-2"
|
24
24
|
.col-sm-10
|
25
|
-
- if
|
25
|
+
- if @operation_template.other_operations.blank?
|
26
26
|
.checkbox
|
27
27
|
label
|
28
28
|
| There is no other operations in this process template.
|
29
29
|
|
30
|
-
-
|
31
|
-
- matched_dependency =
|
30
|
+
- @operation_template.other_operations.each_with_index do |depends_on, index|
|
31
|
+
- matched_dependency = @operation_template.dependencies.detect { |d| d['id'] == depends_on.id }
|
32
32
|
.panel.panel-warning
|
33
33
|
.panel-heading
|
34
34
|
.checkbox
|
@@ -45,7 +45,7 @@ ol.breadcrumb.alert-warning
|
|
45
45
|
= check_box "operation_template[dependencies][#{index}]", "statuses", {multiple: true, checked: status_matched}, status[0].to_s, nil
|
46
46
|
= status[1]
|
47
47
|
.btn-toolbar.pull-right
|
48
|
-
= link_to 'Back', process_template_operation_templates_path(
|
48
|
+
= link_to 'Back', process_template_operation_templates_path(@process_template), class: "btn btn-default"
|
49
49
|
= f.submit value: 'Save', class: "btn btn-success"
|
50
50
|
|
51
51
|
|
@@ -2,39 +2,39 @@ ol.breadcrumb.alert-warning
|
|
2
2
|
li
|
3
3
|
= link_to "Configuration", process_templates_path
|
4
4
|
li
|
5
|
-
= link_to "Template: #{
|
5
|
+
= link_to "Template: #{@process_template.title}", process_template_path(@process_template)
|
6
6
|
li.active
|
7
|
-
= "Operation Template: #{
|
8
|
-
= render partial: "flash", locals: { notice: notice }
|
7
|
+
= "Operation Template: #{@operation_template.title}"
|
8
|
+
= render partial: "application/flash", locals: { notice: notice }
|
9
9
|
|
10
10
|
.row
|
11
11
|
.col-md-10
|
12
12
|
.panel
|
13
13
|
.panel-heading
|
14
14
|
h1.panel-title
|
15
|
-
= "Operation: #{
|
15
|
+
= "Operation: #{@operation_template.title}"
|
16
16
|
.panel-body
|
17
17
|
table.table.table-striped.table-hover
|
18
18
|
tr
|
19
19
|
td Operation Class
|
20
|
-
td =
|
20
|
+
td = @operation_template.operation_class
|
21
21
|
tr
|
22
22
|
td Operation Template Class
|
23
|
-
td =
|
23
|
+
td = @operation_template.type
|
24
24
|
|
25
|
-
- if
|
25
|
+
- if @operation_template.assignment.present?
|
26
26
|
tr
|
27
27
|
td Assigned To
|
28
|
-
td =
|
28
|
+
td = @operation_template.assignment
|
29
29
|
|
30
30
|
|
31
31
|
tr
|
32
32
|
td Asynchronous
|
33
|
-
td =
|
33
|
+
td = @operation_template.async_text
|
34
34
|
|
35
35
|
tr
|
36
36
|
td Background:
|
37
|
-
td =
|
37
|
+
td = @operation_template.is_background_text
|
38
38
|
|
39
39
|
|
40
40
|
.panel
|
@@ -42,7 +42,7 @@ ol.breadcrumb.alert-warning
|
|
42
42
|
h1.panel-title Dependencies
|
43
43
|
.panel-body
|
44
44
|
table.table.table-striped.table-hover
|
45
|
-
-
|
45
|
+
- @operation_template.show_dependencies.each do |dependency|
|
46
46
|
tr
|
47
47
|
td
|
48
48
|
= dependency.shift
|
@@ -51,5 +51,5 @@ ol.breadcrumb.alert-warning
|
|
51
51
|
span.label.label-default< = dependency_status
|
52
52
|
.col-md-2
|
53
53
|
.btn-toolbar
|
54
|
-
= link_to 'Edit', edit_process_template_operation_template_path(
|
54
|
+
= link_to 'Edit', edit_process_template_operation_template_path(@process_template, @operation_template), class: "btn btn-primary"
|
55
55
|
|
@@ -1,24 +1,24 @@
|
|
1
1
|
ruby:
|
2
|
-
child_process =
|
2
|
+
child_process = @operation.child_process
|
3
3
|
|
4
4
|
ol.breadcrumb.alert-warning
|
5
5
|
li
|
6
6
|
= link_to "Processes", processes_path
|
7
7
|
li
|
8
|
-
= link_to "Process: #{
|
8
|
+
= link_to "Process: #{@operation.process.title}", @operation.process
|
9
9
|
li.active
|
10
|
-
= "Operation: #{
|
10
|
+
= "Operation: #{@operation.title} "
|
11
11
|
|
12
|
-
= render partial: "flash", locals: { notice: notice }
|
12
|
+
= render partial: "application/flash", locals: { notice: notice }
|
13
13
|
|
14
14
|
.row
|
15
15
|
.col-md-10
|
16
16
|
.panel
|
17
17
|
.panel-heading
|
18
18
|
h1.panel-title
|
19
|
-
= "Operation: #{
|
20
|
-
span.label.more-info-label class=(
|
21
|
-
=
|
19
|
+
= "Operation: #{@operation.title} "
|
20
|
+
span.label.more-info-label class=(@operation.status[:class])
|
21
|
+
= @operation.status[:text]
|
22
22
|
.panel-body
|
23
23
|
.col-md-6
|
24
24
|
table.table.table-striped.table-hover
|
@@ -26,21 +26,21 @@ ol.breadcrumb.alert-warning
|
|
26
26
|
|
27
27
|
tr
|
28
28
|
td Created At
|
29
|
-
td =
|
29
|
+
td = @operation.created_at
|
30
30
|
|
31
31
|
tr
|
32
32
|
td Completed At
|
33
|
-
td =
|
33
|
+
td = @operation.completed_at
|
34
34
|
|
35
|
-
- if
|
35
|
+
- if @operation.assigned_to.present?
|
36
36
|
tr
|
37
37
|
td Assigned To
|
38
|
-
td =
|
38
|
+
td = @operation.assigned_to
|
39
39
|
tr
|
40
40
|
td Operation Template
|
41
|
-
td = link_to
|
42
|
-
process_template_operation_template_path(
|
43
|
-
|
41
|
+
td = link_to @operation.template.title,
|
42
|
+
process_template_operation_template_path(@operation.template.process_template,
|
43
|
+
@operation.template)
|
44
44
|
|
45
45
|
- if child_process.present?
|
46
46
|
tr
|
@@ -52,16 +52,16 @@ ol.breadcrumb.alert-warning
|
|
52
52
|
= child_process.status[:text]
|
53
53
|
tr
|
54
54
|
td Asynchronous
|
55
|
-
td =
|
55
|
+
td = @operation.async
|
56
56
|
|
57
57
|
tr
|
58
58
|
td Background
|
59
|
-
td =
|
59
|
+
td = @operation.is_background
|
60
60
|
|
61
61
|
|
62
62
|
.col-md-6
|
63
63
|
|
64
|
-
- if
|
64
|
+
- if @operation.show_dependencies.empty?
|
65
65
|
.col-md-12
|
66
66
|
strong
|
67
67
|
| No dependencies
|
@@ -71,7 +71,7 @@ ol.breadcrumb.alert-warning
|
|
71
71
|
tr
|
72
72
|
td
|
73
73
|
strong Satisfied Dependencies
|
74
|
-
-
|
74
|
+
- @operation.show_dependencies.each do |dependency|
|
75
75
|
tr
|
76
76
|
td
|
77
77
|
= link_to process_operation_path(dependency.process, dependency)
|
@@ -83,7 +83,7 @@ ol.breadcrumb.alert-warning
|
|
83
83
|
tr
|
84
84
|
td
|
85
85
|
strong Template Dependencies
|
86
|
-
-
|
86
|
+
- @operation.show_template_dependencies.each do |dependency|
|
87
87
|
tr
|
88
88
|
td
|
89
89
|
= dependency.shift
|
@@ -96,7 +96,7 @@ ol.breadcrumb.alert-warning
|
|
96
96
|
.btn-toolbar
|
97
97
|
ul.nav.nav-pills
|
98
98
|
li role="presentation" class="active"
|
99
|
-
= link_to "Back to Process", process_path(
|
99
|
+
= link_to "Back to Process", process_path(@operation.process)
|
100
100
|
|
101
101
|
|
102
102
|
.row
|
@@ -105,19 +105,10 @@ ol.breadcrumb.alert-warning
|
|
105
105
|
.panel-heading
|
106
106
|
h1.panel-title Operation Context
|
107
107
|
.panel-body
|
108
|
-
|
109
|
-
thead
|
110
|
-
tr
|
111
|
-
th Key
|
112
|
-
th Value
|
113
|
-
tbody
|
114
|
-
- resource.context.each_pair do |key, value|
|
115
|
-
tr
|
116
|
-
td = key
|
117
|
-
td = value
|
108
|
+
= render @operation.context.partial_name, { context: @operation.context }
|
118
109
|
|
119
|
-
- if
|
120
|
-
-
|
110
|
+
- if @operation.workflow_errors.unresolved.present?
|
111
|
+
- @operation.workflow_errors.unresolved.each do |error|
|
121
112
|
.row
|
122
113
|
.col-md-10
|
123
114
|
.panel
|
@@ -131,7 +122,7 @@ ol.breadcrumb.alert-warning
|
|
131
122
|
strong Created at
|
132
123
|
td
|
133
124
|
.pull-right
|
134
|
-
= button_to "Retry", retry_process_operation_error_path(
|
125
|
+
= button_to "Retry", retry_process_operation_error_path(@operation.process, @operation, error), class: "btn btn-warning", method: :put
|
135
126
|
= error.created_at
|
136
127
|
tr
|
137
128
|
td
|
@@ -1,8 +1,8 @@
|
|
1
|
-
- if
|
1
|
+
- if @process_template.errors.any?
|
2
2
|
#error_explanation
|
3
|
-
h2 = "#{pluralize(
|
3
|
+
h2 = "#{pluralize(@process_template.errors.count, "error")} prohibited this process template from being saved:"
|
4
4
|
ul
|
5
|
-
-
|
5
|
+
- @process_template.errors.full_messages.each do |message|
|
6
6
|
li = message
|
7
7
|
|
8
8
|
.form-group
|
@@ -1,21 +1,21 @@
|
|
1
|
-
= render partial: "flash", locals: {notice: notice}
|
1
|
+
= render partial: "application/flash", locals: {notice: notice}
|
2
2
|
|
3
3
|
ol.breadcrumb.alert-warning
|
4
4
|
li
|
5
5
|
= link_to "Configuration", process_templates_path
|
6
6
|
li.active
|
7
|
-
= "Template: #{
|
7
|
+
= "Template: #{@process_template.title}"
|
8
8
|
|
9
9
|
.row
|
10
10
|
.col-md-10
|
11
11
|
.panel
|
12
12
|
.panel-heading
|
13
13
|
h1.panel-title
|
14
|
-
= "Template: #{
|
14
|
+
= "Template: #{@process_template.title}"
|
15
15
|
.panel-body
|
16
|
-
= form_for
|
16
|
+
= form_for @process_template, html: { class: "form-horizontal clearfix" } do |f|
|
17
17
|
= render partial: 'form', locals: {f: f}
|
18
18
|
.btn-toolbar.pull-right
|
19
|
-
= link_to 'Show',
|
19
|
+
= link_to 'Show', @process_template, class: "btn btn-default"
|
20
20
|
= link_to 'Back', process_templates_path, class: "btn btn-default"
|
21
21
|
= f.submit value: 'Save', class: "btn btn-success"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
ol.breadcrumb.alert-warning
|
2
2
|
li.active Configuration
|
3
3
|
|
4
|
-
= render partial: "flash", locals: {notice: notice}
|
4
|
+
= render partial: "application/flash", locals: {notice: notice}
|
5
5
|
|
6
6
|
.row
|
7
7
|
.col-sm-10
|
@@ -21,7 +21,7 @@ ol.breadcrumb.alert-warning
|
|
21
21
|
th
|
22
22
|
|
23
23
|
tbody
|
24
|
-
-
|
24
|
+
- @process_templates.each do |process_template|
|
25
25
|
tr
|
26
26
|
td = link_to process_template.title, process_template_operation_templates_path(process_template)
|
27
27
|
td = process_template.manager_class
|
@@ -5,8 +5,8 @@
|
|
5
5
|
h1.panel-title
|
6
6
|
= "New Process Template"
|
7
7
|
.panel-body
|
8
|
-
= form_for
|
9
|
-
= render partial:
|
8
|
+
= form_for @process_template, html: {class: "form-horizontal clearfix"} do |f|
|
9
|
+
= render partial: @process_template.form, locals: {f: f}
|
10
10
|
.btn-toolbar.pull-right
|
11
11
|
= link_to 'Back', process_templates_path, class: "btn btn-default"
|
12
12
|
= f.submit value: 'Save', class: "btn btn-success"
|
@@ -1,16 +1,16 @@
|
|
1
1
|
|
2
2
|
ruby:
|
3
3
|
new_template_path = -> (type) do
|
4
|
-
new_process_template_operation_template_path(
|
4
|
+
new_process_template_operation_template_path(@process_template.id, operation_template: {kind: type} )
|
5
5
|
end
|
6
6
|
|
7
7
|
ol.breadcrumb.alert-warning
|
8
8
|
li
|
9
9
|
= link_to "Configuration", process_templates_path
|
10
10
|
li.active
|
11
|
-
= "Template: #{
|
11
|
+
= "Template: #{@process_template.title}"
|
12
12
|
|
13
|
-
= render partial: "flash", locals: { notice: notice }
|
13
|
+
= render partial: "application/flash", locals: { notice: notice }
|
14
14
|
|
15
15
|
.row
|
16
16
|
.col-sm-10
|
@@ -25,22 +25,22 @@ ol.breadcrumb.alert-warning
|
|
25
25
|
tr
|
26
26
|
td
|
27
27
|
strong Process manager
|
28
|
-
td =
|
28
|
+
td = @process_template.manager_class
|
29
29
|
|
30
30
|
tr
|
31
31
|
td
|
32
32
|
strong Process class
|
33
|
-
td =
|
33
|
+
td = @process_template.process_class
|
34
34
|
|
35
35
|
tr
|
36
36
|
td
|
37
37
|
strong Process Template class
|
38
|
-
td =
|
38
|
+
td = @process_template.type
|
39
39
|
|
40
40
|
.col-sm-2
|
41
41
|
.row
|
42
42
|
.btn-group
|
43
|
-
= button_to "Create Process", {controller: "processes", action: "create", process: {template_id:
|
43
|
+
= button_to "Create Process", {controller: "processes", action: "create", process: {template_id: @process_template.id}}, method: :post, class: "btn btn-lg btn-success"
|
44
44
|
br
|
45
45
|
br
|
46
46
|
.btn-group
|
@@ -55,9 +55,9 @@ ol.breadcrumb.alert-warning
|
|
55
55
|
br
|
56
56
|
br
|
57
57
|
.btn-group
|
58
|
-
= link_to 'Edit', edit_process_template_path(
|
58
|
+
= link_to 'Edit', edit_process_template_path(@process_template), class: "btn btn-primary"
|
59
59
|
br
|
60
60
|
br
|
61
61
|
.btn-group
|
62
|
-
= link_to 'Operations', process_template_operation_templates_path(
|
62
|
+
= link_to 'Operations', process_template_operation_templates_path(@process_template), class: "btn btn-primary"
|
63
63
|
|
@@ -36,7 +36,7 @@ ol.breadcrumb.alert-warning
|
|
36
36
|
th Created At
|
37
37
|
th Parent/Child
|
38
38
|
tbody
|
39
|
-
-
|
39
|
+
- @processes.each do |process|
|
40
40
|
tr
|
41
41
|
td = link_to process.title, process
|
42
42
|
td
|
@@ -56,7 +56,7 @@ ol.breadcrumb.alert-warning
|
|
56
56
|
= link_to child.title, child
|
57
57
|
span.label<> class=(child.status[:class])
|
58
58
|
= child.status[:text]
|
59
|
-
= will_paginate
|
59
|
+
= will_paginate @processes
|
60
60
|
|
61
61
|
.col-sm-4
|
62
62
|
|
@@ -1,23 +1,23 @@
|
|
1
1
|
ruby:
|
2
|
-
parent_operation =
|
2
|
+
parent_operation = @process.parent_operation
|
3
3
|
parent_process = parent_operation.process if parent_operation.present?
|
4
4
|
|
5
5
|
ol.breadcrumb.alert-warning
|
6
6
|
li
|
7
7
|
= link_to "Processes", processes_path
|
8
8
|
li.active
|
9
|
-
= "Process: #{
|
9
|
+
= "Process: #{@process.title}"
|
10
10
|
|
11
|
-
= render partial: "flash", locals: { notice: notice }
|
11
|
+
= render partial: "application/flash", locals: { notice: notice }
|
12
12
|
|
13
13
|
.row
|
14
14
|
.col-sm-8
|
15
15
|
.panel
|
16
16
|
.panel-heading
|
17
17
|
h1.panel-title
|
18
|
-
= "Process: #{
|
19
|
-
span.label class=(
|
20
|
-
=
|
18
|
+
= "Process: #{@process.title} "
|
19
|
+
span.label class=(@process.status[:class])
|
20
|
+
= @process.status[:text]
|
21
21
|
.panel-body
|
22
22
|
table.table.table-striped.table-hover
|
23
23
|
thead
|
@@ -30,9 +30,9 @@ ol.breadcrumb.alert-warning
|
|
30
30
|
|
31
31
|
|
32
32
|
tbody
|
33
|
-
-
|
33
|
+
- @process.operations.each do |operation|
|
34
34
|
tr
|
35
|
-
td = link_to operation.title, process_operation_path(
|
35
|
+
td = link_to operation.title, process_operation_path(@process, operation)
|
36
36
|
td
|
37
37
|
span.label class=(operation.status[:class])
|
38
38
|
= operation.status[:text]
|
@@ -52,9 +52,9 @@ ol.breadcrumb.alert-warning
|
|
52
52
|
th Operation Assignment
|
53
53
|
th Sub process
|
54
54
|
tbody
|
55
|
-
-
|
55
|
+
- @process.future_operations.each do |operation|
|
56
56
|
tr
|
57
|
-
td = link_to operation.title, process_template_operation_template_path(
|
57
|
+
td = link_to operation.title, process_template_operation_template_path(@process.template, operation)
|
58
58
|
td
|
59
59
|
ul.list-unstyled
|
60
60
|
- operation.show_dependencies.each do |dependency|
|
@@ -69,8 +69,8 @@ ol.breadcrumb.alert-warning
|
|
69
69
|
= operation.child_process.title
|
70
70
|
span.label.label-default<> = (operation.async || false) ? "async" : "sync"
|
71
71
|
|
72
|
-
- if
|
73
|
-
-
|
72
|
+
- if @process.workflow_errors.unresolved.present?
|
73
|
+
- @process.workflow_errors.unresolved.each do |error|
|
74
74
|
.panel
|
75
75
|
.panel-heading
|
76
76
|
h1.panel-title Error
|
@@ -82,7 +82,7 @@ ol.breadcrumb.alert-warning
|
|
82
82
|
strong Created at
|
83
83
|
td
|
84
84
|
.pull-right
|
85
|
-
= button_to "Retry", retry_process_error_path(
|
85
|
+
= button_to "Retry", retry_process_error_path(@process, error), class: "btn btn-warning", method: :put
|
86
86
|
|
87
87
|
= error.created_at
|
88
88
|
tr
|
@@ -102,12 +102,12 @@ ol.breadcrumb.alert-warning
|
|
102
102
|
td
|
103
103
|
strong Created at
|
104
104
|
td
|
105
|
-
=
|
105
|
+
= @process.created_at
|
106
106
|
tr
|
107
107
|
td
|
108
108
|
strong Process Template
|
109
109
|
td
|
110
|
-
= link_to
|
110
|
+
= link_to @process.template.title, process_template_path(@process.template)
|
111
111
|
|
112
112
|
- if parent_operation.present?
|
113
113
|
tr
|
@@ -122,13 +122,4 @@ ol.breadcrumb.alert-warning
|
|
122
122
|
.panel-heading
|
123
123
|
h1.panel-title Process Context
|
124
124
|
.panel-body
|
125
|
-
|
126
|
-
thead
|
127
|
-
tr
|
128
|
-
th Key
|
129
|
-
th Value
|
130
|
-
tbody
|
131
|
-
- resource.context.data.each_pair do |key, value|
|
132
|
-
tr
|
133
|
-
td = key
|
134
|
-
td = value
|
125
|
+
= render @process.context.partial_name, { context: @process.context }
|
@@ -4,14 +4,7 @@ module RailsWorkflow
|
|
4
4
|
|
5
5
|
def perform(parent_id, parent_class)
|
6
6
|
parent = parent_class.constantize.find(parent_id)
|
7
|
-
|
8
|
-
if parent.is_a? RailsWorkflow::Operation
|
9
|
-
parent.status = RailsWorkflow::Operation::ERROR
|
10
|
-
end
|
11
|
-
if parent.is_a? RailsWorkflow::Process
|
12
|
-
parent.status = RailsWorkflow::Process::ERROR
|
13
|
-
end
|
14
|
-
|
7
|
+
parent.status = parent.class::ERROR
|
15
8
|
parent.save
|
16
9
|
|
17
10
|
if parent.respond_to?(:parent_operation) &&
|
@@ -0,0 +1,6 @@
|
|
1
|
+
class ChangeDependenciesToJson < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
change_column :rails_workflow_operation_templates, :dependencies, 'JSON USING dependencies::JSON'
|
4
|
+
change_column :rails_workflow_operations, :dependencies, 'JSON USING dependencies::JSON'
|
5
|
+
end
|
6
|
+
end
|