Questions tagged [rules]

This tag is very broad, try being more specific by using tags relevant to your problem. Examples are "rule-engine" for rules engines, "url-rewriting"/"mod-rewrite" for rewrite rules or "form-validation" for validation rules. See the full wiki article for a more complete list.

Rules are used to describe a requirement for data or behavior in software.

If a more specific tag exists for the subject of your question, please use that tag to better contact experts familiar with that technology.

1666 questions
26
votes
7 answers

Rules engine for .NET

We have a business requirement to let power users edit rules for insurance rates and enrollments. We need a web ui that lets them say "this product is only for people <55 unless they are from Texas and own a poodle" or whatever. Edit for…
Code Silverback
  • 3,204
  • 5
  • 32
  • 39
23
votes
5 answers

Implementing a "rules engine" in Python

I'm writing a log collection / analysis application in Python and I need to write a "rules engine" to match and act on log messages. It needs to feature: Regular expression matching for the message itself Arithmetic comparisons for message…
Kamil Kisiel
  • 19,723
  • 11
  • 46
  • 56
21
votes
4 answers

depending on directories in make

This is a followup to my earlier question: SO 4403861 because the suggested solutions broke the dependencies, making the makefile useless. I can't figure out why. I am using gnu make 3.82 I have a rule that works if the obj directory has been…
Dov
  • 8,000
  • 8
  • 46
  • 75
21
votes
4 answers

How can we ignore some SonarQube rules in Java?

We recently started using SonarQube. We have found some rules that are suggested by SonarQube but we want to ignore them or give them a low priority and even configure the time suggested by SonarQube. For e.g We want to avoid the rule (and/or…
WowBow
  • 7,137
  • 17
  • 65
  • 103
21
votes
2 answers

How to validate a JSON object in java?

I use sf.json library to map form data for incoming request in my web application in java. Lets say the incoming request is http://localhost:8080/app/addProfile with form data as: formData: { "name":"applicant Name", "Age":"26", …
N3WOS
  • 375
  • 1
  • 2
  • 12
20
votes
3 answers

Drools - Ability to define rules at runtime?

It is possible to define rules dynamically completely at runtime ? Also change the ruleset at runtime. For example, at time = t_1 the ruleset is { R1, R2, R3 } at time = t_2 the ruleset is { R1, R3, R4 } ..... R1, R2 are rules that are…
Soumya Simanta
  • 11,523
  • 24
  • 106
  • 161
20
votes
14 answers

Should a business rule violation throw an exception?

Should a business rule violation throw an exception?
E Rolnicki
  • 1,677
  • 2
  • 17
  • 26
20
votes
7 answers

I need a simple rules engine, I think?

I need some advice on the best approach to solving this problem. I've researched DROOLS, Java Rule Engine and a few others. All of these are powerful, and have good things about them. I don't know which (if any) will be the best choice for me. I…
Andy
  • 8,841
  • 8
  • 45
  • 68
20
votes
6 answers

Are there any rules for OOP?

Recently I heard that there are 9 rules for OOP(Java). I know only four as Abstraction, Polymorphism, Inheritance and Encapsulation. Are there any more rules for OOP?
Viki
  • 251
  • 1
  • 4
  • 7
20
votes
4 answers

Capitalization of Person names in programming

Is anyone aware of some code/rules on how to capitalize the names of people correctly? John Smith Johan van Rensburg Derrick von Gogh Ruby de La Fuente Peter Maclaurin Garry McDonald (these may not be correct, just some sample names and how the…
Albert
  • 1,062
  • 2
  • 13
  • 20
18
votes
1 answer

Is it possible to set priorities for rules to avoid the "longest-earliest" matching pattern?

Another simple question : is there any way to tell flex to prefer a rule that matches a short thing over a rule that matches a longer thing ? I can't find any good documentation about that. Here is why I need that : I parse a file for a pseudo…
m09
  • 7,490
  • 3
  • 31
  • 58
17
votes
4 answers

How to write files to current directory instead of bazel-out

I have the following directory structure: my_dir | --> src | | | --> foo.cc | --> BUILD | --> WORKSPACE | --> bazel-out/ (symlink) | | ... src/BUILD contains the following code: cc_binary( name = "foo", srcs =…
Ani Kristo
  • 335
  • 1
  • 2
  • 9
17
votes
2 answers

phpcs: How can I modify PSR2 to check that the brace is on the same line as the method?

I've spent now over 2h on trying to figure out how to require the { in the same line as the method declaration instead of the default requirement being the next line. How can I get this done? I've copied the PSR2 standard to a new folder named PSR2…
floriank
  • 25,546
  • 9
  • 42
  • 66
17
votes
1 answer

How to pass a parameter in an Outlook rule to run a Python script?

I created a shutdown.py script that shuts down my computer. I have a working rule in Microsoft Outlook that executes my Python script when I receive an email that has %BLAHBLAHBLAH% in the subject. Is it possible to pass the email's subject line…
papezjustin
  • 2,223
  • 6
  • 24
  • 31
16
votes
2 answers

Design patterns and algorithms for applying rules to facts

I am in the midst of trying to nail down requirements from a client for a pricing engine in a retail environment. We have defined the pricing engine as operating on a set of pricing rules that establishes new price points for purchased items based…
Bill
  • 1,738
  • 10
  • 22