<!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;">
    jbpm5 seam 2.2.2 integration issue
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/milhaim">miloud haimoune</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/638960#638960">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 all,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I am integrating Jbpm5 with existing application developed using seam2.2.2. With a separate database for jbpm. I created a persisted ksession and it is working correctly. </p><p>Persistence.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #3a3935;"> </span><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">persistence-unit</span> <span style="color: #7f007f;">name</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"org.jbpm.persistence.jpa"</em></span> <span style="color: #7f007f;">transaction-type</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"JTA"</em></span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">provider</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">org.hibernate.ejb.HibernatePersistence</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">provider</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">jta-data-source</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">java:jdbc/testDS1</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">jta-data-source</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">mapping-file</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">META-INF/JBPMorm.xml</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">mapping-file</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;"> </span></span> </p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;">&#160; </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">org.jbpm.persistence.processinstance.ProcessInstanceInfo</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">org.drools.persistence.info.SessionInfo</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">org.drools.persistence.info.WorkItemInfo</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">org.jbpm.process.audit.ProcessInstanceLog</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">org.jbpm.process.audit.NodeInstanceLog</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;">org.jbpm.process.audit.VariableInstanceLog</span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">class</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">properties</span><span style="color: #008080;">&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">property</span> <span style="color: #7f007f;">name</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"hibernate.dialect"</em></span> <span style="color: #7f007f;">value</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"org.hibernate.dialect.PostgreSQLDialect"</em></span><span style="color: #008080;">/&gt;</span><span style="color: #3a3935;"> </span></span> </p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">property</span> <span style="color: #7f007f;">name</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"hibernate.max_fetch_depth"</em></span> <span style="color: #7f007f;">value</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"3"</em></span><span style="color: #008080;">/&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #3f5fbf;">&lt;!-- &lt;property name="hibernate.hbm2ddl.auto" value="create"/&gt;&#160;&#160;&#160; --&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">property</span> <span style="color: #7f007f;">name</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"hibernate.show_sql"</em></span> <span style="color: #7f007f;">value</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"false"</em></span> <span style="color: #008080;">/&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">property</span> <span style="color: #7f007f;">name</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"hibernate.format_sql"</em></span> <span style="color: #7f007f;">value</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"false"</em></span> <span style="color: #008080;">/&gt;</span><span style="color: #3a3935;"> </span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="color: #3a3935; font-size: 10pt; font-family: Monospace;"> </span> &#160;</p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;</span><span style="color: #3f7f7f;">property</span> <span style="color: #7f007f;">name</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"hibernate.transaction.manager_lookup_class"</em></span> <span style="color: #7f007f;">value</span><span style="color: #3a3935;">=</span><span style="color: #2a00ff;"><em>"org.hibernate.transaction.JBossTransactionManagerLookup"</em></span> <span style="color: #008080;">/&gt;</span></span></p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #3a3935;"> </span><span style="color: #008080;">&lt;/</span><span style="color: #3f7f7f;">properties</span><span style="color: #008080;">&gt;</span><span style="color: #3a3935;"> </span></span> </p><p><span style="color: #3a3935;"> </span><span style="color: #008080; font-size: 10pt; font-family: Monospace;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt; font-family: Monospace;">persistence-unit</span><span style="color: #008080; font-size: 10pt; font-family: Monospace;">&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I needed to access the&#160; processinstance variables to delegate a humane task to another user if the actual user did not complete the task after one hour. I am using a timer to trigger&#160; custom service task registered with a custom workItemHandler. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>My issue : the transaction is canceled after time the timeout (300s) </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-9) [com.arjuna.ats.arjuna.coordinator.TransactionReaper_18] - TransactionReaper::check timeout for TX 7f000101:e18b:4ed4a5a4:10b in state&#160; RUN </p><p> WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-10) [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id 7f000101:e18b:4ed4a5a4:10b invoked while multiple threads active within it. </p><p>WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-10) [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action 7f000101:e18b:4ed4a5a4:10b aborting with 1 threads active! </p><p>WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-10) [com.arjuna.ats.arjuna.coordinator.TransactionReaper_7] - TransactionReaper::doCancellations worker Thread[Thread-10,5,jboss] successfully canceled TX 7f000101:e18b:4ed4a5a4:10b</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>my workItemhandler </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="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;"> </span><span style="color: #000000; text-decoration: underline;">SamplelWorkItemHandler</span><span style="color: #000000;"> </span><span style="color: #7f0055;"><strong>implements</strong></span><span style="color: #000000;"> WorkItemHandler {</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;&#160;&#160; <span style="font-size: 10pt; font-family: Monospace;"> </span></span></p><p><span style="color: #000000;"> <span style="font-size: 10pt; font-family: Monospace;"> ProcessInstance processInstance = (ProcessInstance) ProcessManager.<em>getProcessInstance</em>(workItem.getProcessInstanceId());</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="color: #000000;"> </span> &#160;</p><p><span style="font-size: 10pt; font-family: Monospace;"><span style="color: #000000;"> workItemManager.completeWorkItem(workItem.getId(), </span><span style="color: #7f0055;"><strong>null</strong></span><span style="color: #000000;"> );</span></span></p><p><span style="color: #000000;">&#160;&#160;&#160; <span style="font-size: 10pt; font-family: Monospace;">}</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;"> abortWorkItem(WorkItem workItem, WorkItemManager workItemManager) {</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #000000;">&#160;&#160;&#160; <span style="font-size: 10pt; font-family: Monospace;">}</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> any suggestion ??,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Many thanks.</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/638960#638960">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>