A few general questions on scaling StatefulKnowledgeSessions
by Skiddlebop
Greetings All!
I humbly request your guidance and insights!
Overview:
We are currently undergoing evaluation of how to best proceed using the
Drools Suite to best meet the current and future business needs with the
highest system scalability and performance. We are attempting to make the
proper system design choices, particularly with respect to which of the two
KnowledgeSession types (stateful or stateless) to use and how to best use
them to scale the system.
The Context: We are using Drools for operational decision making,
monitoring, and workforce resource management; this naturally entails some
degree of event processing, temporal reasoning, state management, and
inference.
Given the nature of this context, it seems that a StatefulKnowledgeSession
is justified and best (but may not be entirely necessary).
The current approach:
Currently, our rule model is not very mature or stable... Consequently, the
approach is to use one very large long-running StatefulKnowledgeSession
containing all relevant operational data. This single
StatefulKnowledgeSession will be constructed and disposed of (and
reconstructed with operational state) on a very infrequent interval, say
every 24 hours. In this fashion, a single working memory network manages the
entire operational state and holds all relevant facts; Each fact is updated
on a per-event basis.
The problem:
This approach has many drawbacks in my opinion... I'll mention just a few...
StatefulSessions are not thread-safe (require sequential processing) and
consequently will not scale; it is also a single point of failure. Also, as
the size of Working Memory grows, processing time increases and garbage
collection becomes very messy and laggy (when performed).
The potential solution:
To enable greater scalability, differentiation, and parallelization, it
seems wise to partition the rules/facts into multiple specialized
concurrently operating StatefulKnowledgeSession (KnowledgeBase) instances.
However, if done improperly, this poses a difficult problem as with greater
separation, the more myopic our reasoning becomes.
Questions (some of which are intentionally dumb):
Given the nature of the above mentioned business context, does a Stateful
approach seem justified (or is it advised to follow KISS and remain
stateless)?
What are the recommended strategies to best scale StatefulKnowledgeSessions
(or a set of StatefulKnowledgeSessions) as they are inherently
single-threaded?
If multiple StatefulKnowledgeSessions/KnowledgeBases are used, what are the
recommended strategies to partition/individualize/classify them? Should we
do this according to type, instance value, unique identifier, group of
interrelated objects, etc? I understand this is very domain/use-case
specific, but I'm curious how others approach this matter.
What are the recommended strategies with respect to frequency (or triggers)
of disposal of a StatefulKnowledgeSession and/or the retraction of the facts
therein?
What would you say a healthy average working-memory size is?
What would you say the average lifespan/duration of a
StatefulKnowledgeSession is?
If we have an external data store (which holds state) from which we can
query and reconstruct working-memory state for any given object (or set of
objects), would it be best to continue with the single large
StatefulKnowledgeSession approach?
Also, If we can always reconstruct state, is there any material difference
(capability-wise) between a Stateful and Stateless KnowledgeSession besides
inference/iterative decision making? Is it possible to do Temporal
Reasoning/CEP with a StatelessKnowledgeSession (I think not)?
I entirely understand that most of this is very context specific, and that
no one else can solution this on my behalf; Some of these questions may be
very obtuse... However, I'd sincerely appreciate any insights from this
righteously authoritative community.
With Humility and Gratitude,
Skiddlebop
--
View this message in context: http://drools.46999.n3.nabble.com/A-few-general-questions-on-scaling-Stat...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Add attachement file to a Task Form
by Sadiroveski
Hello,
I am using Drools generated form to build my application forms with JBPM. In
a specific user task inside my process, I want to let the user add a file
via an upload button. So the question is:
- How can we do this in the Task form and in the task properties in the
designer?
- Does the file should be stored in a directory or in the database?
- Can we store the file in a document management system like "Sharepoint"?
Best Regards,
--
View this message in context: http://drools.46999.n3.nabble.com/Add-attachement-file-to-a-Task-Form-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Hiding a column in web guided decision table disables a condition or action
by jasonxzhong
Hi,
I am trying to develop a guide decision table so that each row will
transform to the following rule
rule "..."
when
data : RuleData(
controlCode == 123,
term = "<literal from cell>"
)
then
TermTicket t = new TimeTicket();
t.setTerm(data.getTerm());
t.setSomerValue(...)
insert(t);
end
The condition that tests RuleData.controlCode attribute does not use any
value from the table itself but just a constant "123" so I added a BRL
fragment "controlCode equals to 123". This seems to work as long as this
column is not hidden and the checkbox in the corresponding column is checked
(by default the box is not checked therefore the condition is not added to
the rule). Since the condition does not require any user provided value it
is rather odd that it needs to be displayed in the table and requires user
to check the box to enable it. Is there a way to get around this or this is
a limitation of the guided decision table?
Similarly in the same rule I want to set the value of TermTicket.term to a
value taken from the RuleData, not from the table itself. Again I can get
this to work by using a free form DRL. However this also requires the column
itself to be shown in the table and the user needs to check the checkbox in
that column to enable this action.
Any suggestions?
Thanks, Jason
--
View this message in context: http://drools.46999.n3.nabble.com/Hiding-a-column-in-web-guided-decision-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
expert mailing list
by Mark Proctor
As the user list is now high volume, i'm contemplating an "invite only" expert list. I'm not sure who this would work, or if it's practical. But the idea is to have a lower volume list, with a higher quality of technical questions and discussions. This might make it easier for people to be engaged.
I'm thinking of doing it as a google group "drools-expert-group" or something.
I'm not entirely sure how to decide who gets an invite or not…. as it's very arbitrary. I guess in general anyone who gets a recommendation for someone on the list, gets an invite. But I'm open to other ideas to run this.
Ideally we should be able to setup a number of moderators, that can handle this invite list, including people from the community. Although not sure if google groups supports this, need to find out.
Anyway would like to here what people think, and would be interest to see alternative ways to do this. Maybe you can point to existing setups, that manage this sort of situation, that we can copy?
Mark
12 years, 4 months
trouble getting rule debugging to work in eclipse
by Frank Wilson
Hi droolers!
I installed the Drool Eclipse 5.4.0 Final plugin into an Indigo SR2 installation of eclipse and found I could not get the rule debugger to work.
I created a standard rules runtime for my workspace. Then I created a drools project with the HelloWorld rule and the sample loader java class. I then set some break points in the consequent parts of both the "Hello World" and "Goodbye" rules. I then right-clicked on DroolTest.java->Debug As->Drool Application. However, the debugger did not pause on the break points as I expected. This was despite the fact the program gave the expected output:
Hello World
Goodbye cruel world
If I put breakpoints in java code the debugger pauses there as expected.
Any idea where I might be going wrong here?
Thanks,
Frank
12 years, 4 months
How to use reference guided table cell value in BRL fragment using DSL
by jasonxzhong
I am trying to figure out how to use DSL terms in BRL fragment to construct a
column in a guided decision table.
I have the following definition in DSL
[condition][] Registration data has properties = RuleData()
[condition][] - {expression}{value} = {expression}{value}
In a guided decision table I'd like to add a condition column and I want to
use the DSL terms to do this. So I chose to add a condition BRL fragment:
Registration data has properties
- flagChange == [value]
I want the [value] to be the value from the condition column. Can this be
done and if so what do I use to indicate that the [value] should be the
condition column value instead of a literal value?
Thanks,
- Jason
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-use-reference-guided-table-cell-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Handling maps in Drools
by Manav
Hi,
I am facing an issue with handling maps in LHS of drools. Appreciate your help with the same.
I am using Drools version 5.1.
I have two maps where one is a reference map that contains certifications (key) and scores(value) required and other is map of user's actual certifications and scores. Objective is to find the certifications from users map based on keys in the reference map . Then for these certifications sum the score values and check if they cross the threshold.
While trying to do the first step i am facing an issue . My rule looks like this :-
rule "Map test"
when
$rb : Certifications($reqCertificationKeys : requiredCertifications.keySet)
$user : User($userCertifications : userCertifications)
$arg : String() from $reqCertificationKeys
HashMap ($value : this[$arg] != null) from $userCertifications // Does not work
then
System.out.println ("Hash Map" + $arg);
end
However if i change the above line that has issues with below
HashMap ($value : this["Java"] != null) from $userCertifications // Works
Is there a way to replace the key with a variable than with a fixed value ? Is it possible to iterate the second map with the key values that we get from the reference map ?
Regards,
Manav
12 years, 4 months