Re: [rules-users] New DSL question...Interpreting constants...

2009-10-22 Thread Matt Geis
Hi Macon, You can make some highly flexible DSL's by using regular expressions and DSL entry chaining. See the following for an example: http://blog.athico.com/2008/06/allowing-variable-masks-in-dsl-grammar.html * So the above rules could be partially rewritten as: rule "Monetary 1"

Re: [rules-users] Type declaration in DSL

2009-08-06 Thread Matt Geis
You just need to create a mapping like.. There is a product type = productType : ProductType() There is a customer = customer : Party() and you can write the LHS of the rule like when >not PricingResult() There is a product type There is a customer Matt

Re: [rules-users] DSL matching return wrong DRL

2009-07-22 Thread Matt Geis
The question has already been answered, but to help you understand how DSL expansion works, here's what happens. 1. The expander goes down the list and matches the first expression against all lines in your rules. So, rule dsl2drl_1 when Get month summer then Print months; end becomes

[rules-users] re: Is Drools suitable for this scenario?

2009-05-28 Thread Matt Geis
Alex, You might also want to look into Dozer for mapping values from one object to fields in another object. http://dozer.sourceforge.net Matt ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/r

[rules-users] Re: Mixing dsl language and regular rule syntax in a rule file

2009-03-20 Thread Matt Geis
>> Is it possible to mix dsl language and regular rule syntax in a rule file? Absolutely. Last I checked, it was not documented, but you can see it in the samples that ship with Drools. Your dslr file below has been rewritten to support what you want to do. (The '>' character tells the p

[rules-users] Re: DSL: Problem of having 2 DSL statements that endsdiffer

2008-12-16 Thread Matt Geis
>>Actually Drools processes DSL a similar way it process rules, doesn't it ? Not quite. DSL matching is a brute-force process. The engine will iterate across all appropriate entries in the DSL mapping file for each line of custom rule "code." Changes to the state of the code line do not ca

Re: [rules-users] DSL: Problem of having 2 DSL statements that endsdiffer

2008-12-16 Thread Matt Geis
Minor correction: >>Drools stops on the first DSL sentence it can map to. [false] >>If you want it to work, you have to be careful about the order you write >>sentences in your DSL : write them from the most restricitive to the less. [depends on what you want to accomplish] Drools actually doe

[rules-users] typed dsl variables

2008-09-04 Thread Matt Geis
Hi Pallav, I just started a new gig, so I don't have my drools env all set up, but here are my suggestions to help you to really understand dsl's and build some powerful rules using them. Quick, dirty, but you won't become a guru: 1. Download Drools 5. 2. Use the syntax for typed variables, an

Re: [rules-users] Variable assignment in DSL

2008-09-03 Thread Matt Geis
how about changing the first line of your DSL map to... [condition][]{varname} is a Volume where {constraints} = {varname} : RawVolumeTs (where {constraints} ) That way, your DSL would read... rule "RT(2) against FT(32)" when V1 is a Volume where status is "NA" and sourceId is "AB

[rules-users] Re: How to create DSL template that produces rules based on arbitrary user's input?

2008-08-08 Thread Matt Geis
sentially the same question to the list, if you want to go through the archives to find it. This may help... http://article.gmane.org/gmane.comp.java.drools.user/11020/match=geis Matt Geis ___ rules-users mailing list rules-users@lists.jbo

[rules-users] Re: variable 'or' constraints with a DSL

2008-07-16 Thread Matt Geis
Hi Reid, >>The user has to be able to specify any of the attributes or any combination >>thereof and not necessarily in any order or all of them. [snip] >>I think answer is adding constraints with the dash syntax No, dash syntax is not the answer. Clever construction of the DSL mapping will

[rules-users] Re: variable 'or' constraints with a DSL

2008-07-15 Thread Matt Geis
Hi Reid, There is a way to do this, but it doesn't involve the "-" (AND) hyphen shortcut. You would write a regular DSL, and the RHS of your rule would be one line. It's important to remember that DSL entry order is very important in your file. The domain-specific code you write can (either i

[rules-users] trouble adding newline to DSL

2008-06-12 Thread Matt Geis
Hi, I'm having a really strange scenario. I have a DSL entry that I need to expand onto two lines. When I write it as plain DRL, on a single line, the rule fails. When I separate it into two lines, it passes. The problem is that I'm having issues getting my DSL to insert a newline char into t

[rules-users] are "sentence fragments" possible w/DSL?

2008-03-31 Thread Matt Geis
Hey everyone -- I've got a problem around trying to create arbitrary DSL rules. I asked a similar question about a year ago, and given the state of Drools at the time, it wasn't possible. I'm not having much more success now, a year later, but I wanted to find out if what I'm trying to accompl

[rules-users] RE: firing specific rule

2007-10-18 Thread Matt Geis
I ran into this unexpected behavior as well. I took a look at the Drools source and found that the rule filters filter out rules that MEET the criteria (unlike the java Filename Filter, which filters out those that do NOT meet the criteria. So, if you want to run a VERY specific rule, you coul

[rules-users] problems with Otherwise()

2007-08-07 Thread Matt Geis
I've got the following three rules in my DRL, but I'm seeing odd results. rule "matchfound" when s : String() then System.out.println("got a match, string found in working memory"); end rule "intmatchfound" when i : Integer() then System.out.println

[rules-users] Re: Entreprise using Drools with success

2007-07-18 Thread Matt Geis
Not quite able to say who I work for, but we run a brokerage app for which we licensed the source code. We've been running/modding the app for the last 3 years, so it's pretty much our app now, in terms of how familiar we are with it, and how much we've changed/tuned it. That being said, our a

[rules-users] frequency of digest posts

2007-07-17 Thread Matt Geis
Why is it that the "digest" comes almost as frequently as individual emails? I've received eight separate digest emails in the last five hours, and I can only assume I'll get another ten or so by the end of the day? I subscribe because I like to keep up on what's going on with JBoss Rules, but

[rules-users] Re: Fun with JAXB

2007-07-06 Thread Matt Geis
Ron, If Castor doesn't work out for you, you could always go out on a limb and use retroweaver. It uses allows you to write Java5 source that compiles to 1.4 compatible bytecode. http://retroweaver.sourceforge.net/ Matt ___

[rules-users] Re: Fun with JAXB

2007-07-06 Thread Matt Geis
Suggestion: Instead of using XMLBeans for your XML serialization/deserialization, use JAXB 2.0. You can get it to use POJO's and annotations (a little more work than doing a straight codegen from an xml schema, but still doable), and JBossRules should have no problem subclassing/overriding, a

[rules-users] question about DSL, nested values

2007-06-25 Thread Matt Geis
Hi, I'm encountering some conceptual issues trying to get something done with JBossRules. What I'd like to do is to create a DSL that allows our non-technical users to have some very flexible options for accessing nested properties in an object. Ideally I'd like to allow them to 1. Access