Module: RulesEngineHelper

Defined in:
app/helpers/rules_engine_helper.rb

Instance Method Summary collapse

Instance Method Details

#re_audit_status(audit_status) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'app/helpers/rules_engine_helper.rb', line 32

def re_audit_status audit_status
  case audit_status.to_i
  when RulesEngine::Process::AUDIT_SUCCESS
    'success'
  when RulesEngine::Process::AUDIT_FAILURE
    'error'      
  else # RulesEngine::Process::AUDIT_INFO
    'info'
  end    
end

#re_history_status(process_status) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/helpers/rules_engine_helper.rb', line 19

def re_history_status process_status
  case process_status.to_i
  when RulesEngine::Process::PROCESS_STATUS_RUNNING
    'running'
  when RulesEngine::Process::PROCESS_STATUS_SUCCESS
    'success'
  when RulesEngine::Process::PROCESS_STATUS_FAILURE
    'error'      
  else # RulesEngine::Process::PROCESS_STATUS_NONE
    'info'
  end    
end

#re_plan_status(re_plan) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/rules_engine_helper.rb', line 3

def re_plan_status re_plan
  case re_plan.plan_status
  when RePlan::PLAN_STATUS_PUBLISHED
    'published'
  when RePlan::PLAN_STATUS_CHANGED
    'changed'
  else # when RePlan::PLAN_STATUS_DRAFT
    'draft'
  end
end

#re_plan_version(re_plan) ⇒ Object



14
15
16
17
# File 'app/helpers/rules_engine_helper.rb', line 14

def re_plan_version re_plan
  return '' if re_plan.nil? || re_plan.plan_version.nil?
  "Ver.#{re_plan.plan_version}"    
end