From dev-return-5728-apmail-ode-dev-archive=ode.apache.org@ode.apache.org Tue Apr 14 13:15:25 2009 Return-Path: Delivered-To: apmail-ode-dev-archive@www.apache.org Received: (qmail 92900 invoked from network); 14 Apr 2009 13:15:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Apr 2009 13:15:25 -0000 Received: (qmail 42056 invoked by uid 500); 14 Apr 2009 13:15:25 -0000 Delivered-To: apmail-ode-dev-archive@ode.apache.org Received: (qmail 41989 invoked by uid 500); 14 Apr 2009 13:15:25 -0000 Mailing-List: contact dev-help@ode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ode.apache.org Delivered-To: mailing list dev@ode.apache.org Received: (qmail 41979 invoked by uid 99); 14 Apr 2009 13:15:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 13:15:25 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [84.17.190.222] (HELO pmx12.bertelsmann.de) (84.17.190.222) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 13:15:15 +0000 Received: from trustmail_pmx12.bertelsmann.de (localhost [127.0.0.1]) by pmx12.bertelsmann.de (Postfix) with SMTP id EFE00263AD for ; Tue, 14 Apr 2009 15:14:52 +0200 (CEST) Received: from debmu470.server.arvato-systems.de ([84.17.190.205]) by trustmail_pmx12.bertelsmann.de (Totemo SMTP Server) with SMTP ID 416 for ; Tue, 14 Apr 2009 15:14:52 +0200 (CEST) Received: from pmx5.bertelsmann.de (localhost [127.0.0.1]) by localhost.bertelsmann.de (Postfix) with ESMTP id B6FD634DF2 for ; Tue, 14 Apr 2009 15:14:52 +0200 (CEST) Received: from mmx2.bertelsmann.de (unknown [145.228.237.31]) by pmx5.bertelsmann.de (Postfix) with ESMTP id ADB3234DF4 for ; Tue, 14 Apr 2009 15:14:52 +0200 (CEST) Received: from gtlbmlexs0006.bagmail.net ([145.228.237.20]) by mmx2.bertelsmann.de with Microsoft SMTPSVC(6.0.3790.3959); Tue, 14 Apr 2009 15:14:52 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Concurrent execution of extension activities (RE: Problem with flow and extension activities) Date: Tue, 14 Apr 2009 15:14:50 +0200 Message-ID: <653C8E101491144F9B644FFA6652F5E5F2EF9F@gtlbmlexs0006.bagmail.net> In-Reply-To: <49D4C8ED.20400@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Concurrent execution of extension activities (RE: Problem with flow and extension activities) Thread-Index: Acmznd7gqtLMoVRVQrumqMIO5BLK3AJQJzdw References: <653C8E101491144F9B644FFA6652F5E5DB698C@gtlbmlexs0006.bagmail.net> <653C8E101491144F9B644FFA6652F5E5DB6B68@gtlbmlexs0006.bagmail.net> <5582dd3b0903240655w13658374v37db426083927e4a@mail.gmail.com> <653C8E101491144F9B644FFA6652F5E5E1D901@gtlbmlexs0006.bagmail.net> <5582dd3b0903270811o4c6fb6f7mf2321f4cdcc88d67@mail.gmail.com> <653C8E101491144F9B644FFA6652F5E5E1D982@gtlbmlexs0006.bagmail.net> <653C8E101491144F9B644FFA6652F5E5E1E4C5@gtlbmlexs0006.bagmail.net> <5582dd3b0904010950p6bd38c3fr52444872de458a93@mail.gmail.com> <653C8E101491144F9B644FFA6652F5E5EA365A@gtlbmlexs0006.bagmail.net> <49D4C8ED.20400@gmail.com> From: To: X-OriginalArrivalTime: 14 Apr 2009 13:14:52.0067 (UTC) FILETIME=[FEE36730:01C9BD02] X-Virus-Checked: Checked by ClamAV on apache.org Hi Tammo, > -----Original Message----- > From: Tammo van Lessen [mailto:tvanlessen@gmail.com] > Sent: Thursday, April 02, 2009 4:17 PM > Subject: Re: AW: Problem with flow and extension activities > > That's true. If you need a concurrent execution of extension = activities > you'd need to implement the abstract class for async extensions, fork > your own thread and call the ExtensionContext.complete method once = your > processing has finished. In this case the run method can finish before > the processing is done and the navigation continues. I tried this with ODE 2.0 beta2 and put the complete code of my = extension activity=20 execution in a Runnable to be executed in an own thread, but it doesn't = work yet. The code is basically like this: class MyExtensionActivity extends AbstractAsyncExtensionOperation { static java.util.concurrent.Executor executor =3D = Executors.newCachedThreadPool(); void run(...) { executor.execute(new Runnable() { public void run() { // extension activity code:=20 // read variables from ext context // do something // write variables to ext context // complete ext context } } } } For in-memory=3Dtrue there is an exception when I try to complete the = ExtensionContext: java.lang.NullPointerException at = org.apache.ode.jacob.vpu.JacobVPU.activeJacobThread(JacobVPU.java:203) at = org.apache.ode.jacob.vpu.ChannelFactory$ChannelInvocationHandler.invoke(C= hannelFactory.java:89) at $Proxy42.completed(Unknown Source) at = org.apache.ode.bpel.rtrep.v2.ExtensionContextImpl.complete(ExtensionConte= xtImpl.java:147) So the actual execution of the extension code has worked in this case. For in-memory=3Dfalse I get an exception when trying to read a variable = in my separate thread: =20 java.lang.NullPointerException at = org.apache.ode.dao.jpa.ProcessInstanceDAOImpl.getScope(ProcessInstanceDAO= Impl.java:231) at = org.apache.ode.bpel.engine.BpelRuntimeContextImpl.fetchVariableData(BpelR= untimeContextImpl.java:354) at = org.apache.ode.bpel.rtrep.v2.RuntimeInstanceImpl.fetchVariableData(Runtim= eInstanceImpl.java:155) at = org.apache.ode.bpel.rtrep.v2.ExtensionContextImpl.readVariable(ExtensionC= ontextImpl.java:90) at = org.apache.ode.bpel.rtrep.v2.ExtensionContextImpl.readVariable(ExtensionC= ontextImpl.java:108) which means that the DAO impl cannot find it's associated JPA entity = manager anymore.=20 So it seems I cannot access the variables in the extension context in = this case.=20 And then there's another exception on completeWithFault() that looks = similar to the above: Exception in thread "pool-2-thread-3" java.lang.NullPointerException at = org.apache.ode.jacob.vpu.JacobVPU.activeJacobThread(JacobVPU.java:203) at = org.apache.ode.jacob.vpu.ChannelFactory$ChannelInvocationHandler.invoke(C= hannelFactory.java:89) at $Proxy40.completed(Unknown Source) at = org.apache.ode.bpel.rtrep.v2.ExtensionContextImpl.completeWithFault(Exten= sionContextImpl.java:162) It doesn't matter if my extension activities are actually called from = within a or not.=20 It also didn't change anything to let my extension implementation extend = AbstractAsyncExtensionOperation=20 instead of just implementing ExtensionOperation (I also did not find = anything in the ODE code, where they=20 are treated differently). Or have there been changes since 2.0-beta2 = that make this work?=20 Or is there just something I am missing or that I have misunderstood? = (-;=20 Thanks for your patience,=20 Juergen.