Performance differeneces using "before" or "after"
by Tina Vießmann
Hi,
I've mentioned the test case I'm working on before. It's: If a certain
value exceeds a limit more than X times within Y minutes/hours, do
something.
~> Count = X , time = Y
During a talk with other developers it came up that by intuition the men
would have chosen a other approach than the women. We can not agree if
in Drools both approaches are the same in performance or if one is more
performant.
Male approach: If a new event with a limit violation is received,
check if within the last time Y already X events with limit
violations are contained in the knowledge base .
Female approach: If a new event with a limit violation is received,
check if the following events contain X events with limit violation.
This is limited to a monitoring time of /maximal /Y. (If there have
been X events registered, before the time Y is elapsed, the window
will be closed right away.)
In code with Y = 1h it would be:
Male:
// determine new event as $triggeringEvent
$otherEvent : Value (this before[0ms,1h] $triggeringEvent)
Female:
// determine event that opened the window as $triggeringEvent
$otherEvent : Value (this after[0ms,1h] $triggeringEvent)
This is just a extract so that that the comments are in fact
meaningless. The focus lies on _before_ and _after_.
Is one solution more efficient?
Thanks! :)
Tina
15 years, 6 months
Guvnor declarative model and ASM deserialization
by Abdel Dridi
In my application I am using the following flow:
1. I am using Guvnor to allow customer to define business event structure
through the "Declarative Model" feature.
2. After defining the model, customers write rules and package them into
a snapshot where my event-driven-application-server can see.
3. My server load successfully the customer packages (couple hundreds of
them).
4. Customer uses HornetQ client to produce events that respects the model
that has been created using Guvnor.
5. I have HornetQ listeners in my application that listens to new events.
6. HornetQ listeners tries to deserialize the message bytes to an event
object to insert it to the customer ksession
The problem is that my server classloader has no idea about the model, so I
use ASM to inject the class definition when ClassNotFoundException is thrown
however this was not enough as serialVersionUID of client side object is
going to be different from the ASM default injected one.
I know some of you might say why cant I use the same static final
serialVersionUID in the client side as well as in the server side - the
answer is I want to give control to customers to define whatever business
model they want using Guvnor.
Using jar file model will not give freedom to business users that Guvnor
provide.
I am wondering if some of you were facing the same issue while using the
fusion message queue streaming gate?
I am thinking to extend the Java ObjectInputStream and implement my own
deserialization.
Could Drools ksession accept bytes along side with objects (I mean in the
future) - Something like; "ksession.insert(bytes)"
Any ideas?
Abdel
15 years, 6 months
Verify if an objects attribute exists
by lnguyen
I'm having difficulty writing this rule.
Background information:
A User can have a supervisor but it's not required.
When viewing User information I want to verify that the logged in user is
either the current user or the currentUser's supervisor but I throw an
exception when the supervisor object is null on the currentUser.
The target is the User being viewed and I have a global object that is the
current user. How can I check to see if the supervisor exists before
evaluating if the currentUser and the supervisor are equal?
rule 'CanViewUserData'
dialect 'mvel'
when
$user : User()
$supervisor : User( ) from $user.userProfile.supervisor
$check: PermissionCheck(target == $user, action == "viewUserData")
eval(isUserMatching($user)) || eval (isUserMatching($supervisor))
then
System.out.println("The currentUser CanViewUserData");
$check.grant();
end
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Verify-if-an-objects-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
User Permissions - at rules/DSL level possible?
by Vignesh
Hi,
I am aware that we can provide user permissions at Package/Category level
and restrict the users, but i want to know whether its possible to restrict
the users by providing permissions at rules/DSL level, because we dont want
the user to modify the DSL which would be defined by the Admin and other
users would simply be using the entries in DSL for defining their rules.
Is there any way to achieve this kind of permissions and also what is the
minimum granular level of permission that we can restrict a user from? if
any one has tried this kindly help me in this regard.
Thanks,
Vignesh
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/User-Permissions-at-r...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Drools list test
by Gustavo Tenrreiro
HI,
This is a test email.
My emails to the list don't seem to be getting there.
If anyone gets this, can you please let me know if you got it.
Thanks
15 years, 6 months
Invalid StatefulKnowledgeSession id returned
by Gustavo Tenrreiro
Hi,
I am having an issue where after creating a new
StatefulKnowledgeSession using JPA for persistence, the id returned by
the getId() method on the session returns 0, even though I can see the
session id in the database is not 0 but some other integer.
There are no exceptions thrown.
Does anyone know why this is?
Thanks
15 years, 6 months
How do sessions get removed from the database ?
by Gustavo Tenrreiro
Hi,
I am using StatefulKnowledgeSession and JPA for persistence.
I create a session for each Drools Flow process I start, so there is a
1 to 1 mapping between the session and the process.
When the process ends, I can see the process gets removed from the database.
How can the session be removed from the database as well ?
Do I need to do that manually ?
Thanks
15 years, 6 months