<!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: In memory TaskClient without Mina or JMS
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/frankee787">Franklin Antony</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/616710#616710">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>&#160;&#160; I have tried to put together as much information as possible , but its really hard to express all the possible use cases. Anyways, following are what I am facing right now.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I think one of the major pains everyone is suffering is the Transaction Management aspect.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> As mentioned, the HumanTask Service is completely emebedabble and is one of the <strong>STRONGEST</strong> points of jBPM. However that is also one of the biggest problems now. Let me explain</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="text-decoration: underline;"><strong>USE CASE 1</strong></span></p><p>&#160; </p><p>My application uses the the following to create a client and interact with a task. No process is associated with this.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>client&#160; = new TaskClient(new MinaTaskClientConnector("client", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In a situation like the following </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1)I insert/update into my database(Flight ticket Task / User Approval Task / Backoffice Data Auditing etc: business specific data)</p><p>2)I call client.addTask(task, null, addTaskResponseHandler) (to create a task in jBPM)</p><p>3)I update my database saying the task has been created sucessfully in jBPM</p><p>&#160;&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>NOTE: Reason for step 1 is as follows : Putting all business related data inside the TaskData doesnt seem to be good idea(Getting serialized and persisted, looses the ability to search). Also there is no task history being mainted in the jBPM</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160; </p><p><span style="text-decoration: underline;"><strong>QUESTIONS:</strong></span></p><p>How can I ensure steps 1 - 3 are in one transaction?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This should be achieveable outside an appserver since HumanTask Service is completely emebedabble.&#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="text-decoration: underline;"><strong>USE CASE 2</strong></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>My application uses a Kession to start of a process(which comprises of mutiple human tasks)</p><p>&#160; </p><p>In a situation like the following </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1)I insert/update into my database saying process has been started(Flight ticket booking Process/ User Enrollment Process etc: business specific processes)</p><p>2)I call ksession.startProcess("com.sample.evaluation", params) (to start the process in jBPM)</p><p>3)I update my database saying the process has been started sucessfully in jBPM</p><p>&#160;&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="text-decoration: underline;"><strong>QUESTIONS:</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>How can I ensure steps 1 - 3 are in one transaction?</p><p>How can my business application be notified when a Task is being created as part of a process execution?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This should also be achieveable outside an appserver since HumanTask Service is completely emebedabble. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="text-decoration: underline;"><strong>USE CASE 3</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Putting all business related data inside the TaskData doesnt seem to be good idea(Getting serialized and persisted, looses the ability to search). It would be better just to keep a reference of your business data inside TaskData and look it up when interacting with a Task.</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="text-decoration: underline;"><strong>QUESTIONS:</strong></span></p><p>Which brings us to the last question. How can my business application be notified when a Task is being created as part of a process so that this reference can be made in my application.</p><p>&#160;&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I hope my USER CASESes are clear now ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks a lot Mauricio for hearing out for the community.</p><p>Regards,</p><p>Franklin</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/616710#616710">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>