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.
14 years, 2 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.
14 years, 2 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
14 years, 2 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
14 years, 2 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
14 years, 2 months
How to catch two (or more) strictly sequential events
by Antonello Calabrò
Dear all,
I'm trying to develope a cep system using drools and java.
On my system, I instantiated the drools engine in Stream mode
and catch my events (called SimpleEvents and composed by (String id, Long
timestamp, String data)) correctly.
Now I'm trying to create a rule able to match simple pattern like A -> B or
A -> B -> C
Using the feature "after", I am able to know if eventB is preceded by a
eventA .. but this rule match even the pattern: A -> .....(events of any
kind different from B)... -> B
Question:
There's a way to know when (if) eventA is strictly followed by eventB ?
Thanks in advance ;)
--Antonello
14 years, 2 months
Subflow and Fault
by jschmied
Hi!
If I have a subflow without a exception hanlder and there is thrown a fault
inside, the exception handler of main process doesn't get the exception. The
main process goes on like the subprocess has finished orderly.
This is a bit surprising because the documentation says:
"Nesting of exception handlers is allowed; a node will always search for an
appropriate exception handler in its parent container."
- Is it right that the main process continous even a subprocess is broken?
(Could I use the Exit-Action to throw a fault when the subprocess is not
finished orderly?)
- Is it right that the exception doesn't go from the subprocess into the
mainprocess?
Thanks
Juergen
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Subflow-and-Fault-tp1...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
OWL (2 RL) reasoning support
by Semweb Developer
Hi all,
as far as I know, Drools does not support a built-in ruleset for reasoning on
OWL (2 RL) in the form of triple-based rules.
Is there any custom approach towards this field with a publicly available
ruleset for Drools?
thanks.
14 years, 2 months