<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I don’t understand what you meant by
storing the HttpServletRequest object? With the default marshalling strategy
for JPA in place I don’t think you can insert a non serializable object? How
come this piece of code is working fine at your end?<o:p></o:p></span></font></p>
<p class=MsoNormal><b><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS";font-weight:bold'>loadSession.insert(request);</span></font></b><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Which set of objects are you looking from
the request? May be you want to get hold of the request parameter map -- or
create a list of attribute map and insert those instead of HttpServletRequest
object<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Am I missing something of what you meant
in your email?<o:p></o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
Pardeep.Ruhil@lntinfotech.com [mailto:Pardeep.Ruhil@lntinfotech.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, November 18, 2009
10:15 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Vijay K Pandey;
rules-users@lists.jboss.org<br>
<b><span style='font-weight:bold'>Cc:</span></b> kris.verlaenen@cs.kuleuven.be<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [rules-users] Drools
Flow :Persistence Problem : Restore StatefulKnowledgeSession from database</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
</span></font><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS"'>Hi Vijay,</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>Thanks for your reply.</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>The problem is that object that I am inserting it into the
session object is NOT serializable, as you know HttpServletRequest object is
not serializable.</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>So because of this I am not able to store this object into the
database.</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>So that's why I am asking how can i do this if my object is not
serilizable.</span></font> <br>
<br>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>Thanks & Regards<br>
<br>
Pardeep Ruhil<br>
nt (s) If you are not the intended recipient, please do not use or disseminate
the information, notify the sender and delete it from your system. </span></font><br>
<br>
<o:p></o:p></p>
<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
style='width:100.0%'>
<tr>
<td width="40%" valign=top style='width:40.0%;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b><font size=1 face="Trebuchet MS"><span
style='font-size:7.5pt;font-family:"Trebuchet MS";font-weight:bold'>Vijay K
Pandey <VPandey@mdes.ms.gov></span></font></b><font size=1
face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>
</span></font><o:p></o:p></p>
<p><font size=1 face="Trebuchet MS"><span style='font-size:7.5pt;font-family:
"Trebuchet MS"'>11/18/2009 10:56 PM</span></font> <o:p></o:p></p>
</td>
<td width="59%" valign=top style='width:59.0%;padding:.75pt .75pt .75pt .75pt'>
<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
style='width:100.0%'>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal align=right style='text-align:right'><font size=1
face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>To</span></font><o:p></o:p></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
7.5pt;font-family:"Trebuchet MS"'>"Pardeep.Ruhil@lntinfotech.com"
<Pardeep.Ruhil@lntinfotech.com>,
"rules-users@lists.jboss.org" <rules-users@lists.jboss.org></span></font>
<o:p></o:p></p>
</td>
</tr>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal align=right style='text-align:right'><font size=1
face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>cc</span></font><o:p></o:p></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
7.5pt;font-family:"Trebuchet MS"'>"kris.verlaenen@cs.kuleuven.be"
<kris.verlaenen@cs.kuleuven.be></span></font> <o:p></o:p></p>
</td>
</tr>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal align=right style='text-align:right'><font size=1
face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>Subject</span></font><o:p></o:p></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
7.5pt;font-family:"Trebuchet MS"'>RE: [rules-users] Drools Flow
:Persistence Problem : Restore StatefulKnowledgeSession from database</span></font><o:p></o:p></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<table class=MsoNormalTable border=0 cellpadding=0>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<br>
</span></font><font size=2 color=navy face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:navy'>You have to load the same ‘<b><span
style='font-weight:bold'>StatefulKnowledgeSession</span></b>’ in which you have
inserted your objects</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>. </span></font><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>The inserted objects are serialized and stored in the column “<b><span
style='font-weight:bold'>rules_byte_array</span></b>” of the <b><span
style='font-weight:bold'>session_info</span></b> table. </span></font><br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>So you have to load the same session – to get to your
inserted objects. </span></font><br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>There is a difference the way process map objects are handled
– such as</span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
Map<String, Object> parameters = <b><font
color="#820040"><span style='color:#820040;font-weight:bold'>new</span></font></b>
HashMap<String, Object>();</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
parameters.put(<font color="#4200ff"><span
style='color:#4200FF'>"x"</span></font>, <font color="#4200ff"><span
style='color:#4200FF'>"hello"</span></font>);</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
parameters.put(<font color="#4200ff"><span
style='color:#4200FF'>"y"</span></font>, <font color="#4200ff"><span
style='color:#4200FF'>"hey I am y"</span></font>);</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
ksession.startProcess( <font color="#4200ff"><span
style='color:#4200FF'>"myprocess"</span></font>, parameters );</span></font>
<br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>In the above case the parameters are not stored as part of
the “session info” table. These are stored separately like in “process instance
info” table + (some/other tables if you use variable persistence strategy)– so
if you don’t have the rules which are based on the objects you are inserting –
you can get the same done through process parameters in which case you can get
hold of the process instance through any new session or the same session
and then its parameters.</span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Vijay</span></font> <o:p></o:p></p>
<p class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center>
</span></font></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
</span></font><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
Pardeep.Ruhil@lntinfotech.com [mailto:Pardeep.Ruhil@lntinfotech.com] <b><span
style='font-weight:bold'><br>
Sent:</span></b> Wednesday, November 18, 2009 12:38 AM<b><span
style='font-weight:bold'><br>
To:</span></b> rules-users@lists.jboss.org<b><span style='font-weight:bold'><br>
Cc:</span></b> kris.verlaenen@cs.kuleuven.be; Vijay K Pandey<b><span
style='font-weight:bold'><br>
Subject:</span></b> Re: [rules-users] Drools Flow :Persistence Problem :
Restore StatefulKnowledgeSession from database</span></font> <br>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Hi Kris,</span></font> <font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><br>
Thanks for you valuable input and Vijay of course clearing some of my doubts by
asking question on this.</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Much of my doubt are clear except one. <br>
When we are reloading the StatefulKnowledgeSession from the database using the
below line</span></font> <font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><br>
</span></font> <font size=2 face="Courier New"><span style='font-size:
10.0pt;font-family:"Courier New"'><br>
StatefulKnowledgeSession loadSession= JPAKnowledgeService.<i><span
style='font-style:italic'>loadStatefulKnowledgeSession</span></i>(id, <i><font
color="#0021bf"><span style='color:#0021BF;font-style:italic'>kbase</span></font></i>,
<b><font color="#820040"><span style='color:#820040;font-weight:bold'>null</span></font></b>,
<i><font color="#0021bf"><span style='color:#0021BF;font-style:italic'>env</span></font></i>);</span></font>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
This session object is different from the one that is created when we first
created <br>
StatefulknowledgeSession object using </span></font><br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><br>
StatefulKnowledgeSession <b><span style='font-weight:bold'>initialSession</span></b>=
JPAKnowledgeService.<i><span style='font-style:italic'>newStatefulKnowledgeSession</span></i>(<i><font
color="#0021bf"><span style='color:#0021BF;font-style:italic'>kbase</span></font></i>,
<b><font color="#820040"><span style='color:#820040;font-weight:bold'>null</span></font></b>,
<i><font color="#0021bf"><span style='color:#0021BF;font-style:italic'>env</span></font></i>);</span></font>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Am I right ?</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Now In my case I have a <b><span style='font-weight:bold'>HumanWorkItemHandler</span></b>
class for handling the <b><span style='font-weight:bold'>humantask</span></b>
and there is<b><span style='font-weight:bold'> ActionWorkITemHandle</span></b>r
for my customAction workItem, which both are initailsed with the <b><span
style='font-weight:bold'>initialSession </span></b>object.</span></font> <font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'><br>
Now when I load the session from the database to complete the
HumanWorkItemHandler task I got a different session object i.e. <b><span
style='font-weight:bold'>loadSession. </span></b><br>
Now when I insert something in the loadsession using <b><span
style='font-weight:bold'>loadSession.insert(request);</span></b> So that I can
use the same in ActionWorkItemHandler to exceute the action for the request. <br>
I am not able to retrieve the same request object i.e. (HttpServletRequest)
from the session in ActionWorkItemHandler <br>
as when i do <br>
Collection obj = loadSession.getObject();</span></font>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
I get request as <b><span style='font-weight:bold'>null. </span></b>
Because this loadSession is different from the one I have inserted.</span></font>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Kindly help in this, or I have misunderstood the concept. </span></font><br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Thanks & Regards<br>
<br>
Pardeep Ruhil</span></font><o:p></o:p></p>
<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
style='width:100.0%'>
<tr>
<td width="33%" valign=top style='width:33.0%;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b><font size=1 face="Trebuchet MS"><span
style='font-size:7.5pt;font-family:"Trebuchet MS";font-weight:bold'>Kris
Verlaenen <kris.verlaenen@cs.kuleuven.be></span></font></b><font
size=1 face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>
</span></font><o:p></o:p></p>
<p><font size=1 face="Trebuchet MS"><span style='font-size:7.5pt;font-family:
"Trebuchet MS"'>11/17/2009 04:17 PM</span></font> <o:p></o:p></p>
</td>
<td width="66%" valign=top style='width:66.0%;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
style='width:100.0%'>
<tr>
<td width="6%" valign=top style='width:6.0%;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal align=right style='text-align:right'><font size=1
face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>To</span></font><o:p></o:p></p>
</td>
<td width="93%" valign=top style='width:93.0%;padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
7.5pt;font-family:"Trebuchet MS"'>Rules Users List <rules-users@lists.jboss.org>,
Vijay K Pandey <VPandey@mdes.ms.gov></span></font> <o:p></o:p></p>
</td>
</tr>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal align=right style='text-align:right'><font size=1
face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>cc</span></font><o:p></o:p></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
7.5pt;font-family:"Trebuchet MS"'>"Pardeep.Ruhil@lntinfotech.com"
<Pardeep.Ruhil@lntinfotech.com></span></font> <o:p></o:p></p>
</td>
</tr>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal align=right style='text-align:right'><font size=1
face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>Subject</span></font><o:p></o:p></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
7.5pt;font-family:"Trebuchet MS"'>Re: [rules-users] Drools Flow
:Persistence Problem : Restore StatefulKnowledgeSession from database</span></font><o:p></o:p></p>
</td>
</tr>
</table>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><br>
<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<table class=MsoNormalTable border=0 cellpadding=0>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><o:p></o:p></span></font></p>
</td>
</tr>
</table>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
<br>
</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><br>
Preferably you should cache the session itself as well (so you don't<br>
have to recreate it all the time) and reuse that across you application.<br>
Or you could have multiple independent sessions as well. If you store<br>
the key of the session somewhere, you can easily restore this session<br>
(or sessions) after failure.<br>
<br>
Kris<br>
<br>
Quoting Vijay K Pandey <VPandey@mdes.ms.gov>:<br>
<br>
> Let's say where we don't need timers - in those cases one can create<br>
> (create only if its not there) a global session (create the<br>
> sessioninfo at the drools startup - store the session primary key<br>
> somewhere) - reuse this session across everywhere?<br>
> <br>
> Vijay<br>
> -----Original Message-----<br>
> From: rules-users-bounces@lists.jboss.org<br>
> [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Kris<br>
> Verlaenen<br>
> Sent: Monday, November 16, 2009 5:12 PM<br>
> To: Rules Users List; Pardeep.Ruhil@lntinfotech.com<br>
> Subject: Re: [rules-users] Drools Flow :Persistence Problem : Restore<br>
> StatefulKnowledgeSession from database<br>
> <br>
> Pardeep,<br>
> <br>
> The behavior you are describing is indeed correct. The session in<br>
> this<br>
> case is a global session, meaning that it will be used for all<br>
> process<br>
> instances. Note however that, unless you are using timers, all<br>
> other<br>
> state (process instance state, work items, etc.) is persisted<br>
> separately<br>
> and the session state will basically be empty.<br>
> <br>
> It is also possible to have one session per process instance (or<br>
> whatever partitioning you like). A session has a unique id (which<br>
> you<br>
> can specify when reloading the session). You'll then have to load<br>
> the<br>
> right session before continuing the execution of your process<br>
> instance.<br>
> <br>
> Kris<br>
> <br>
> Quoting Pardeep.Ruhil@lntinfotech.com:<br>
> <br>
> > Hi Salaboy,<br>
> > Thanks for you replying.<br>
> > Yes, of course it is storing multiple process instance Id in the<br>
> > database.<br>
> > But, what I feel is that it will fail when I am trying to run two<br>
> > workflow<br>
> > at the same time simultaneously, using the same code by<br>
> dynamically<br>
> > providing the workflow name and the parameters for each of them.<br>
> > Ideally there should be two entries for the<br>
> StatfulKnowledgeSession<br>
> > object<br>
> > because when I try to load the StatefulKnowledgeSession object<br>
> from<br>
> > the<br>
> > database it will give me the session object of the workflow which<br>
> is<br>
> > last<br>
> > executed.<br>
> ><br>
> > For example lets suppose I have two workflow 1 and 2 having two<br>
> > humantask<br>
> > in each of them . So when I finish the first Human Task of both<br>
> > workflow<br>
> > one by one. SessionInfo present in the database is of
workflow 2<br>
> > (if 2<br>
> > is executed last). Because there is no field in the sessioninfo<br>
> > entity of<br>
> > the database regarding to which workflow it belongs to. Am I right<br>
> ?<br>
> > So when I try to finish the 1st workflow by executing the 2nd<br>
> > humantask<br>
> > left in it , I need to reload the StatfulKnowledgeSession object<br>
> from<br>
> > the<br>
> > database. As there is no way of distinguishing that the session<br>
> > object<br>
> > store in the database is of which workflow , there might be a<br>
> problem<br>
> > as I<br>
> > may get the ksession object of 2nd workflow.<br>
> ><br>
> > In case of Process Instance it is fine , because there is a field<br>
> > 'processId' which will distinguish which processInstanceId belongs<br>
> to<br>
> ><br>
> > which worklowId or processId.<br>
> > But in case of Session , there is noting as such.<br>
> > I don't what I am saying is handled in drools persistence. Please<br>
> let<br>
> > me<br>
> > know if it there or not.<br>
> ><br>
> > Thanks & Regards<br>
> ><br>
> > Pardeep Ruhil<br>
> ><br>
> ><br>
> ><br>
> ______________________________________________________________________<br>
> <br>
> <br>
> <br>
> <br>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm<br>
> _______________________________________________<br>
> rules-users mailing list<br>
> rules-users@lists.jboss.org<br>
> https://lists.jboss.org/mailman/listinfo/rules-users<br>
> _______________________________________________<br>
> rules-users mailing list<br>
> rules-users@lists.jboss.org<br>
> https://lists.jboss.org/mailman/listinfo/rules-users<br>
> <br>
<br>
<br>
<br>
<br>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm<br>
<br>
______________________________________________________________________</span></font><br>
<br>
<br>
______________________________________________________________________ <o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
______________________________________________________________________ <o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
______________________________________________________________________<o:p></o:p></span></font></p>
</div>
</body>
</html>