<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: Using Jbpm 5 in a commercial project
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/nash.komar">nash kom</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/639537#639537">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi Mauricio,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thank you for your quick reply, we are tarting to contact sales people.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>sorry for the late reply, I was trying to simplify my process model to identify the source of the issue:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>here are the details :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>the process</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/2-639537-17412/process.jpeg"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/2-639537-17412/450-150/process.jpeg </span></a></p><p>when I try&#160; to access the process instance information Change Level workItemHandler:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #7f0055;"><strong>public</strong></span><span style="color: #000000;"> </span><span style="color: #7f0055;"><strong>class</strong></span><span style="color: #000000;"> ChangeLevelWorkItemHandler </span><span style="color: #7f0055;"><strong>implements</strong></span><span style="color: #000000;"> WorkItemHandler {</span></span></p><p><span style="color: #000000;"> </span><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #7f0055;"><strong>public</strong></span><span style="color: #000000;"> </span><span style="color: #7f0055;"><strong>void</strong></span><span style="color: #000000;"> executeWorkItem(WorkItem workItem, WorkItemManager workItemManager) {</span></span></p><p><span style="color: #000000;"> <span style="font-family: Monospace;"><span style="font-size: 10pt;">System.</span><span style="color: #0000c0;"><em>out</em></span><span style="color: #000000;">.println(</span><span style="color: #2a00ff;">" Changing the level = "</span><span style="color: #000000;"> + workItem.getParameter(</span><span style="color: #2a00ff;">"direction"</span><span style="color: #000000;">));</span></span></span></p><p><span style="color: #000000;"> <span style="font-size: 10pt; font-family: Monospace;">ProcessManager.</span></span><span style="color: #000000; font-size: 10pt; font-family: Monospace;"><em>getProcessInstance</em></span><span style="color: #000000; font-size: 10pt; font-family: Monospace;">(workItem.getProcessInstanceId());</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;">in the processManager :</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #7f0055;"><strong>public</strong></span><span style="color: #000000;"> </span><span style="color: #7f0055;"><strong>static</strong></span><span style="color: #000000;"> ProcessInstance getProcessInstance(</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #000000;"> </span><span style="color: #7f0055;"><strong>long</strong></span><span style="color: #000000;"> processInstanceId) {</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #000000;"> </span><span style="color: #7f0055;"><strong>return</strong></span><span style="color: #000000;"> </span><span style="color: #0000c0;"><em>ksession</em></span><span style="color: #000000;">.getProcessInstance(processInstanceId);</span></span></p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;">}</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;">I'm using a persisted ksession that I create exactly like in the jbpm console : </span> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000;"> <span style="font-family: Monospace;"><span style="font-size: 10pt;">env.set(EnvironmentName.</span><span style="color: #0000c0;"><em>ENTITY_MANAGER_FACTORY</em></span><span style="color: #000000;">, emf);</span></span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #000000;"> Properties properties = </span><span style="color: #7f0055;"><strong>new</strong></span><span style="color: #000000;"> Properties();</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #000000;"> properties.put(</span><span style="color: #2a00ff;">"drools.processInstanceManagerFactory"</span><span style="color: #000000;">, </span><span style="color: #2a00ff;">"org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory"</span><span style="color: #000000;">);</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #000000;"> properties.put(</span><span style="color: #2a00ff;">"drools.processSignalManagerFactory"</span><span style="color: #000000;">, </span><span style="color: #2a00ff;">"org.jbpm.persistence.processinstance.JPASignalManagerFactory"</span><span style="color: #000000;">);</span></span></p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;"> KnowledgeSessionConfiguration config = KnowledgeBaseFactory.<em>newKnowledgeSessionConfiguration</em>(properties);</span></p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;"> </span><span style="color: #7f0055; font-size: 10pt; font-family: Monospace;"><strong>try</strong></span><span style="color: #000000; font-size: 10pt; font-family: Monospace;"> {</span></p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;"> &#8230;..</span></p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;">the process is executed correctly, but after the transaction time out, there is a roll-back(ransactionReaper::check timeout &#8230;. Abort of action id 7f000101:e18b:4ed4a5a4:10b invoked while multiple threads active within it. ).</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;">I activated hibernate sql logs, I can see the sql request to create the process, but not those to insert the workiteminfo and delete them after the end.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;">Every thing work correctly and I can see all the sql request if :</span></p><p><span style="color: #000000; font-size: 10pt; font-family: Monospace;">I remove the timer or the ProcessManager.</span><span style="color: #000000; font-size: 10pt; font-family: Monospace;"><em>getProcessInstance</em></span><span style="color: #000000; font-size: 10pt; font-family: Monospace;">(workItem.getProcessInstanceId()) line from the workItemHandler.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I will try this process in the jbpm console to see how it behave. But I don't know where to put the workitem handler.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Many thanks for your help</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/639537#639537">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>