You cannot post messages because only members can post, and you are not currently a member.
Description:
Discussion of the Rule Engine for Ruby, Ruleby.
|
|
|
Remove rule at runtime
|
| |
Is there a way to remove a rule from the rulebase at runtime?
I want to create a rules engine that is exposed as a webservice.
Clients will post to /facts/assert to put a new fact into the working
memory and will post to /facts/retract to remove a fact from the
working memory. I currently start my environment by creating a single... more »
|
|
Not refiring rules on retract or modify
|
| |
Is it possible to only run a rule once for a given fact? It looks
like when any fact is retracted or modified, that all the rules are re-
run on all the facts. I can see that it would be very useful that a
rule only fire once for a given fact until that fact is modified.
|
|
Loading rules from external file
|
| |
Is there a way to load the rules from an external source? I tried
making my SampleRulebook take in block where the block was a simple
load('filename'), but that doesnt work. I know that there is an effort
underway to create an external dsl using treetop but my question is a
bit different. I would like to be able to define the rule blocks in... more »
|
|
Modify vars
|
| |
Are you allowed to modify two vars? I am doing it and it seems to result in weirdness. Behaviour sensitive to condition position and/or it re-enters a rule that it should not after the vars are modified. - Ric
|
|
Which is better?
|
| |
rule :Rule_Name,
[Class, :c1, m.method_that_returns_array(&c {|x| x.include?
("VALUE")})],
[Class2, :c2, m.type == "TYPE", m.relationship == b(:c1)] do |v|
puts "found it"
end
rule :Rule_Name2,
[Class2, :c2, m.type == "TYPE", m.relationship(&c{|x|
x.method_that_returns_array.in clude?("SHUTTLE")})] do |v|... more »
|
|
Trouble with &condition
|
| |
I have started looking at ruleby but have hit a small snag. I can't
seem to understand how to use &condition. I have something like:
rule :Rule2,
[MyCass, :m, m.some_method_that_returns_an_ array(&c{ |r|
r.include?("some val")})] do |v|
puts 'found it'
end... more »
|
|
FYI: I committed a Git sin
|
| |
I had to do some altering of old commits in the Git repo. This means that if you have local commits that have not been pushed to origin you may run into some problems the next time you pull. I know this is a terrible thing to do in a Git repo (from the mouth of Linus). But I had to do it for administrative purposes.... more »
|
|
Active Records Objects Going Stale
|
| |
Dear Groupies,
situation:
=======
I am using active_record objects as facts.
complication
==========
They go stale after changes made to them in the rulebook.
And they go stale for my Rspec tests.
Solutions
=======
reload the object after it has been manipulated.
reload the object before testing the conditions in rspec.... more »
|
|
DSL conditional syntax rules
|
| |
dear groupies,
are the following DSL conditional syntax rules correct?
1. Direct comparison of m.methods not possible:
i.e. m.foo > m.bar
therefore this will not work.
[ExistingAction, :action, m.aspirin_strength >
m.pain_threshold] do |v|
puts "relief"... more »
|
|
|