Sha256: f2c87dccc008a6f34c0de2066bab4226f4c7dcf7459b2c6ec0f49272ca7ca250

Contents?: true

Size: 591 Bytes

Versions: 4

Compression:

Stored size: 591 Bytes

Contents

namespace :re do
  
  desc "run a rules pipeline with the complex rule"   
  task :execute => :environment do

    if ENV['re_pipeline_code'].blank?
      raise "usage: rake re:execute re_pipeline_code=[pipeline code] re_param='[value]'"
    end    
      
    data = ENV.inject({}){ |data, value| data[value[0].sub(/^re_/, '').to_sym] = value[1] if value[0] =~ /^re_/; data }
    
    job = RulesEngine::Job.create
    # job = RulesEngine::Job.open(job.re_job.id)
        
    result = job.run(data[:pipeline_code], data)
    
    puts "rule completed : data = #{data.inspect}"
  end  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rules_engine-0.0.6 rails_generators/templates/lib/tasks/re_execute.rake
rules_engine-0.0.5 rails_generators/templates/lib/tasks/re_execute.rake
rules_engine-0.0.4 rails_generators/templates/lib/tasks/re_execute.rake
rules_engine-0.0.3 rails_generators/templates/lib/tasks/re_execute.rake