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"
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
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
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
>> 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
>>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
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
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
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
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
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
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
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
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
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
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
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
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
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
___
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
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
21 matches
Mail list logo