ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Boisvert" <boisv...@intalio.com>
Subject Re: Encountered a problem while modifying the runtime
Date Tue, 22 Apr 2008 21:38:26 GMT
Hi Thomas,

The data access objects require a transaction context for most operations.
I would advise wrapping your link injection code into a
Scheduler.execTransaction() block,

scheduler.execTransaction(new Callable<Void>() {
    public Void call() throws Exception {
        // your code here
        return null;
    }
});

Hope this helps,
alex


On Tue, Apr 22, 2008 at 7:28 AM, Thomas Steinmetz <thomassteinmetz@gmx.de>
wrote:

>
> Hi all,
>
> i got a problem modifying the runtime, i hope someone can help me in this.
>
> What i try to do is the following:
> I want to be able to stop the execution of an activity at certain points
> in
> its execution, without affecting other activities of the same process.
> This stopped activity can be resumed at a later point in time.
>
> For this I want to use ChannelListener.
>
> One example is:
>
> run()
> {
>        LinkStatusChannel signal = newChannel(LinkStatusChannel.class);
>        LinkStatusChannelListener receiver = new
> LinkStatusChannelListener(signal)
>        {
>                private static final long serialVersionUID =
> 1024111188875L;
>                public void linkStatus(boolean value) {
>                                SSCOPE.this.execute();
>                }
>
>        };
>        object(false, receiver);
>
>        ScopeActivityReady evt = new ScopeActivityReady(... signal, ...);
>
>  getBpelRuntimeContext().getBpelProcess().getEngine().fireEvent(evt);
> }
>
> execute()
> {
>  ScopeActivityExecuting evt = new ScopeActivityExecuting(...);
>  getBpelRuntimeContext().getBpelProcess().getEngine().fireEvent(evt);
>  ...
> }
>
>
> So this Activity has just this one Listener left. If signaled from
> outside,
> it should continue. (I get the channel via this Event.)
>
>
> In order to know the BpelRuntimeContextImpl for a process, these are
> noted.
>
> If I want to signal one activity to continue from outside, I have
> something
> like that:
>
>        runtime.getVPU().inject(new JacobRunnable() {
>                private static final long serialVersionUID =
> 76753611036745L;
>
>                public void run() {
>                        LinkStatusChannel channel = event.chan;
>                        channel.linkStatus(true);
>                        }
>        });
>
>        runtime.execute();
>
>
> Of course, that is not working, although I absolutely don't see why.
>
> When executing the HelloWorld2 example process i get the following:
>
> 22.04.2008 16:07:47
> org.apache.ode.bpel.extensions.handler.ActivityEventHandler
> Scope_Activity_Ready
> FEIN:
> Scope_Activity_Ready!0!/process!{http://ode/bpel/unit-test}HelloWorld2-1!2<http://ode/bpel/unit-test%7DHelloWorld2-1%212>
> 01!null!251
> 22.04.2008 16:07:47
> org.apache.ode.bpel.extensions.handler.ActivityEventHandler
> Scope_Activity_Executing
> FEIN:
> Scope_Activity_Executing!0!/process!{http://ode/bpel/unit-test}HelloWorld2
> -1!201!null!251<http://ode/bpel/unit-test%7DHelloWorld2-1%21201%21null%21251>
> DEBUG - GeronimoLog.trace(54) | >>
> initializeEndpointReferences(parentScopeId=25
> 1,partnerLinks=[OPartnerLink#9])
> 16:07:47,743 DEBUG [BpelProcess] >>
> initializeEndpointReferences(parentScopeId=2
> 51,partnerLinks=[OPartnerLink#9])
> ERROR - GeronimoLog.error(108) | Method "run" in class
> "org.apache.ode.bpel.runt
> ime.ACTIVITYGUARD" threw an unexpected exception.
> java.lang.NullPointerException
>        at
> org.apache.ode.dao.jpa.ProcessInstanceDAOImpl.insertBpelEvent(Process
> InstanceDAOImpl.java:264)
>        at
> org.apache.ode.bpel.engine.BpelProcess.saveInstanceEvent(BpelProcess.
> java:578)
>        at
> org.apache.ode.bpel.engine.BpelProcess.saveEvent(BpelProcess.java:572
> )
>        at
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.sendEvent(BpelRunti
> meContextImpl.java:1032)
>        at
> org.apache.ode.bpel.runtime.ACTIVITY.sendEvent(ACTIVITY.java:150)
>        at
> org.apache.ode.bpel.runtime.ACTIVITY.sendEvent(ACTIVITY.java:141)
>        at
> org.apache.ode.bpel.runtime.ACTIVITYGUARD.run(ACTIVITYGUARD.java:96)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at
> org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:4
> 51)
>        at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
>        at
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntime
> ContextImpl.java:828)
>        at
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.callExecution(BpelR
> untimeContextImpl.java:1377)
>        at
> org.apache.ode.bpel.extensions.handler.IncomingMessageHandler.Start_A
> ctivity(IncomingMessageHandler.java:516)
>        at
> org.apache.ode.bpel.extensions.comm.MessageDispatcher.onMessage(Messa
> geDispatcher.java:117)
>        at
> org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageC
> onsumer.java:854)
>        at
> org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionE
> xecutor.java:99)
>        at
> org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionEx
> ecutor.java:166)
>        at
> org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.
> java:117)
>        at
> org.apache.activemq.thread.PooledTaskRunner.access$100(PooledTaskRunn
> er.java:26)
>        at
> org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.ja
> va:44)
>        at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
> ker.runTask(ThreadPoolExecutor.java:650)
>        at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
> ker.run(ThreadPoolExecutor.java:675)
>        at java.lang.Thread.run(Thread.java:595)
> 16:07:47,790 ERROR [JacobVPU] Method "run" in class
> "org.apache.ode.bpel.runtime
> .ACTIVITYGUARD" threw an unexpected exception.
> java.lang.NullPointerException
>        at
> org.apache.ode.dao.jpa.ProcessInstanceDAOImpl.insertBpelEvent(Process
> InstanceDAOImpl.java:264)
>        at
> org.apache.ode.bpel.engine.BpelProcess.saveInstanceEvent(BpelProcess.
> java:578)
>        at
> org.apache.ode.bpel.engine.BpelProcess.saveEvent(BpelProcess.java:572
> )
>        at
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.sendEvent(BpelRunti
> meContextImpl.java:1032)
>        at
> org.apache.ode.bpel.runtime.ACTIVITY.sendEvent(ACTIVITY.java:150)
>        at
> org.apache.ode.bpel.runtime.ACTIVITY.sendEvent(ACTIVITY.java:141)
>        at
> org.apache.ode.bpel.runtime.ACTIVITYGUARD.run(ACTIVITYGUARD.java:96)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at
> org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:4
> 51)
>        at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
>        at
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntime
> ContextImpl.java:828)
>        at
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.callExecution(BpelR
> untimeContextImpl.java:1377)
>        at
> org.apache.ode.bpel.extensions.handler.IncomingMessageHandler.Start_A
> ctivity(IncomingMessageHandler.java:516)
>        at
> org.apache.ode.bpel.extensions.comm.MessageDispatcher.onMessage(Messa
> geDispatcher.java:117)
>        at
> org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageC
> onsumer.java:854)
>        at
> org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionE
> xecutor.java:99)
>        at
> org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionEx
> ecutor.java:166)
>        at
> org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.
> java:117)
>        at
> org.apache.activemq.thread.PooledTaskRunner.access$100(PooledTaskRunn
> er.java:26)
>        at
> org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.ja
> va:44)
>        at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
> ker.runTask(ThreadPoolExecutor.java:650)
>        at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
> ker.run(ThreadPoolExecutor.java:675)
>        at java.lang.Thread.run(Thread.java:595)
>
> Via the event ScopeActivityReady I got the Channel, later signaled the
> activity to continue,
> what it actually does (at least I got the event ScopeActivityExecuted).
> But now, when trying to invoke the pick activity it fails (I am not
> blocking
> anything at that point in time).
>
> If anyone knows why exactly that does not work or what I did wrong... I
> appreciate
> every hint, because I'm really lost.
>
> Greetings,
> Thomas
> --
> View this message in context:
> http://www.nabble.com/Encountered-a-problem-while-modifying-the-runtime-tp16824336p16824336.html
> Sent from the Apache Ode Dev mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message