How to manage roles and generate web-forms using Drools Flow?
by Aman Aggarwal
Hi all
I am creating a workflow(integrated into a Java web application) for a leave
application approval. The workflow is as follows:
Leave request is raised for an employee.
Case 1: If employee's role is not team lead.
The request is sent to employee's team lead.
If team lead rejects, workflow ends.
If team lead approves, request is forwarded to manager.
Case 2: If employee's role is team lead.
The request is directly sent to Manager.
Workflow ends when manager approves/rejects the application. At the time of
approval/rejection the user needs to enter a comment.
I need to generate web-form for user input. The options can be dynamic and
should be defined in workflow itself. How can I achieve this? What is the
right way to manage different directions of a workflow based on different
roles?
Any thoughts/suggestions are welcome. It will be helpful if someone can
direct me to example/sample code to achieve this.
--
Regards
Aman
http://www.IntelliGrape.com
14 years, 8 months
Couple of questions about Timers
by nanic23
Hi all,
I'm working with timers and I have a couple of questions.
1) If I have more than one timer in a ruleflow definition, will
ksession.fireUntilHalt()/ksession.fireAllRules() take care of
starting/initializing all timers? Is one thread enough for multiple timers
or I need to handle timers individually?
2) If my flow terminates (normally or abnormally) do I need to clean/restart
the timers?
Any help is appreciated.
Thanks,
Nick.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Couple-of-questions-a...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months
Timer Date definition for Timer nodes
by nanic23
Hi Drools community :)
As per the BPMN standard: "In Normal Flow the Timer Intermediate Event acts
as a delay mechanism based on a specific time-date or a specific cycle
(e.g., every Monday at 9am) can be set that will trigger the Event."
So, my question is: Does Drools supports something like this? Can we set,
for example, a timer to run once every Monday at 9am? I am familiar with
Timer Delay and Timer Period but I am not looking for this behavior. I am
rather looking to schedule a specific date and time (e.g. Monday's at 9am).
Is this possible? If so, How is it configured?
Thanks,
Nick.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timer-Date-definition...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months
drools-compiler 5.1.0.SNAPSHOT: transitive deps not set up right?
by ljnelson
I have a Maven project that depends on drools-compiler 5.1.0.SNAPSHOT.
When I run mvn dependency:tree on it, I notice that the compile scope
dependencies used by drools-compiler are not listed in the output (actually,
same for drools-core):
[INFO] mystuff:myproject:jar:1.0-SNAPSHOT
[INFO] +- org.drools:drools-api:jar:5.1.0.20100619.203626-283:compile
[INFO] +- org.drools:drools-core:jar:5.1.0.20100619.203626-282:compile
[INFO] +- org.drools:drools-compiler:jar:5.1.0.20100619.203626-282:compile
[INFO] +- org.glassfish:javax.resource:jar:3.1-b04:provided
[INFO] | \- org.glassfish:javax.transaction:jar:3.1-b04:provided
[INFO] \- junit:junit:jar:4.8.1:test
They are listed in the output if I use version 5.0.1.M2:
[INFO] mystuff:myproject:jar:1.0-SNAPSHOT
[INFO] +- org.drools:drools-api:jar:5.1.0.M2:compile
[INFO] +- org.drools:drools-core:jar:5.1.0.M2:compile
[INFO] | +- org.mvel:mvel2:jar:2.0.18:compile (version managed from 2.0.16)
[INFO] | +- com.sun.xml.bind:jaxb-impl:jar:2.0.3:compile
[INFO] | | +- javax.xml.bind:jaxb-api:jar:2.0:compile
[INFO] | | +- javax.xml.bind:jsr173_api:jar:1.0:compile
[INFO] | | \- javax.activation:activation:jar:1.1:compile
[INFO] | \- com.sun.xml.bind:jaxb-xjc:jar:2.0.3:runtime
[INFO] +- org.drools:drools-compiler:jar:5.1.0.M2:compile
[INFO] | +- org.antlr:antlr-runtime:jar:3.1.3:compile
[INFO] | +- org.antlr:gunit:jar:3.1.3:compile
[INFO] | | \- org.antlr:stringtemplate:jar:3.2:compile
[INFO] | | \- antlr:antlr:jar:2.7.7:compile
[INFO] | +-
org.apache.jasper.springsource:com.springsource.org.apache.jasper.org.eclipse.jdt.springsource:jar:6.0.20.S2-r5956:compile
[INFO] | \- janino:janino:jar:2.5.15:compile
[INFO] +- org.glassfish:javax.resource:jar:3.1-b04:provided
[INFO] | \- org.glassfish:javax.transaction:jar:3.1-b04:provided
[INFO] \- junit:junit:jar:4.8.1:test
One of my log messages seems to indicate that drools-compiler does not have
a POM:
[INFO] Unable to find resource
'org.drools:drools-compiler:pom:5.1.0.20100619.203626-282' in repository
jboss (https://repository.jboss.org/nexus/content/groups/public)
The Maven guys suspect a bad deployment. Is this something you folks need
to fix, or something that I've somehow messed up?
Thanks,
Laird
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/drools-compiler-5-1-0...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months
Accessing collections in conditional statements (inside/outside working memory)
by Evert Penninckx
Hi
I'm having trouble understanding how collections are accessed in conditions
and what this means in terms of perfomance. My app has concepts with a
unidirectional composite relation. Making it bidirectional, as suggested in
other posts, is really not preferred. This is the most natural model for
this business.
declare Parent
children : Collection // Collection<Child>
end
declare Child
anAttribute : String
end
With this set-up, I can think of only two rules to check for the existence
of a child and only one to check for the absence (without starting to check
for the size of a populated list, which seems farfetched and unreadable):
rule "01 - Parent has child - using contains"
when
$child : Child( )
Parent( children contains $child )
then
// do stuff
end
rule "02 - Parent has child - using from"
when
$parent : Parent( )
Child( ) from $parent.children
then
// do stuff
end
rule "03 - Parent does not have child - using from"
when
$parent : Parent( )
not Child( ) from $parent.children
then
// do stuff
end
1) Is the cost of the "contains" in rule 01 the same as the "from" in rule
02? Why (not)? If so, inserting the Child facts in the working memory seems
not necessary.
2) I read in other posts and the user guide that putting all facts in
working memory should be faster. Is it correct to say, that the perfomance
gain will only be achieved when not using the "from" CE and thus only by
using a bi-directional relation between Parent and Child?
In any case, it seems to me that stuffing child objects into working memory
shouldn't be the concern of a client calling a "rule service". So should
this be more optimal, I'd make the rules insert the facts using an
agenda/ruleflow to make sure everything is inserted before doing the
business stuff.
Greetz
-Evert
---
If you are posting a question, please try search first. Your question may
have already been answered.
Don't post repeatedly. Wait for a few days. People will read your post by
email.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Accessing-collections...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months