Class: RulesEngine::Process::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/rules_engine/process/runner.rb

Direct Known Subclasses

DbRunner

Constant Summary collapse

@@max_workflows =
500

Instance Method Summary collapse

Instance Method Details

#createObject



38
39
40
41
# File 'lib/rules_engine/process/runner.rb', line 38

def create
  throw "RulesEngine::Process::Runner required"
  # 0
end

#history(plan_code = nil, options = {}) ⇒ Object



75
76
77
78
79
80
# File 'lib/rules_engine/process/runner.rb', line 75

def history(plan_code = nil, options = {})
  throw "RulesEngine::Process::Runner required"
  # {
  #   :proceses => []
  # }
end

#run_plan(process_id, plan, data = {}) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rules_engine/process/runner.rb', line 43

def run_plan(process_id, plan, data = {})
  RulesEngine::Process.auditor.audit(process_id, "Plan : #{plan["code"]} : started", RulesEngine::Process::AUDIT_INFO)

  success = _run_plan_workflow(process_id, plan, plan["workflow"], data)

  if success
    RulesEngine::Process.auditor.audit(process_id, "Plan : #{plan["code"]} : success", RulesEngine::Process::AUDIT_SUCCESS)
  else
    RulesEngine::Process.auditor.audit(process_id, "Plan : #{plan["code"]} : failure", RulesEngine::Process::AUDIT_FAILURE)
  end
    
  success    
end

#run_workflow(process_id, plan, workflow_name, data = {}) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/rules_engine/process/runner.rb', line 57

def run_workflow(process_id, plan, workflow_name, data = {})        
  RulesEngine::Process.auditor.audit(process_id, "Workflow : #{workflow_name} : started", RulesEngine::Process::AUDIT_INFO)

  success = _run_plan_workflow(process_id, plan, workflow_name, data)

  if success
    RulesEngine::Process.auditor.audit(process_id, "Workflow : #{workflow_name} : success", RulesEngine::Process::AUDIT_SUCCESS)
  else
    RulesEngine::Process.auditor.audit(process_id, "Workflow : #{workflow_name} : failure", RulesEngine::Process::AUDIT_FAILURE)
  end
    
  success    
end

#status(process_id) ⇒ Object



71
72
73
# File 'lib/rules_engine/process/runner.rb', line 71

def status(process_id)
  throw "RulesEngine::Process::Runner required"
end