F
foobar
I have a requirement to implement a rules Engine in an application. We
want to be able to dynamically re-deploy the logic for the rules at runtime
without having to re-deploy the application. Thus, the logic would be
expressed as XML in an XML file. We would monitor if this file changes and
re-load it if it did.
However, I don't see how I can read in a static XML file and dyamically build
an arbitrary Java expression from its contents that is then interpreted
by a running application? Any thoughts as to how to approach this are appreciated.
The expression would contain class and method names with parameters and AND,
OR, NOT, parenthesis, etc. Example:
<expr>
request.getRemoteUser() != null && Foo.bar("3") != 2 || (! Bar.foo() == 9);
</expr>
want to be able to dynamically re-deploy the logic for the rules at runtime
without having to re-deploy the application. Thus, the logic would be
expressed as XML in an XML file. We would monitor if this file changes and
re-load it if it did.
However, I don't see how I can read in a static XML file and dyamically build
an arbitrary Java expression from its contents that is then interpreted
by a running application? Any thoughts as to how to approach this are appreciated.
The expression would contain class and method names with parameters and AND,
OR, NOT, parenthesis, etc. Example:
<expr>
request.getRemoteUser() != null && Foo.bar("3") != 2 || (! Bar.foo() == 9);
</expr>