Workitems doesn't get persisted when completing a task after rehydrating a knowledge session is some circumstances.
by Alberto R. Galdo
Hi,
We have a fairly large BPMN process running inside a JPA persisted
StatefulKnowledgeSession using Drools 5.4 & JBPM 5.3. Our process involves
timers, automated tasks, human tasks .... most of them are long-running
processes, so a fault-tolerant scenario is a must.
We've found what seems to be a weird, weird bug in JBPM-Drools
regarding the execution of BPMN processes. This is by best to summarize the
problem:
"We are unable to complete a human task after rehydrating a Drools
knowledge session because in some circunstances the generated Drools'
workitems don't get persisted in the database after the completion of a
previous task"
So, as the workitem is not in the database, when a human task client
completes a task that is related to that non-existent workitem, the process
doesn't get restarted. And the process fails.
¿Why does this happens? Lets see:
When the processs is executed, different workitems get created,
updated and eventually deleted during the execution of a process up until a
human task is created ( in our process ). When living in a persistet
knowledge session, the transaction that is associated to Drools' thread is
commited right after the human task is created in the human task server ...
as it is a "safe point". Nothing here. Everithing is consistent, if you
look at the database you will see your session instance, your process
instance, and the final human task workitem as it is the only workitem
survivor after the execution ( whatever hadler-managed automated task that
were executed before the human task are deleted and the human task workitem
needs to survive as it's completion depends on asyncronous client
interaction ).
Now, if you connect to the human task server and complete that human
task, a message is sent to the Drools session to update the state of the
work item. The workitem gets updated, the process get restarted and the
flow continues ... maybe generating a new human task ( which is our case ).
At this very moment, if you take a look at the database, there are no
automated-handled-task workitems ( as expected ) but there isn't any human
task related work item, even worse, the task at the human task server is
created, persisted and has a reference to the non-existant workitem.
Days of debugging led us to what we think is the source of the problem:
We found that the execution of the process after completing a task is
being executed in the same thread as the one that receives the mina message
that the human task server sends whenever a task is completed. This thread
is not the same thread that executes the knowledgesession ( where the
reteoo lives ) and so it doesn't have a transaction. By the way, we found
that for workitem persistence the JPAWorkitemManager never joins an active
transaction. :(
That's why invoking the persistence of a workitem as a consequence of
restarting the execution of a process inside the thread that receives the
mina messages makes the database inconsistent, and so invalidating all
means to make JBPM fault tolerant by making Drools session persistent.
We found a way to circunvent this problem, making all our human task
nodes be followed by a event timer. That way, when the timer gets completed
we force the execution of the process to live in the same thread that the
reteoo session lives where a transaction is available and things get back
to normal. But this is really dirty and wrong.
Any thoughts?
We are really eager to be wrong whith this. :'(
Greets,
Alberto R. Galdo
argaldo(a)gmail.com
12 years, 6 months
JBPM & ontology
by Olfa h
Hi,
How i can integrate ontology created with Protégé with JBPM ?
can you give me an example
thank you
12 years, 6 months
Help please!!!
by paco
I want to detect the conflict between the rules with Drools Verifier. For
example the first condition of the second rule is present in the first rule
and the actions to perform are the same in both rules as they demonstrate in
the following case. It works very well when these rules belong to the same
drl file.
--------- fichier a.drl---------------------------
rule "a"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0
then
Action1
end
rule "b"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0 && B==1
then
Action1
end
The problem arises when I separated its rules and that I have to put each in
its own file
---------------- a.drl----------------
rule "a"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0
then
Action1
end
------------------b.drl--------------------
rule "b"
no-loop true
ruleflow-group "group1"
dialect "mvel"
when
A==0 && B==1
then
Action1
end
I can no longer detect this problem with Drools Verifier.
Does anyone ever encountered this problem?
How can I do to write a small program to audit if this case?
--
View this message in context: http://drools.46999.n3.nabble.com/Help-please-tp4018136.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months
Guvnor access DB2 using kerberos
by yan.d.zhang@accenture.com
Hi,
I am currently using Drools Guvnor 5.4.0-Final, and trying to connect it to DB2 database using Kerberos.
I downloaded the db2 jdbc jars, modified repository.xml file, and also created the database schema manually into DB2 according to db2.ddl file in jackrabbit-core-2.2.8.jar.
However, I still get the following errors in log file:
- "failed to initialize File System"
- "Cannot create PoolableConnectionFactory (DB2 SQL Error: SQLCODE=-1060, SQLSTATE=08004, SQLERRMC=ECSTST, DRIVER=3.57.82)"
Is there any specific steps I have to do to connect Guvnor to DB2 using kerberos?
Thank you,
Yan
________________________________
Subject to local law, communications with Accenture and its affiliates including telephone calls and emails (including content), may be monitored by our systems for the purposes of security and the assessment of internal compliance with Accenture policy.
______________________________________________________________________________________
www.accenture.com
12 years, 6 months
Need Suggestion about what rule engine to use
by debchamps
Hi,
I have an application where I will be requiring rule engine in two places.
Use case1
-------------
I have around 15 rules(It is likely to change very rarely) which are like
truth table
var1 var2 var3 var4 Action
true false false true add x,y,z to list
false false false true set x = todaysDate +3
Use case2
------------
There is lots of rules (atleast 10000 and growing)
and the rules is like
var1 = 'x' and var2 = 'y' set x=1
var2 = 'e' and var5 = 'f' add 'Ram' to list B
The rules can be added dynamically and at anytime(absolute necessity)
Currently we are using a rules engine which is coded by ourself where we
load rules and actions from memory every 15 minutes and execute the rules
engine. However if the rules grow like anything we may face problem in the
future
The use case1 can be implemented by the existing rules engine. But inserting
the rules in the database is a problem area in the current implementation
other than some standard cases like Use case2
I need suggestion on how to approach the problem and what rule engine to use
: -
1> Move everything to a new Rule Engine
2> Have use case 2 in the old rule engine and use case 1 in new Rule Engine
(Is it good ... )
3> Have everything in the old RuleEngine
So in case of a new Rule Engine what is recommended ??
Thanks and Regards,
NewBie in RuleEngine
--
View this message in context: http://drools.46999.n3.nabble.com/Need-Suggestion-about-what-rule-engine-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months
How to import functions from other package?
by Zhao Yi
I have two drl files. They are in different packages. In one
drl(function.drl) file, I declare some functions and in the other
file(logic.drl), it needs to use these function. But when I build the drl
file, I always get the error when add logic.drl file. If I remove the
package in logic.drl, then it works fine. The functions will go into default
package. How can I import the functions from other package name?
Thanks,
Zhao Yi
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-import-functions-from-other-pack...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months
List in for Decision Table
by debchamps
Hi,
I need to have a action where I need to insert all the element of a list
specified in a excel cell into a ArrayList. The number of member specified
in the cell can vary. So how can I add them
So the excel sheet will look something like
the cell will contain
"1","2","3"
and If a list was initially "4" "5" Then now it will be "1","2","3","4","5"
??
--
View this message in context: http://drools.46999.n3.nabble.com/List-in-for-Decision-Table-tp4018230.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months
Drools-guvnor simple example Help
by abhinay_agarwal
i m pretty new to this tool..ve started using it a few days ago...
now wat i need to do is to create rules for a bank account..
i ve different rules for opening a savings account and different for
creating a current account..
and der are some rules which sud be satisfied by both the customers..(common
rules)
for ex : if rule1 and rule2 are common rules
rule 3 and rule 4 for opening a savings a/c
rule 5 and rule 6 for opening a current a/c
For savings a/c and current a/c i created two different packages and created
rules in dem..
Now wat do i do for the common rules and how do i maintain the flow that 1st
rule1 sud b checked then rule 2..den either rule3/4 sud b checked n
likewise..
hope you understand my question..if any doubts..please ask..m new to this
tool..dun ve much idea so plz b as explanatory as you can while explaining
!!!
tnxx in advance !! :)
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-guvnor-simple-example-Help-tp401...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 6 months