<br><font size=2 face="sans-serif">Chris, Anatoly, Mauricio,<br>
</font>
<br><font size=2 face="sans-serif">Thanks for your replies. I had implemented
a solution similar to that suggested by Chris; my work item handlers are
defined as Spring beans, so as long as they are defined with scope=&quot;prototype&quot;,
the knowledge session can be injected into the handler.</font>
<br><font size=2 face="sans-serif">I just wondered if there was a &quot;simpler&quot;
way of determining the session directly from the work item.</font>
<br>
<br><font size=2 face="sans-serif">Anyway, thanks again for your help,</font>
<br>
<br><font size=2 face="sans-serif">Alan</font>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Mauricio Salatino &lt;salaboy@gmail.com&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: rules-users-bounces@lists.jboss.org</font>
<p><font size=1 face="sans-serif">04/05/2010 16:53</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
Rules Users List &lt;rules-users@lists.jboss.org&gt;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Rules Users List &lt;rules-users@lists.jboss.org&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [rules-users] Drools Flow: how to
get knowledge session ID from &nbsp; &nbsp; &nbsp; &nbsp;WorkItem</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3>Anatoly, if you can share your generic implementation
that would be nice.. because a lot of people is looking for something like
that.<br>
I prefer custom and domain specific implementation, but it seams that a
lot of people is looking for something generic that can be reused.<br>
I can blog about that generic idea too to spread the word and also mention
the different situations and the perspective of having decoupled and coupled
applications to the work items.<br>
</font>
<br><font size=3>On Tue, May 4, 2010 at 11:16 AM, tolitius &lt;</font><a href=mailto:webakaunt@gmail.com><font size=3 color=blue><u>webakaunt@gmail.com</u></font></a><font size=3>&gt;
wrote:</font>
<br><font size=3><br>
@Alan,<br>
<br>
&nbsp; &nbsp;Implementation of WorkItemHandler is a custom ( &quot;your&quot;
) component. This<br>
means that this implementation may have anything injected ( set as property<br>
or at construction time ).<br>
<br>
&nbsp; &nbsp;Let's say you implement &quot;YourCustomWorkItemHandler&quot;
to take a &quot;session<br>
id&quot; at the construction time ( good choice :) ), then to start the
process<br>
you would:<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;session = create
a newStatefulKnowledgeSession()<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;session.getWorkItemManager().registerWorkItemHandler(<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;WorkItemName&quot;, new YourCustomWorkItemHandler(
session.getId() ) );<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;session.startProcess(
&quot;process-name&quot; );<br>
<br>
/Anatoly</font><font size=3 color=#8f8f8f><br>
--<br>
View this message in context: </font><a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-how-to-get-knowledge-session-ID-from-WorkItem-tp775649p776358.html" target=_blank><font size=3 color=blue><u>http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-how-to-get-knowledge-session-ID-from-WorkItem-tp775649p776358.html</u></font></a><font size=3 color=#8f8f8f><br>
Sent from the Drools - User mailing list archive at Nabble.com.</font>
<br><font size=3>_______________________________________________<br>
rules-users mailing list</font><font size=3 color=blue><u><br>
</u></font><a href="mailto:rules-users@lists.jboss.org"><font size=3 color=blue><u>rules-users@lists.jboss.org</u></font></a><font size=3 color=blue><u><br>
</u></font><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target=_blank><font size=3 color=blue><u>https://lists.jboss.org/mailman/listinfo/rules-users</u></font></a>
<br><font size=3><br>
<br>
<br>
-- <br>
- </font><a href=http://salaboy.wordpress.com/><font size=3 color=blue><u>http://salaboy.wordpress.com</u></font></a><font size=3><br>
- </font><a href=http://www.jbug.com.ar/><font size=3 color=blue><u>http://www.jbug.com.ar</u></font></a><font size=3><br>
- Salatino &quot;Salaboy&quot; Mauricio -</font><tt><font size=2>_______________________________________________<br>
rules-users mailing list<br>
rules-users@lists.jboss.org<br>
https://lists.jboss.org/mailman/listinfo/rules-users<br>
</font></tt>
<br>