rules_engine 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +0 -0
- data/README.textile +12 -12
- data/VERSION +1 -1
- data/lib/rules_engine.rb +4 -18
- data/lib/rules_engine/cache.rb +1 -1
- data/lib/rules_engine/discovery.rb +14 -5
- data/lib/rules_engine/process/auditor.rb +62 -0
- data/lib/rules_engine/process/auditor/db_auditor.rb +48 -0
- data/lib/rules_engine/process/runner.rb +147 -0
- data/lib/rules_engine/process/runner/db_runner.rb +78 -0
- data/lib/rules_engine/publish/publisher.rb +53 -0
- data/lib/rules_engine/publish/publisher/db_publisher.rb +93 -0
- data/lib/rules_engine/rule.rb +6 -6
- data/lib/rules_engine/rule_outcome.rb +4 -4
- data/lib/rules_engine_view.rb +14 -0
- data/lib/rules_engine_view/boxes.rb +0 -0
- data/lib/rules_engine_view/buttons.rb +0 -0
- data/lib/rules_engine_view/defer.rb +19 -3
- data/lib/rules_engine_view/form_fields.rb +0 -0
- data/lib/rules_engine_view/model_loader.rb +6 -2
- data/lib/rules_engine_view/navigate.rb +1 -3
- data/rails_generators/manifests/rule_complex.rb +30 -0
- data/rails_generators/manifests/rule_complex.yml +24 -0
- data/rails_generators/manifests/rule_simple.rb +26 -0
- data/rails_generators/manifests/rule_simple.yml +21 -0
- data/rails_generators/manifests/rules_engine.rb +244 -276
- data/rails_generators/manifests/rules_engine.yml +37 -59
- data/rails_generators/rules_engine_generator.rb +16 -32
- data/rails_generators/templates/app/controllers/re_plan_workflow_rules_controller.rb +142 -0
- data/rails_generators/templates/app/controllers/re_plan_workflows_controller.rb +139 -0
- data/rails_generators/templates/app/controllers/re_plans_controller.rb +131 -0
- data/rails_generators/templates/app/controllers/re_processes_controller.rb +15 -0
- data/rails_generators/templates/app/controllers/re_publications_controller.rb +15 -0
- data/rails_generators/templates/app/controllers/{re_pipeline_rules_controller.rb → re_workflow_rules_controller.rb} +12 -12
- data/rails_generators/templates/app/controllers/re_workflows_controller.rb +96 -0
- data/rails_generators/templates/app/helpers/rules_engine_helper.rb +42 -0
- data/rails_generators/templates/app/models/re_plan.rb +126 -0
- data/rails_generators/templates/app/models/re_plan_workflow.rb +10 -0
- data/rails_generators/templates/app/models/re_rule.rb +47 -60
- data/rails_generators/templates/app/models/re_rule_expected_outcome.rb +3 -21
- data/rails_generators/templates/app/models/re_workflow.rb +61 -0
- data/rails_generators/templates/app/rules/{complex_rule.rb → rule_complex.rb} +30 -30
- data/rails_generators/templates/app/rules/{simple_rule.rb → rule_simple.rb} +13 -14
- data/rails_generators/templates/app/views/layouts/rules_engine.html.erb +6 -9
- data/rails_generators/templates/app/views/re_plan_workflow_rules/edit.html.erb +13 -0
- data/rails_generators/templates/app/views/re_plan_workflow_rules/edit.js.erb +9 -0
- data/rails_generators/templates/app/views/re_plan_workflow_rules/error.html.erb +12 -0
- data/rails_generators/templates/app/views/re_plan_workflow_rules/error.js.erb +7 -0
- data/rails_generators/templates/app/views/re_plan_workflow_rules/help.html.erb +12 -0
- data/rails_generators/templates/app/views/re_plan_workflow_rules/help.js.erb +4 -0
- data/rails_generators/templates/app/views/re_plan_workflow_rules/new.html.erb +16 -0
- data/rails_generators/templates/app/views/re_plan_workflow_rules/new.js.erb +10 -0
- data/rails_generators/templates/app/views/re_plan_workflow_rules/update.js.erb +19 -0
- data/rails_generators/templates/app/views/re_plan_workflows/change.html.erb +78 -0
- data/rails_generators/templates/app/views/re_plan_workflows/edit.html.erb +12 -0
- data/rails_generators/templates/app/views/re_plan_workflows/edit.js.erb +8 -0
- data/rails_generators/templates/app/views/re_plan_workflows/new.html.erb +12 -0
- data/rails_generators/templates/app/views/re_plan_workflows/new.js.erb +5 -0
- data/rails_generators/templates/app/views/re_plan_workflows/show.html.erb +70 -0
- data/rails_generators/templates/app/views/re_plan_workflows/update.js.erb +19 -0
- data/rails_generators/templates/app/views/re_plans/_change.html.erb +39 -0
- data/rails_generators/templates/app/views/re_plans/_edit.html.erb +20 -0
- data/rails_generators/templates/app/views/re_plans/_empty.html.erb +12 -0
- data/rails_generators/templates/app/views/re_plans/_index.html.erb +42 -0
- data/rails_generators/templates/app/views/re_plans/_menu.html.erb +26 -0
- data/rails_generators/templates/app/views/re_plans/_new.html.erb +18 -0
- data/rails_generators/templates/app/views/re_plans/_preview.html.erb +47 -0
- data/rails_generators/templates/app/views/re_plans/_show.html.erb +27 -0
- data/rails_generators/templates/app/views/re_plans/_workflow_change.html.erb +44 -0
- data/rails_generators/templates/app/views/re_plans/_workflow_preview.html.erb +24 -0
- data/rails_generators/templates/app/views/re_plans/_workflow_show.html.erb +32 -0
- data/rails_generators/templates/app/views/re_plans/change.html.erb +118 -0
- data/rails_generators/templates/app/views/re_plans/create.js.erb +9 -0
- data/rails_generators/templates/app/views/re_plans/edit.html.erb +11 -0
- data/rails_generators/templates/app/views/re_plans/edit.js.erb +8 -0
- data/rails_generators/templates/app/views/re_plans/index.html.erb +33 -0
- data/rails_generators/templates/app/views/re_plans/index.js.erb +18 -0
- data/rails_generators/templates/app/views/re_plans/new.html.erb +9 -0
- data/rails_generators/templates/app/views/re_plans/new.js.erb +5 -0
- data/rails_generators/templates/app/views/re_plans/preview.html.erb +6 -0
- data/rails_generators/templates/app/views/re_plans/preview.js.erb +4 -0
- data/rails_generators/templates/app/views/re_plans/re_process.html.erb +12 -0
- data/rails_generators/templates/app/views/re_plans/re_process.js.erb +4 -0
- data/rails_generators/templates/app/views/re_plans/show.html.erb +56 -0
- data/rails_generators/templates/app/views/{re_pipelines → re_plans}/template.html.erb +1 -1
- data/rails_generators/templates/app/views/re_plans/update.js.erb +15 -0
- data/rails_generators/templates/app/views/re_processes/_index_prepare.html.erb +12 -0
- data/rails_generators/templates/app/views/re_processes/_index_update.html.erb +20 -0
- data/rails_generators/templates/app/views/re_processes/_show.html.erb +30 -0
- data/rails_generators/templates/app/views/re_processes/index.html.erb +11 -0
- data/rails_generators/templates/app/views/re_processes/index.js.erb +4 -0
- data/rails_generators/templates/app/views/re_processes/show.html.erb +8 -0
- data/rails_generators/templates/app/views/re_processes/show.js.erb +4 -0
- data/rails_generators/templates/app/views/re_publications/_show_prepare.html.erb +14 -0
- data/rails_generators/templates/app/views/re_publications/_show_update.html.erb +16 -0
- data/rails_generators/templates/app/views/re_publications/show.html.erb +11 -0
- data/rails_generators/templates/app/views/re_publications/show.js.erb +4 -0
- data/rails_generators/templates/app/views/re_rule_definitions/rule_complex/_edit.html.erb +7 -0
- data/rails_generators/templates/app/views/re_rule_definitions/{complex_rule → rule_complex}/_help.html.erb +1 -1
- data/rails_generators/templates/app/views/re_rule_definitions/rule_complex/_new.html.erb +7 -0
- data/rails_generators/templates/app/views/re_rule_definitions/rule_complex/_script.html.erb +25 -0
- data/rails_generators/templates/app/views/re_rule_definitions/{complex_rule → rule_complex}/_title.html.erb +0 -0
- data/rails_generators/templates/app/views/re_rule_definitions/{complex_rule → rule_complex}/_word.html.erb +0 -0
- data/rails_generators/templates/app/views/re_rule_definitions/{complex_rule → rule_complex}/_words.html.erb +2 -2
- data/rails_generators/templates/app/views/re_rule_definitions/{complex_rule/_pipeline.html.erb → rule_complex/_workflow.html.erb} +5 -5
- data/rails_generators/templates/app/views/re_rule_definitions/rule_simple/_edit.html.erb +1 -0
- data/rails_generators/templates/app/views/re_rule_definitions/{simple_rule → rule_simple}/_form.html.erb +1 -1
- data/rails_generators/templates/app/views/re_rule_definitions/{simple_rule → rule_simple}/_help.html.erb +0 -0
- data/rails_generators/templates/app/views/re_rule_definitions/rule_simple/_new.html.erb +1 -0
- data/rails_generators/templates/app/views/re_workflow_rules/_edit.html.erb +19 -0
- data/rails_generators/templates/app/views/{re_pipeline_rules → re_workflow_rules}/_error.html.erb +0 -0
- data/rails_generators/templates/app/views/re_workflow_rules/_help.html.erb +15 -0
- data/rails_generators/templates/app/views/{re_pipeline_rules → re_workflow_rules}/_new.html.erb +6 -3
- data/rails_generators/templates/app/views/re_workflow_rules/edit.html.erb +13 -0
- data/rails_generators/templates/app/views/re_workflow_rules/edit.js.erb +9 -0
- data/rails_generators/templates/app/views/re_workflow_rules/error.html.erb +12 -0
- data/rails_generators/templates/app/views/re_workflow_rules/error.js.erb +7 -0
- data/rails_generators/templates/app/views/re_workflow_rules/help.html.erb +12 -0
- data/rails_generators/templates/app/views/re_workflow_rules/help.js.erb +4 -0
- data/rails_generators/templates/app/views/re_workflow_rules/new.html.erb +15 -0
- data/rails_generators/templates/app/views/{re_pipeline_rules → re_workflow_rules}/new.js.erb +1 -1
- data/rails_generators/templates/app/views/re_workflow_rules/update.js.erb +17 -0
- data/rails_generators/templates/app/views/re_workflows/_add_prepare.html.erb +15 -0
- data/rails_generators/templates/app/views/re_workflows/_add_update.html.erb +21 -0
- data/rails_generators/templates/app/views/re_workflows/_edit.html.erb +23 -0
- data/rails_generators/templates/app/views/re_workflows/_empty.html.erb +12 -0
- data/rails_generators/templates/app/views/re_workflows/_index.html.erb +41 -0
- data/rails_generators/templates/app/views/re_workflows/_menu.html.erb +92 -0
- data/rails_generators/templates/app/views/re_workflows/_new.html.erb +21 -0
- data/rails_generators/templates/app/views/re_workflows/_plan_prepare.html.erb +14 -0
- data/rails_generators/templates/app/views/re_workflows/_plan_update.html.erb +21 -0
- data/rails_generators/templates/app/views/re_workflows/_preview.html.erb +30 -0
- data/rails_generators/templates/app/views/re_workflows/_rule_change.html.erb +65 -0
- data/rails_generators/templates/app/views/re_workflows/_rule_empty.html.erb +13 -0
- data/rails_generators/templates/app/views/{re_pipeline_rules/_index.html.erb → re_workflows/_rule_preview.html.erb} +20 -11
- data/rails_generators/templates/app/views/re_workflows/_rule_show.html.erb +46 -0
- data/rails_generators/templates/app/views/re_workflows/_show.html.erb +24 -0
- data/rails_generators/templates/app/views/re_workflows/add.html.erb +11 -0
- data/rails_generators/templates/app/views/re_workflows/add.js.erb +6 -0
- data/rails_generators/templates/app/views/re_workflows/change.html.erb +53 -0
- data/rails_generators/templates/app/views/re_workflows/create.js.erb +9 -0
- data/rails_generators/templates/app/views/re_workflows/edit.html.erb +11 -0
- data/rails_generators/templates/app/views/re_workflows/edit.js.erb +8 -0
- data/rails_generators/templates/app/views/re_workflows/index.html.erb +34 -0
- data/rails_generators/templates/app/views/re_workflows/new.html.erb +9 -0
- data/rails_generators/templates/app/views/re_workflows/new.js.erb +5 -0
- data/rails_generators/templates/app/views/re_workflows/plan.html.erb +12 -0
- data/rails_generators/templates/app/views/re_workflows/plan.js.erb +4 -0
- data/rails_generators/templates/app/views/re_workflows/preview.html.erb +5 -0
- data/rails_generators/templates/app/views/re_workflows/preview.js.erb +4 -0
- data/rails_generators/templates/app/views/re_workflows/show.html.erb +47 -0
- data/rails_generators/templates/app/views/re_workflows/update.js.erb +17 -0
- data/rails_generators/templates/config/initializers/rules_engine.rb +9 -0
- data/rails_generators/templates/db/migrate/20100308225008_create_rules_engine.rb +113 -0
- data/rails_generators/templates/doc/README.rules_engine +113 -98
- data/rails_generators/templates/lib/tasks/rules_engine.rake +29 -10
- data/rails_generators/templates/public/javascripts/rules_engine/re_plan_change.js +85 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_plan_new.js +29 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_plan_preview.js +18 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_process_index.js +43 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_process_show.js +18 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_publication_show.js +39 -0
- data/rails_generators/templates/public/javascripts/{re_view.js → rules_engine/re_view.js} +19 -3
- data/rails_generators/templates/public/javascripts/rules_engine/re_workflow_add.js +124 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_workflow_change.js +185 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_workflow_new.js +29 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_workflow_plan.js +38 -0
- data/rails_generators/templates/public/javascripts/rules_engine/re_workflow_preview.js +18 -0
- data/rails_generators/templates/public/stylesheets/{re_view_box → rules_engine/images/re_view_box}/shadowbox.png +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_box → rules_engine/images/re_view_box}/whitebox.jpg +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/checked-off.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/checked-on.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/icon-add.png +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/icon-delete.png +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-blue-left.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-blue-right.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-gray-left.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-gray-right.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-green-left.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-green-right.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-orange-left.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-orange-right.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-red-left.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_button → rules_engine/images/re_view_button}/oval-red-right.gif +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_error → rules_engine/images/re_view_error}/re-alert-close.png +0 -0
- data/rails_generators/templates/public/stylesheets/{re_view_navigate → rules_engine/images/re_view_navigate}/breadcrumb.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/next-disabled-14.png → images/rules_engine/re_common/list-next-disabled-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/next-enabled-14.png → images/rules_engine/re_common/list-next-enabled-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/prev-disabled-14.png → images/rules_engine/re_common/list-prev-disabled-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/prev-enabled-14.png → images/rules_engine/re_common/list-prev-enabled-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/loadingAnimation.gif → images/rules_engine/re_common/loading.gif} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline/alert-18.png → images/rules_engine/re_common/status-changed-18.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline/alert-25.png → images/rules_engine/re_common/status-changed-25.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/info-18.png → images/rules_engine/re_common/status-draft-18.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/info-25.png → images/rules_engine/re_common/status-draft-25.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/error-14.png → images/rules_engine/re_common/status-error-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/info-14.png → images/rules_engine/re_common/status-info-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/success-18.png → images/rules_engine/re_common/status-published-18.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/success-25.png → images/rules_engine/re_common/status-published-25.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/success-14.png → images/rules_engine/re_common/status-success-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline/current-14.png → images/rules_engine/re_common/status-valid-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline/current-18.png → images/rules_engine/re_common/status-valid-18.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline/draft-14.png → images/rules_engine/re_common/status-verify-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/error-18.png → images/rules_engine/re_common/status-verify-18.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_job/error-25.png → images/rules_engine/re_common/status-verify-25.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/alert-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/change-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/delete-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/edit-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/list-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/new-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/preview-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/publish-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/revert-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/show-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/title-plural.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_plan/title-single.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule/stop-failure-14.png → images/rules_engine/re_process/error-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_process/info-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_process/list-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule/stop-success-14.png → images/rules_engine/re_process/success-14.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_publication/show-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule_class → images/rules_engine/re_rule}/add-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_rule/alert-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline → images/rules_engine/re_rule}/destroy-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_rule/edit-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_rule/error-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule_class → images/rules_engine/re_rule}/help-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_rule/help-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline/current-25.png → images/rules_engine/re_rule/icon-ad-25.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule → images/rules_engine/re_rule}/move-down-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule → images/rules_engine/re_rule}/move-down-off-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule → images/rules_engine/re_rule}/move-up-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule → images/rules_engine/re_rule}/move-up-off-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_rule/new-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule/next-change-25.png → images/rules_engine/re_rule/next-down-25.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule/next-show-18.png → images/rules_engine/re_rule/next-right-18.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline/change-25.png → images/rules_engine/re_rule/show-25.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule → images/rules_engine/re_rule}/start-pipeline-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule → images/rules_engine/re_rule}/stop-failure-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_rule → images/rules_engine/re_rule}/stop-success-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_rule/title-plural.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_rule/title-single.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/add-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/add-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/add-off-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/alert-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/change-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/change-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/delete-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/edit-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/is-default-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/list-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/make-default-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/make-default-off-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/new-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/{re_pipeline/revert-25.png → images/rules_engine/re_workflow/plan-25.png} +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/preview-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/remove-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/show-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/show-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/title-plural.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/re_workflow/title-single.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/screen.css +1580 -0
- data/rails_generators/templates/spec/controllers/re_plans_controller_spec.rb +409 -0
- data/rails_generators/templates/spec/helpers/rules_engine_helper_spec.rb +86 -0
- data/rails_generators/templates/spec/lib/rules/rule_complex_spec.rb +331 -0
- data/rails_generators/templates/spec/lib/rules/rule_simple_spec.rb +161 -0
- data/rails_generators/templates/spec/models/re_plan_spec.rb +349 -0
- data/rails_generators/templates/spec/models/re_plan_workflow_spec.rb +6 -0
- data/rails_generators/templates/spec/models/re_rule_expected_outcome_spec.rb +7 -51
- data/rails_generators/templates/spec/models/re_rule_spec.rb +108 -152
- data/rails_generators/templates/spec/models/re_workflow_spec.rb +186 -0
- data/rails_generators/templates/spec/support/rules_engine_blueprints.rb +27 -0
- data/spec/railsenv/log/debug.log +7061 -1
- data/spec/railsenv/log/empty.txt +1 -0
- data/spec/railsenv/log/test.log +492 -1
- data/spec/rules_engine/discovery_spec.rb +40 -4
- data/spec/rules_engine/process/auditor/db_auditor_spec.rb +115 -0
- data/spec/rules_engine/process/auditor_spec.rb +111 -0
- data/spec/rules_engine/process/runner/db_runner_spec.rb +229 -0
- data/spec/rules_engine/process/runner_spec.rb +236 -0
- data/spec/rules_engine/publish/publisher/db_publisher_spec.rb +280 -0
- data/spec/rules_engine/publish/publisher_spec.rb +64 -0
- data/spec/rules_engine/rule_spec.rb +7 -11
- data/spec/rules_engine_view/defer_spec.rb +30 -0
- data/spec/rules_engine_view/model_loader_spec.rb +3 -3
- data/spec/spec_helper.rb +36 -1
- metadata +268 -292
- data/lib/rules_engine/job.rb +0 -127
- data/rails_generators/manifests/rules_engine_complex.rb +0 -30
- data/rails_generators/manifests/rules_engine_complex.yml +0 -24
- data/rails_generators/manifests/rules_engine_simple.rb +0 -26
- data/rails_generators/manifests/rules_engine_simple.yml +0 -21
- data/rails_generators/templates/app/controllers/re_jobs_controller.rb +0 -20
- data/rails_generators/templates/app/controllers/re_pipeline_jobs_controller.rb +0 -16
- data/rails_generators/templates/app/controllers/re_pipelines_controller.rb +0 -171
- data/rails_generators/templates/app/helpers/re_pipeline_helper.rb +0 -14
- data/rails_generators/templates/app/models/re_job.rb +0 -122
- data/rails_generators/templates/app/models/re_job_audit.rb +0 -18
- data/rails_generators/templates/app/models/re_pipeline.rb +0 -47
- data/rails_generators/templates/app/models/re_pipeline_activated.rb +0 -29
- data/rails_generators/templates/app/models/re_pipeline_activated_observer.rb +0 -11
- data/rails_generators/templates/app/models/re_pipeline_base.rb +0 -63
- data/rails_generators/templates/app/views/re_jobs/_empty.html.erb +0 -14
- data/rails_generators/templates/app/views/re_jobs/_index_large.html.erb +0 -79
- data/rails_generators/templates/app/views/re_jobs/_index_small.html.erb +0 -41
- data/rails_generators/templates/app/views/re_jobs/_show.html.erb +0 -38
- data/rails_generators/templates/app/views/re_jobs/index.html.erb +0 -14
- data/rails_generators/templates/app/views/re_jobs/index.js.erb +0 -12
- data/rails_generators/templates/app/views/re_jobs/show.html.erb +0 -14
- data/rails_generators/templates/app/views/re_jobs/show.js.erb +0 -4
- data/rails_generators/templates/app/views/re_pipeline_jobs/index.html.erb +0 -15
- data/rails_generators/templates/app/views/re_pipeline_jobs/index.js.erb +0 -12
- data/rails_generators/templates/app/views/re_pipeline_rules/_change.html.erb +0 -57
- data/rails_generators/templates/app/views/re_pipeline_rules/_edit.html.erb +0 -16
- data/rails_generators/templates/app/views/re_pipeline_rules/_empty.html.erb +0 -12
- data/rails_generators/templates/app/views/re_pipeline_rules/_empty.js.erb +0 -7
- data/rails_generators/templates/app/views/re_pipeline_rules/_help.html.erb +0 -13
- data/rails_generators/templates/app/views/re_pipeline_rules/_menu.html.erb +0 -37
- data/rails_generators/templates/app/views/re_pipeline_rules/_show.html.erb +0 -44
- data/rails_generators/templates/app/views/re_pipeline_rules/destroy.js.erb +0 -14
- data/rails_generators/templates/app/views/re_pipeline_rules/edit.html.erb +0 -12
- data/rails_generators/templates/app/views/re_pipeline_rules/edit.js.erb +0 -8
- data/rails_generators/templates/app/views/re_pipeline_rules/error.html.erb +0 -12
- data/rails_generators/templates/app/views/re_pipeline_rules/error.js.erb +0 -7
- data/rails_generators/templates/app/views/re_pipeline_rules/help.html.erb +0 -12
- data/rails_generators/templates/app/views/re_pipeline_rules/help.js.erb +0 -4
- data/rails_generators/templates/app/views/re_pipeline_rules/new.html.erb +0 -15
- data/rails_generators/templates/app/views/re_pipeline_rules/update.js.erb +0 -21
- data/rails_generators/templates/app/views/re_pipelines/_change.html.erb +0 -48
- data/rails_generators/templates/app/views/re_pipelines/_change_actions.html.erb +0 -34
- data/rails_generators/templates/app/views/re_pipelines/_confirm.html.erb +0 -39
- data/rails_generators/templates/app/views/re_pipelines/_edit.html.erb +0 -20
- data/rails_generators/templates/app/views/re_pipelines/_empty.html.erb +0 -13
- data/rails_generators/templates/app/views/re_pipelines/_index.html.erb +0 -64
- data/rails_generators/templates/app/views/re_pipelines/_new.html.erb +0 -18
- data/rails_generators/templates/app/views/re_pipelines/_show.html.erb +0 -36
- data/rails_generators/templates/app/views/re_pipelines/change.html.erb +0 -37
- data/rails_generators/templates/app/views/re_pipelines/create.js.erb +0 -9
- data/rails_generators/templates/app/views/re_pipelines/edit.html.erb +0 -12
- data/rails_generators/templates/app/views/re_pipelines/edit.js.erb +0 -8
- data/rails_generators/templates/app/views/re_pipelines/index.html.erb +0 -61
- data/rails_generators/templates/app/views/re_pipelines/index.js.erb +0 -18
- data/rails_generators/templates/app/views/re_pipelines/new.html.erb +0 -9
- data/rails_generators/templates/app/views/re_pipelines/new.js.erb +0 -5
- data/rails_generators/templates/app/views/re_pipelines/show.html.erb +0 -39
- data/rails_generators/templates/app/views/re_pipelines/update.js.erb +0 -14
- data/rails_generators/templates/app/views/re_rule_definitions/complex_rule/_edit.html.erb +0 -7
- data/rails_generators/templates/app/views/re_rule_definitions/complex_rule/_new.html.erb +0 -7
- data/rails_generators/templates/app/views/re_rule_definitions/complex_rule/_script.html.erb +0 -26
- data/rails_generators/templates/app/views/re_rule_definitions/simple_rule/_edit.html.erb +0 -1
- data/rails_generators/templates/app/views/re_rule_definitions/simple_rule/_new.html.erb +0 -1
- data/rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb +0 -77
- data/rails_generators/templates/features/support/blueprint_re_pipelines.rb +0 -20
- data/rails_generators/templates/public/javascripts/re_job_index.js +0 -75
- data/rails_generators/templates/public/javascripts/re_pipeline_change.js +0 -194
- data/rails_generators/templates/public/javascripts/re_pipeline_index.js +0 -40
- data/rails_generators/templates/public/javascripts/re_pipeline_index_jobs.js +0 -10
- data/rails_generators/templates/public/javascripts/re_pipeline_new.js +0 -30
- data/rails_generators/templates/public/javascripts/re_pipeline_show_jobs.js +0 -11
- data/rails_generators/templates/public/stylesheets/re_view.css +0 -120
- data/rails_generators/templates/public/stylesheets/re_view_box.css +0 -119
- data/rails_generators/templates/public/stylesheets/re_view_box/accept.png +0 -0
- data/rails_generators/templates/public/stylesheets/re_view_box/exclamation.png +0 -0
- data/rails_generators/templates/public/stylesheets/re_view_box/shadowbox.jpg +0 -0
- data/rails_generators/templates/public/stylesheets/re_view_button.css +0 -118
- data/rails_generators/templates/public/stylesheets/re_view_error.css +0 -61
- data/rails_generators/templates/public/stylesheets/re_view_form.css +0 -121
- data/rails_generators/templates/public/stylesheets/re_view_navigate.css +0 -46
- data/rails_generators/templates/public/stylesheets/re_view_table.css +0 -137
- data/rails_generators/templates/public/stylesheets/rules_engine.css +0 -520
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/error-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/info-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/list-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/list-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/list-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/list-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/next-disabled-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/next-disabled-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/next-disabled-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/next-enabled-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/next-enabled-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/next-enabled-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/prev-disabled-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/prev-disabled-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/prev-disabled-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/prev-enabled-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/prev-enabled-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/prev-enabled-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_job/success-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/activate-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/activate-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/activate-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/activate-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/alert-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/alert-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/change-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/change-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/change-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/changed-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/changed-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/changed-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/changed-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/current-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/deactivate-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/deactivate-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/deactivate-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/deactivate-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/destroy-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/destroy-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/destroy-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/draft-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/draft-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/draft-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/edit-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/edit-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/edit-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/edit-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/list-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/list-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/list-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/list-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/list-down.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/list-right.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/new-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/new-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/new-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/new-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/revert-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/revert-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/revert-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/show-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/show-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/show-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/show-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/verify-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/verify-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/verify-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_pipeline/verify-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/destroy-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/destroy-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/destroy-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/destroy-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/edit-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/edit-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/edit-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/edit-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-down-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-down-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-down-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-down-off-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-down-off-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-down-off-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-up-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-up-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-up-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-up-off-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-up-off-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/move-up-off-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/next-change-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/next-change-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/next-change-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/next-show-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/next-show-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/next-show-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/start-pipeline-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/stop-failure-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/stop-failure-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/stop-success-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/stop-success-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/valid-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/valid-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/valid-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/valid-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/verify-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/verify-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/verify-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule/verify-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/add-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/add-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/add-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/help-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/help-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/help-48.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/list-down.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/list-right.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/new-14.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/new-18.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/new-25.png +0 -0
- data/rails_generators/templates/public/stylesheets/rules_engine/re_rule_class/new-48.png +0 -0
- data/rails_generators/templates/spec/controllers/re_jobs_controller_spec.rb +0 -50
- data/rails_generators/templates/spec/controllers/re_pipeline_jobs_controller_spec.rb +0 -37
- data/rails_generators/templates/spec/controllers/re_pipeline_rules_controller_spec.rb +0 -390
- data/rails_generators/templates/spec/controllers/re_pipelines_controller_spec.rb +0 -497
- data/rails_generators/templates/spec/helpers/re_pipeline_helper_spec.rb +0 -29
- data/rails_generators/templates/spec/lib/rules/complex_rule_spec.rb +0 -336
- data/rails_generators/templates/spec/lib/rules/simple_rule_spec.rb +0 -171
- data/rails_generators/templates/spec/models/re_job_audit_spec.rb +0 -23
- data/rails_generators/templates/spec/models/re_job_spec.rb +0 -163
- data/rails_generators/templates/spec/models/re_pipeline_activated_observer_spec.rb +0 -28
- data/rails_generators/templates/spec/models/re_pipeline_activated_spec.rb +0 -71
- data/rails_generators/templates/spec/models/re_pipeline_base_spec.rb +0 -164
- data/rails_generators/templates/spec/models/re_pipeline_spec.rb +0 -198
- data/spec/rules_engine/job_spec.rb +0 -323
data/LICENSE
CHANGED
File without changes
|
data/README.textile
CHANGED
@@ -37,7 +37,7 @@ Rails::Initializer.run do |config|
|
|
37
37
|
config.gem 'will_paginate'
|
38
38
|
config.gem 'acts_as_list'
|
39
39
|
...
|
40
|
-
config.active_record.observers = :
|
40
|
+
config.active_record.observers = :re_workflow_activated_observer
|
41
41
|
...
|
42
42
|
end
|
43
43
|
|
@@ -89,25 +89,25 @@ h3. 5. Add the Routes
|
|
89
89
|
ActionController::Routing::Routes.draw do |map|
|
90
90
|
...
|
91
91
|
### remove map.root if already defined
|
92
|
-
map.root :controller => '
|
93
|
-
### map.preview '/preview', :controller => '
|
94
|
-
map.resources :
|
92
|
+
map.root :controller => 're_workflows', :action => 'template'
|
93
|
+
### map.preview '/preview', :controller => 're_workflows', :action => 'template'
|
94
|
+
map.resources :re_workflows,
|
95
95
|
:collection => {:lookup => :get,
|
96
96
|
:activate_all => :put},
|
97
97
|
:member => {:change => :get,
|
98
98
|
:activate => :put,
|
99
99
|
:deactivate => :put,
|
100
|
-
:revert => :put} do |
|
101
|
-
|
102
|
-
:controller => :
|
100
|
+
:revert => :put} do |re_workflow|
|
101
|
+
re_workflow.resources :re_rules,
|
102
|
+
:controller => :re_workflow_rules,
|
103
103
|
:collection => {:help => :get, :error => :get},
|
104
104
|
:member => {:move_up => :put, :move_down => :put}
|
105
|
-
|
106
|
-
:controller => :
|
105
|
+
re_workflow.resources :re_processs,
|
106
|
+
:controller => :re_workflow_processs,
|
107
107
|
:only => [:index]
|
108
108
|
end
|
109
109
|
|
110
|
-
map.resources :
|
110
|
+
map.resources :re_processs, :only => [:index, :show]
|
111
111
|
...
|
112
112
|
end
|
113
113
|
</pre>
|
@@ -173,9 +173,9 @@ h3. 10. Start the Server
|
|
173
173
|
|
174
174
|
<pre>
|
175
175
|
./script/server
|
176
|
-
open http://localhost:3000/
|
176
|
+
open http://localhost:3000/re_workflows
|
177
177
|
</pre>
|
178
178
|
|
179
|
-
h3. 11. Create
|
179
|
+
h3. 11. Create Workflows and Rules
|
180
180
|
|
181
181
|
Watch the demo at "TODO":http://www.r3ef.com/
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/lib/rules_engine.rb
CHANGED
@@ -1,22 +1,8 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/discovery")
|
2
2
|
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/rule")
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/cache")
|
4
|
-
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/job")
|
5
3
|
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/rule_outcome")
|
6
4
|
|
7
|
-
require File.expand_path(File.dirname(__FILE__) + "/
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + "/
|
9
|
-
require File.expand_path(File.dirname(__FILE__) + "/
|
10
|
-
|
11
|
-
require File.expand_path(File.dirname(__FILE__) + "/rules_engine_view/buttons")
|
12
|
-
|
13
|
-
require File.expand_path(File.dirname(__FILE__) + "/rules_engine_view/boxes")
|
14
|
-
require File.expand_path(File.dirname(__FILE__) + "/rules_engine_view/navigate")
|
15
|
-
|
16
|
-
require File.expand_path(File.dirname(__FILE__) + "/rules_engine_view/alerts")
|
17
|
-
|
18
|
-
require File.expand_path(File.dirname(__FILE__) + "/rules_engine_view/defer")
|
19
|
-
|
20
|
-
require File.expand_path(File.dirname(__FILE__) + "/rules_engine_view/model_loader")
|
21
|
-
|
22
|
-
|
5
|
+
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/cache")
|
6
|
+
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/publish/publisher")
|
7
|
+
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/process/auditor")
|
8
|
+
require File.expand_path(File.dirname(__FILE__) + "/rules_engine/process/runner")
|
data/lib/rules_engine/cache.rb
CHANGED
@@ -1,25 +1,34 @@
|
|
1
1
|
module RulesEngine
|
2
2
|
class Discovery
|
3
3
|
|
4
|
-
|
4
|
+
@rules_path = nil
|
5
5
|
@rule_classes = nil
|
6
6
|
@rule_groups = nil
|
7
7
|
|
8
8
|
class << self
|
9
|
+
def rules_path= path
|
10
|
+
@rules_path = path
|
11
|
+
end
|
12
|
+
|
13
|
+
def rules_path
|
14
|
+
return @rules_path if @rules_path
|
15
|
+
return File.expand_path(File.join(Rails.root, '/app/rules')) if defined?(Rails) && Rails.root
|
16
|
+
throw Exception.new("Rails.root or rules_path not defined")
|
17
|
+
end
|
18
|
+
|
9
19
|
def discover!
|
10
20
|
@rule_classes = []
|
11
21
|
@rule_groups = {}
|
12
22
|
|
13
|
-
Dir.glob("#{
|
14
|
-
|
15
|
-
|
23
|
+
Dir.glob("#{rules_path}/**/*.rb").each do |rule|
|
24
|
+
Kernel.load rule
|
25
|
+
|
16
26
|
rule_class = Kernel.const_get(File.basename(rule, '.rb').classify)
|
17
27
|
@rule_classes << rule_class
|
18
28
|
|
19
29
|
group = rule_class.options[:group]
|
20
30
|
@rule_groups[group] = [] unless @rule_groups.include?(group)
|
21
31
|
@rule_groups[group] << rule_class
|
22
|
-
|
23
32
|
end
|
24
33
|
|
25
34
|
@rule_classes.sort! { |left, right| return left.to_s < right.to_s}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module RulesEngine
|
2
|
+
module Process
|
3
|
+
|
4
|
+
AUDIT_NONE = 0
|
5
|
+
AUDIT_INFO = 1
|
6
|
+
AUDIT_SUCCESS = 2
|
7
|
+
AUDIT_FAILURE = 3
|
8
|
+
|
9
|
+
autoload :DbAuditor, 'rules_engine/process/auditor/db_auditor'
|
10
|
+
|
11
|
+
class << self
|
12
|
+
|
13
|
+
def auditor=(auditor_options)
|
14
|
+
type, *parameters = *([ auditor_options ].flatten)
|
15
|
+
|
16
|
+
case type
|
17
|
+
when Symbol
|
18
|
+
auditor_class_name = type.to_s.camelize
|
19
|
+
auditor_class = RulesEngine::Process.const_get(auditor_class_name)
|
20
|
+
@auditor = auditor_class.new(*parameters)
|
21
|
+
when nil
|
22
|
+
@auditor = Auditor.new
|
23
|
+
else
|
24
|
+
@auditor = auditor_options
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def auditor
|
29
|
+
@auditor ||= Auditor.new
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class Auditor
|
34
|
+
attr_accessor :audit_level
|
35
|
+
|
36
|
+
def audit(process_id, message, code = RulesEngine::Process::AUDIT_INFO)
|
37
|
+
if perform_audit?(code)
|
38
|
+
if defined?(Rails) && Rails.logger
|
39
|
+
case code
|
40
|
+
when RulesEngine::Process::AUDIT_FAILURE
|
41
|
+
Rails.logger.error("#{'*' * 5} #{process_id}, #{code}, #{message}")
|
42
|
+
else # when RulesEngine::Process::AUDIT_INFO, RulesEngine::Process::AUDIT_SUCCESS
|
43
|
+
Rails.logger.info("#{'*' * 5} #{process_id}, #{code}, #{message}")
|
44
|
+
end
|
45
|
+
else
|
46
|
+
$stderr.puts("#{'*' * 5} #{process_id}, #{code}, #{message}")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def history(process_id, options = {})
|
52
|
+
{
|
53
|
+
"audits" => []
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
def perform_audit?(code)
|
58
|
+
audit_level.nil? || (audit_level != RulesEngine::Process::AUDIT_NONE && code >= audit_level)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module RulesEngine
|
2
|
+
module Process
|
3
|
+
class ReProcessAudit < ActiveRecord::Base
|
4
|
+
|
5
|
+
validates_presence_of :code
|
6
|
+
|
7
|
+
named_scope :by_process_id, lambda {|process_id| {:conditions => ['process_id = ?', process_id]} }
|
8
|
+
named_scope :order_created_at, lambda {|order| {:order => "created_at #{order}, id #{order}"} }
|
9
|
+
|
10
|
+
def self.history(process_id, options = {})
|
11
|
+
klass = self
|
12
|
+
klass = klass.by_process_id(process_id)
|
13
|
+
klass = klass.order_created_at('ASC')
|
14
|
+
klass.find(:all)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class DbAuditor < Auditor
|
19
|
+
|
20
|
+
def initialize(*options)
|
21
|
+
end
|
22
|
+
|
23
|
+
def audit(process_id, message, code = RulesEngine::Process::AUDIT_INFO)
|
24
|
+
if perform_audit?(code)
|
25
|
+
ReProcessAudit.create({
|
26
|
+
:process_id => process_id,
|
27
|
+
:created_at => Time.now,
|
28
|
+
:code => code,
|
29
|
+
:message => message});
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def history(process_id, options ={})
|
34
|
+
re_process_audits = ReProcessAudit.history(process_id, options)
|
35
|
+
{
|
36
|
+
"audits" => re_process_audits.map do |re_process_audit|
|
37
|
+
{
|
38
|
+
"process_id" => re_process_audit.process_id,
|
39
|
+
"created_at" => re_process_audit.created_at.utc.to_s,
|
40
|
+
"code" => re_process_audit.code,
|
41
|
+
"message" => re_process_audit.message
|
42
|
+
}
|
43
|
+
end
|
44
|
+
}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,147 @@
|
|
1
|
+
module RulesEngine
|
2
|
+
module Process
|
3
|
+
|
4
|
+
PROCESS_STATUS_NONE = 0
|
5
|
+
PROCESS_STATUS_RUNNING = 1
|
6
|
+
PROCESS_STATUS_SUCCESS = 2
|
7
|
+
PROCESS_STATUS_FAILURE = 3
|
8
|
+
|
9
|
+
autoload :DbRunner, 'rules_engine/process/runner/db_runner'
|
10
|
+
# autoload :FileProcessRunner, 'rules_engine/process/runner/file_process_runner'
|
11
|
+
|
12
|
+
class << self
|
13
|
+
def runner=(runner_options)
|
14
|
+
type, *parameters = *([ runner_options ].flatten)
|
15
|
+
|
16
|
+
case type
|
17
|
+
when Symbol
|
18
|
+
runner_class_name = type.to_s.camelize
|
19
|
+
runner_class = RulesEngine::Process.const_get(runner_class_name)
|
20
|
+
@runner = runner_class.new(*parameters)
|
21
|
+
when nil
|
22
|
+
@runner = nil
|
23
|
+
else
|
24
|
+
@runner = runner_options
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def runner
|
29
|
+
throw "RulesEngine::Process::Runner required" unless @runner
|
30
|
+
@runner
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class Runner
|
35
|
+
|
36
|
+
@@max_workflows = 500
|
37
|
+
|
38
|
+
def create
|
39
|
+
throw "RulesEngine::Process::Runner required"
|
40
|
+
# 0
|
41
|
+
end
|
42
|
+
|
43
|
+
def run(process_id, plan, data = {})
|
44
|
+
_run_plan(process_id, plan, data)
|
45
|
+
end
|
46
|
+
|
47
|
+
def status(process_id)
|
48
|
+
throw "RulesEngine::Process::Runner required"
|
49
|
+
end
|
50
|
+
|
51
|
+
def history(plan_code = nil, options = {})
|
52
|
+
throw "RulesEngine::Process::Runner required"
|
53
|
+
# {
|
54
|
+
# :proceses => []
|
55
|
+
# }
|
56
|
+
end
|
57
|
+
|
58
|
+
protected
|
59
|
+
def _run_plan(process_id, plan, data = {})
|
60
|
+
|
61
|
+
RulesEngine::Process.auditor.audit(process_id, "Plan : #{plan["code"]} : started", RulesEngine::Process::AUDIT_INFO)
|
62
|
+
|
63
|
+
workflow_count = 0
|
64
|
+
done = false
|
65
|
+
error = false
|
66
|
+
|
67
|
+
first_workflow = plan['first_workflow']
|
68
|
+
if (first_workflow.blank? || plan["workflow_#{first_workflow}"].nil?)
|
69
|
+
RulesEngine::Process.auditor.audit(process_id, "First Workflow : #{first_workflow} : missing", RulesEngine::Process::AUDIT_FAILURE)
|
70
|
+
error = done = true
|
71
|
+
end
|
72
|
+
|
73
|
+
current_workflow = first_workflow
|
74
|
+
next_workflow = ""
|
75
|
+
while (!done && workflow_count < @@max_workflows)
|
76
|
+
workflow_count += 1
|
77
|
+
|
78
|
+
RulesEngine::Process.auditor.audit(process_id, "Workflow : #{current_workflow} : started", RulesEngine::Process::AUDIT_INFO)
|
79
|
+
|
80
|
+
workflow = plan["workflow_#{current_workflow}"]
|
81
|
+
if workflow.nil?
|
82
|
+
RulesEngine::Process.auditor.audit(process_id, "Workflow : #{current_workflow} : not found", RulesEngine::Process::AUDIT_FAILURE)
|
83
|
+
error = done = true
|
84
|
+
break
|
85
|
+
end
|
86
|
+
|
87
|
+
workflow["rules"].each do | workflow_rule |
|
88
|
+
rule_class = RulesEngine::Discovery.rule_class(workflow_rule["rule_class_name"])
|
89
|
+
unless rule_class
|
90
|
+
RulesEngine::Process.auditor.audit(process_id, "Rule : #{workflow_rule["rule_class_name"]} : not found", RulesEngine::Process::AUDIT_FAILURE)
|
91
|
+
error = done = true
|
92
|
+
break
|
93
|
+
end
|
94
|
+
rule = rule_class.new
|
95
|
+
rule.data = workflow_rule["data"]
|
96
|
+
|
97
|
+
RulesEngine::Process.auditor.audit(process_id, "Rule : #{rule.title} : starting")
|
98
|
+
rule_outcome = rule.process(process_id, data)
|
99
|
+
RulesEngine::Process.auditor.audit(process_id, "Rule : #{rule.title} : finished")
|
100
|
+
|
101
|
+
if !rule_outcome.nil? && rule_outcome.outcome == RulesEngine::RuleOutcome::OUTCOME_STOP_SUCCESS
|
102
|
+
RulesEngine::Process.auditor.audit(process_id, "Workflow : #{current_workflow} : stop success", RulesEngine::Process::AUDIT_SUCCESS)
|
103
|
+
done = true
|
104
|
+
break
|
105
|
+
end
|
106
|
+
|
107
|
+
if !rule_outcome.nil? && rule_outcome.outcome == RulesEngine::RuleOutcome::OUTCOME_STOP_FAILURE
|
108
|
+
RulesEngine::Process.auditor.audit(process_id, "Workflow : #{current_workflow} : stop failure", RulesEngine::Process::AUDIT_FAILURE)
|
109
|
+
error = done = true
|
110
|
+
break
|
111
|
+
end
|
112
|
+
|
113
|
+
if !rule_outcome.nil? && rule_outcome.outcome == RulesEngine::RuleOutcome::OUTCOME_START_WORKFLOW
|
114
|
+
RulesEngine::Process.auditor.audit(process_id, "Workflow : #{current_workflow} : start next workflow - #{rule_outcome.workflow_code}", RulesEngine::Process::AUDIT_INFO)
|
115
|
+
next_workflow = rule_outcome.workflow_code
|
116
|
+
break
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
if next_workflow.blank?
|
121
|
+
current_workflow = workflow["next_workflow"]
|
122
|
+
else
|
123
|
+
current_workflow = next_workflow
|
124
|
+
end
|
125
|
+
|
126
|
+
if current_workflow.blank?
|
127
|
+
done = true
|
128
|
+
break
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
if workflow_count >= @@max_workflows
|
133
|
+
RulesEngine::Process.auditor.audit(process_id, "Plan : #{plan["code"]} : error - Maximum workflow depth #{@@max_workflows} exceeded", RulesEngine::Process::PROCESS_STATUS_FAILURE)
|
134
|
+
error = true
|
135
|
+
end
|
136
|
+
|
137
|
+
if error
|
138
|
+
RulesEngine::Process.auditor.audit(process_id, "Plan : #{plan["code"]} : failure", RulesEngine::Process::AUDIT_FAILURE)
|
139
|
+
else
|
140
|
+
RulesEngine::Process.auditor.audit(process_id, "Plan : #{plan["code"]} : success", RulesEngine::Process::AUDIT_SUCCESS)
|
141
|
+
end
|
142
|
+
|
143
|
+
!error
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'will_paginate'
|
2
|
+
|
3
|
+
module RulesEngine
|
4
|
+
module Process
|
5
|
+
|
6
|
+
class ReProcessRun < ActiveRecord::Base
|
7
|
+
validates_presence_of :process_status
|
8
|
+
|
9
|
+
named_scope :by_plan_code, lambda {|plan_code| {:conditions => ['plan_code = ?', plan_code]} }
|
10
|
+
named_scope :by_process_status_gt, lambda {|process_status| {:conditions => "process_status > #{process_status}"} }
|
11
|
+
named_scope :order_started_at, lambda {|order| {:order => "started_at #{order}, id #{order}"} }
|
12
|
+
|
13
|
+
def self.history(plan_code, options = {})
|
14
|
+
|
15
|
+
klass = self
|
16
|
+
klass = klass.by_plan_code(plan_code) unless plan_code.nil?
|
17
|
+
klass = klass.by_process_status_gt(RulesEngine::Process::PROCESS_STATUS_NONE)
|
18
|
+
klass = klass.order_started_at('DESC')
|
19
|
+
|
20
|
+
klass.paginate({:page => 1, :per_page => 10}.merge(options))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
class DbRunner < Runner
|
26
|
+
|
27
|
+
def initialize(*options)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create()
|
31
|
+
ReProcessRun.create(:process_status => RulesEngine::Process::PROCESS_STATUS_NONE).id
|
32
|
+
end
|
33
|
+
|
34
|
+
def run(process_id, plan, data = {})
|
35
|
+
re_process = ReProcessRun.find_by_id(process_id)
|
36
|
+
|
37
|
+
if re_process.nil?
|
38
|
+
RulesEngine::Process.auditor.audit(process_id, "Process missing", RulesEngine::Process::AUDIT_FAILURE)
|
39
|
+
return false
|
40
|
+
end
|
41
|
+
|
42
|
+
re_process.update_attributes(:plan_code => plan["code"], :plan_version => plan["version"], :started_at => Time.now.utc, :process_status => RulesEngine::Process::PROCESS_STATUS_RUNNING)
|
43
|
+
|
44
|
+
success = _run_plan(process_id, plan, data)
|
45
|
+
|
46
|
+
re_process.update_attributes(:finished_at => Time.now.utc, :process_status => success ? RulesEngine::Process::PROCESS_STATUS_SUCCESS : RulesEngine::Process::PROCESS_STATUS_FAILURE)
|
47
|
+
|
48
|
+
success
|
49
|
+
end
|
50
|
+
|
51
|
+
def status(process_id)
|
52
|
+
re_process = ReProcessRun.find_by_id(process_id)
|
53
|
+
re_process ? re_process.process_status : RulesEngine::Process::PROCESS_STATUS_NONE
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
def history(plan_code = nil, options = {})
|
58
|
+
|
59
|
+
re_process_runs = ReProcessRun.history(plan_code, options)
|
60
|
+
|
61
|
+
{ "next_page" => re_process_runs.next_page,
|
62
|
+
"previous_page" => re_process_runs.previous_page,
|
63
|
+
"processes" => re_process_runs.map do |re_process_run|
|
64
|
+
{
|
65
|
+
"process_id" => re_process_run.id,
|
66
|
+
"plan_code" => re_process_run.plan_code,
|
67
|
+
"plan_version" => re_process_run.plan_version,
|
68
|
+
"process_status" => re_process_run.process_status,
|
69
|
+
"started_at" => re_process_run.started_at.nil? ? nil : re_process_run.started_at.utc.to_s,
|
70
|
+
"finished_at" =>re_process_run.finished_at.nil? ? nil : re_process_run.finished_at.utc.to_s
|
71
|
+
}
|
72
|
+
end
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|