<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:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>You can manually add users via the OrganziationalEntity table:<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>User, Administrator<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>User, myuser<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Etc.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I am doing the following to start the task server:<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> Environment env =
KnowledgeBaseFactory.<i>newEnvironment</i>();</span><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:#0000C0'>taskServerEntityManagerFactory</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> = Persistence.<i>createEntityManagerFactory</i>(</span><span
style='font-size:10.0pt;font-family:"Courier New";color:#2A00FF'>"org.drools.task"</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> env.set(EnvironmentName.</span><i><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>ENTITY_MANAGER_FACTORY</span></i><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>taskServerEntityManagerFactory</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:#0000C0'>taskService</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> = </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> TaskService(</span><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>taskServerEntityManagerFactory</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>,
SystemEventListenerFactory</span><span style='font-size:10.0pt;font-family:
"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> .<i>getSystemEventListener</i>());</span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> </span><span style='font-size:
10.0pt;font-family:"Courier New";color:#0000C0'>server</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> = </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> MinaTaskServer(</span><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>taskService</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'> Thread thread = </span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:#7F0055'>new</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> Thread(</span><span
style='font-size:10.0pt;font-family:"Courier New";color:#0000C0'>server</span><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>);</span><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:black'> thread.start();</span><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b>On Behalf Of </b>Chuck.KS<br>
<b>Sent:</b> Monday, January 25, 2010 1:26 PM<br>
<b>To:</b> rules-users@lists.jboss.org<br>
<b>Subject:</b> Re: [rules-users] Human Task Example<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>I did see that I need to
populate users, but I didn't at first seen any instructions on how to do so.
Reading more carefully, I think I see how to do it now, i.e. by calling
"addUser()". I'll give that a try a little later today. Another thing
that may give me a problem is that I didn't know what the second argument
should be to the TaskService() constructor below. The documentation shows only
one argument, but it seems that there is no one argument constructor anymore.
Any help with that? Really appreciate your help and time! -Chuck<o:p></o:p></p>
<pre>private static void startTaskService()<br>
{<br>
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.task");<br>
TaskService taskService = new TaskService(emf,null);<br>
MinaTaskServer server = new MinaTaskServer( taskService );<br>
<br>
<o:p></o:p></pre><pre> Thread thread = new Thread( server );<br>
thread.start();<br>
}<o:p></o:p></pre>
<p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p>
<div>
<p class=MsoNormal>On Mon, Jan 25, 2010 at 1:05 PM, salaboy [via Drools - Java
Rules Engine] <<a
href="http://n3.nabble.com/user/SendEmail.jtp?type=node&node=138369&i=0"
target="_top">[hidden email]</a>> wrote:<o:p></o:p></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'>I see that problem before. It
means that you need to populate some users first. Insert in the database an
administrator user before running the process.<o:p></o:p></p>
</div>
<div>
<div>
<div>
<p class=MsoNormal>On Mon, Jan 25, 2010 at 3:28 PM, Chuck.KS <<a
href="http://n3.nabble.com/user/SendEmail.jtp?type=node&node=138346&i=0"
target="_blank">[hidden email]</a>> wrote:<o:p></o:p></p>
</div>
</div>
<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>
<div>
<div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br>
ramram wrote:<br>
><br>
> Hi What do u have as a problem running the human task?<br>
> did u run the taskservice?<br>
> u cant start a humantask flow as long as u dont have a TaskService?<br>
><o:p></o:p></p>
</div>
<p class=MsoNormal>I did manage to put some code together but I didn't feel
from reading the<br>
documentation that I knew exactly what I was doing. I think it would be very<br>
helpful and many questions would be avoided if a worked out example could<br>
be provided with the drools distribution. Anyway, I really appreciate your<br>
help. The error I got is indicated below.<br>
<br>
Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter<br>
logExceptions<br>
WARNING: SQL Error: 23002, SQLState: 23002<br>
Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter<br>
logExceptions<br>
SEVERE: Referential integrity constraint violation: FK27A9A59B680AE0:<br>
PUBLIC.TASK FOREIGN KEY(CREATEDBY_ID) REFERENCES<br>
PUBLIC.ORGANIZATIONALENTITY(ID) [23002-77]<br>
Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter<br>
logExceptions<br>
WARNING: SQL Error: 23002, SQLState: 23002<br>
Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter<br>
logExceptions<br>
SEVERE: Referential integrity constraint violation: FK27A9A59B680AE0:<br>
PUBLIC.TASK FOREIGN KEY(CREATEDBY_ID) REFERENCES<br>
PUBLIC.ORGANIZATIONALENTITY(ID) [23002-77]<br>
Jan 25, 2010 12:16:39 PM<br>
org.hibernate.event.def.AbstractFlushingEventListener performExecutions<br>
SEVERE: Could not synchronize database state with session<br>
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC<br>
batch update<br>
    at<br>
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)<br>
    at<br>
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)<br>
    at<br>
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)<br>
    at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)<br>
<br>
Also, I'm attaching my test file and persistence.xml file:<br>
<a href="http://n3.nabble.com/file/n138317/RuleFlowTest.java" target="_blank">http://n3.nabble.com/file/n138317/RuleFlowTest.java</a>
RuleFlowTest.java ,<br>
<a href="http://n3.nabble.com/file/n138317/persistence.xml" target="_blank">http://n3.nabble.com/file/n138317/persistence.xml</a>
persistence.xml<br>
<span style='color:#888888'>--<br>
View this message in context: <a
href="http://n3.nabble.com/Human-Task-Example-tp131011p138317.html"
target="_blank">http://n3.nabble.com/Human-Task-Example-tp131011p138317.html</a></span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<div>
<p class=MsoNormal>Sent from the Drools - User mailing list archive at
Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<o:p></o:p></p>
</div>
</div>
<p class=MsoNormal><a
href="http://n3.nabble.com/user/SendEmail.jtp?type=node&node=138346&i=1"
target="_blank">[hidden email]</a><o:p></o:p></p>
<div>
<p class=MsoNormal><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class=MsoNormal><br>
<br clear=all>
<o:p></o:p></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
-- <br>
- <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><br>
- <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
- Salatino "Salaboy" Mauricio -<o:p></o:p></p>
</div>
<p class=MsoNormal>_______________________________________________ <br>
rules-users mailing list <br>
<a href="http://n3.nabble.com/user/SendEmail.jtp?type=node&node=138346&i=2"
target="_blank">[hidden email]</a> <o:p></o:p></p>
<div>
<p class=MsoNormal><a
href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></p>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p>
<div class=MsoNormal>
<hr size=2 width=300 style='width:225.0pt' align=left>
</div>
<p class=MsoNormal>View this message in context: <a
href="http://n3.nabble.com/Human-Task-Example-tp131011p138369.html">Re:
[rules-users] Human Task Example</a><br>
Sent from the <a href="http://n3.nabble.com/Drools-User-f47000.html">Drools -
User mailing list archive</a> at Nabble.com.<o:p></o:p></p>
</div>
</div>
</body>
</html>