Katerina,
I will give you my personal opinion, and it is important that you
understand that it is not based in any literature or others experience.
Just my own professional experience.
While it is possible to do that in the RHS of a rule, I would not do
it. The main reason for that is that it would make everything more
difficult to develop/test/maintain. You would increase the coupling
between your system's components and decrease their flexibility.
When designing my own systems, I tend to specialize components with
well defined roles. When working with rules, I usually let rules take
the decisions, but let other specific component react to those decisions
(in this case, manage the flow of the application). I think about the
rules engine as a "service" in a SOA architecture (if you prefer to
think like that), in a way that if more information from the user is
needed, what the rules will do is to answer to the service call "saying:
'more information needed". The real controller component (the one that
manages the application flow) will understand that message and ask the
user for more info. Once the user adds the info, the controller asserts
new info into the working memory and fire rules again (or call the
service again, if you prefer).
The advantages for me in such approach is that a small application
can use such "rules service" with a house made controller and do fine
with it, but if you need to leverage that controller for something more
complex like managing a workflow or business process, you can replace it
for a BPM engine (like jBPM) and your rules will never notice (better
decoupling). Also it becomes really easy to implement unit tests over
your rules, while if you increase coupling with GUI components, you
would need to start creating mocks for testing your rules.
So, my answer is model your rules component as a passive service and
have a controller to be the active flow manager.
Hope it helps.
[]s
Edson
kchantzara(a)costamare.com wrote:
Hello,
I am thinking about using JBoss Rules as the mid-tier of a web application.The aim of this
system is to conclude on some results based on the rules and on some data provided by the
user by the web interface. The problem is that apart from the initial input, some more
user information might be needed during the rules workflow. The user response might result
in asserting new objects into the working memory, firing new rules etc. My question is,
would it be possible to request user information as part of the RHS of a rule and
'halt' the firing of rules until this information is provided?
Thanks in advance,
Katerina
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @
www.jboss.com