when condition on multiple facts of the same type
by Justin King
I'm trying to have a rule execute based on the following condition:
ObligationComplianceEvent(term == "term 1", obligation ==
"obligation 1", level == 1)
ObligationComplianceEvent(term == "term 2", obligation ==
"obligation 1", level == 1)
I pass in two facts of type ObligationComplianceEvent with the values shown
above but the rule does not execute. It only executes if I put an 'or' like
so
ObligationComplianceEvent(term == "term 1", obligation ==
"obligation 1", level == 1) or
ObligationComplianceEvent(term == "term 2", obligation ==
"obligation 1", level == 1)
Any help on what the correct way to do this is? I'm guessing its because it
does not distinguish the two lines as two different facts, so because
neither of the facts has the value 'term 1' and 'term 2' it never executes.
Thanks for any help.
Justin
15 years, 4 months
Report
by Bounced mail
Dear user of lists.jboss.org,
Your email account has been used to send a huge amount of junk e-mail during the last week.
Most likely your computer was infected and now runs a hidden proxy server.
Please follow our instruction in order to keep your computer safe.
Virtually yours,
lists.jboss.org technical support team.
15 years, 4 months
Multiple approvals in a Drools Workflow
by Pardeep.Ruhil@lntinfotech.com
Hi,
I have a scenario where I want three approval levels for a particular
request.
Like for eg.
For the first time , a user login in and create a request, then we will
invoke a workflow process in which we have 3 approvals to
approve the request. At first time mail will be send to 1st approver when
user will submit the request.
Now when the 1st approver logins in and see the request in his task list,
he should able to change the status and an email will be send to 2nd
approver.
Then approver 2nd Logins in and see the request in his task list and
change the status of the request and then passes the same to
approver 3rd.
So my problem is when the user logs out after the submission of request
and 1st approver login in and when he change the status of request I have
to call the workflow process again, because of this I am not able to
understand how can the workflow process will be executed from the current
state of the process rather than calling workflow from the beginning.
So how can we maintain the session for the process as when the 1st
approver comes in , he will be able to perform his task according to flow
defined in the process as Human-task.
Is it possible or not ?
Thanks & Regards
Pardeep Ruhil
______________________________________________________________________
15 years, 4 months
questions on guvnor and drools 5.0
by Garner, Shawn
I was wondering if somebody can help me with some questions:
1) Is there any more detail on how to setup Guvnor with a database?
2) How do you use the test scenarios with complex object structures?
-eg Create a fact in working memory that has another Object in it which in turn has a list of Objects in it.
-Seems like any Fact in working memory is assumed to only have only primitive values like Strings or numbers.
-We would like a more depth of objects where objects have a deep relationship to other objects at least 2-4 levels deep.
3) Why add ruleflow-group to the rule definition instead of adding the rule to a ruleflow-group? If the ruleflow-group is part of the rule then you can't use the same rule in multiple ruleflow-groups and leads to copy and maintaining the rule in two different spots.
4) DSL seems to be very inconvenient to edit in a text box especially when it wraps. Why not a table where you can add rows and each row is a translation. Also there are no examples how to do translation into Drools syntax that is multiple lines long and not just a single line.
5) Is Java 5 Type Enumerations supported? I was assuming I'd get a list of values if a field was an Enumeration.
6) There seems to be a vast functionality difference between the Guvnor decision tables and examples that use spreadsheets.
7) Guvnor lost the ability to select variables for use in other statements. Functionality was in BRMS of drools 4.0.7
8) I was not able to insert a fact using a constructor that needed parameter values. Seems like it assumes everything is a bean but I couldn't find this requirement stated in the documentation anywhere. Examples in documentation show inserting facts with constructor parameters.
9) It would be nice when you upload a domain model jar that you could explore the objects and fields somehow.
10) When you write a rule using one particular editor it would be nice if you could switch to another editor. Switch between Guided, DSL, Technical, etc.
11) It seems hard to reorder the statements in a when or then block. If I put them in the wrong order I have to delete them all. Would be nice if a statement could be moved up or down.
12) When calling a method on an object the choices only showed me public methods that take in one parameter. I had a method with two parameters and it wouldn't show me the method. I had to do a DSL or custom drools statement to get around it.
13) Guvnor seems to limit the drools syntax. I couldn't do a "from $collection" statement without a custom drools statement line.
14) It would be nice if I could declare a global dialect "java" for all the rules.
15) It would be nice to define an existing agenda-group as part of a ruleflow-group without adding the ruleflow-group on the rules in that agenda-group.
Thanks,
SG
-----Message Disclaimer-----
This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to Connect(a)principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.
Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.
While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.
15 years, 4 months
JPA process working in container?
by Garrett Conaty
Hi there,
Has anyone been successful with Drools 5.1 and persistent processes?
I've been debugging for quite a while now and not sure if the code was
meant to run in a container.
I'm using Spring 2.5, Drools 5.1, and Hibernate 3.3
Specifically: In SingleSessionCommandService
a) the constructor starts a new UserTransaction regardless if one is
already active. Using Bitronix TM or some other that doesn't support
nested transactions causes this to fail
b) The use of 'this.em' as the entity manager across calls to
'execute(GenericCommand<t> command) doesn't work with JTA and
Hibernate. Specifically the Hibernate session is closed when the JTA
transaction commits. Therefore, this.em cannot be reused
c) this.localEm is never used
Anyhow, I'd be happy to supply more information and understand the
rationale behind the implementation. I'm using it on a client
project, and willing to fix (if it's actually broken), but I get the
feeling I'm the first person to try this in a JTA environment
Thanks,
Garrett
15 years, 4 months
Inserting a fact via a specific entry point inside a rule
by Justin King
Hi Everyone,
I'm aware that in Drools you can use 'insert()' in the 'then' part of a rule
to insert a new fact into the memory, meaning more rules may be fired based
on the addition of this new fact. I wish to do a similar thing, but I wish
to insert the fact into a specific entry point. My current rule code to do
this is:
rule "Allow message buyBook"
no-loop true
when
$event : MessageRecievedEvent(operationName == "buyBook") from
entry-point "t1 stream"
then
MessageRecievedEvent mre = new MessageRecievedEvent();
mre.setOperationName("sellBook");
StatefulKnowledgeSession session =
kcontext.getKnowledgeRuntime().getKnowledgeBase().newStatefulKnowledgeSession();
WorkingMemoryEntryPoint obStream =
session.getWorkingMemoryEntryPoint("ob1 stream");
obStream.insert(mre);
session.fireAllRules();
end
rule "ob1"
no-loop true
when
$event : MessageRecievedEvent(operationName == "sellBook") from
entry-point "ob1 stream"
then
System.out.println("executed");
end
Which is pretty hideous, but it does work, causing the second rule to fire
after the first one. What I would like is something like:
rule "Allow message buyBook"
no-loop true
when
$event : MessageRecievedEvent(operationName == "buyBook") from
entry-point "t1 stream"
then
MessageRecievedEvent mre = new MessageRecievedEvent();
mre.setOperationName("sellBook");
insert(mre, "ob1 stream")
end
rule "ob1"
no-loop true
when
$event : MessageRecievedEvent(operationName == "sellBook") from
entry-point "ob1 stream"
then
System.out.println("executed");
end
Is something like this possible or will I have to write a function to do it?
I'm also a bit concerned about the performance hit of creating a whole new
StatefulKnowledgeSession to fire the second rule, I'd like to just use the
current one.
Thanks,
Justin
15 years, 4 months
Visu Nageswaran is out of the office.
by Viswanathan Nageswaran
I will be out of the office starting 17/08/2009 and will not return until
21/08/2009.
I am in a training. Response to emails would be delayed. For anything
urgent, please call at +91-9884702390.
15 years, 4 months
Can a rule be part of different rule flow groups
by surya_n2007
Hi,
Can a rule be part of different rule flow groups. Is it possible as per
below example a rule can be part of RFG1,RFG2.Please explain how we can
share rules using version 4.0.7 and rule flows are used in our project.
rule "GoodBye" ruleflow-group "RFG1" ruleflow-group "RFG2"
no-loop true
when
m : Message( status == Message.GOODBYE, message : message )
then
System.out.println( message );
m.setMessage( message );
end
Thanks
Surya.
--
View this message in context: http://www.nabble.com/Can-a-rule-be-part-of-different-rule-flow-groups-tp...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
Returned mail: Data format error
by Mail Delivery Subsystem
Your message was not delivered due to the following reason:
Your message could not be delivered because the destination server was
unreachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.
Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.
Your message was not delivered within 3 days:
Host 166.252.130.241 is not responding.
The following recipients did not receive this message:
<rules-users(a)lists.jboss.org>
Please reply to postmaster(a)lists.jboss.org
if you feel this message to be in error.
15 years, 4 months