Thank your for your reply~
I am developing the Identity and Access management. I have finished the
basic requirement, but the pre-condition part is what I am doing. The
website sends the pre-condition(like what IP address or the time period can
user access) that user sets. The pre-conditions are what I mentioned
(expression). The difficulty is one expression may consist of several
pre-conditions and every condition may be related to different rules.
So here is the problem, how to verify users' authorization based on the
expression which contains many operators("AND", "OR"). The number of
"AND",
"OR" in the expression are set by users. This is why I thought to create a
rule file for each expression when the expression is created. In this case,
I won't bother how many "AND", "OR" a expression contains.
By the way, I also thought about parsing the expression in Java, then
inserting every single condition into working memory. But it seems Drool can
not be fully used in this way. Because it only looks like a if-else
block....
Do you have any other solution for this requirement?
Cheers
laune wrote
A (dynamic) "request" with a "logical expression" that is to be
evaluated
as
a rule is very much like a (dynamic) SQL query to be evaluated on a
database.
Are you sure that Drools is the right platform?
If "someone" wants to send a logical expression in a formal language of
their
own, you'll have to parse that expression and translate it into the Drools
Rule
Language (aka DRL). Perhaps a Domain Specific Language might help, but
there's no telling from the very sparse information you've provided. (In
any case
"someone" and Drools will have to agree on the data model and the way to
refer to the data, or else you'll have to do more work.)
-W
On 26 February 2012 16:00, shawn <youngxiao121@> wrote:
> Sorry, I forget to mention one thing.
> What's really difficult for me is to translate the
"AND","OR"(Condition 1
> AND Condition 2 OR Condition 3....) to the drool.
> Because someone will send the request with the expression(Condition 1 AND
> Condition 2 OR Condition 3....) to me. For each request the expression is
> different. They hope I can translate the "AND","OR" to rule file
> automatically. They don't want drool to parse the expression(maybe
> string)
> to pick "AND", "OR". This is why they want to have a rule file
for each
> request. They want to trigger the function to make a rule file when they
> are
> making the expression, not only simply send me the expression and verify
> it..
>
> --
> View this message in context:
>
http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-ta...
> Sent from the Drools: User forum mailing list archive at
Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users@.jboss
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users@.jboss
https://lists.jboss.org/mailman/listinfo/rules-users
--
View this message in context:
http://drools.46999.n3.nabble.com/How-to-create-a-drl-file-or-decision-ta...
Sent from the Drools: User forum mailing list archive at
Nabble.com.