<div>Thanks Kris!</div>I saw this was fixed already :)<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="https://github.com/droolsjbpm/jbpm/commit/b1dbe63b7b41ae719a1840020ba8ab96ed140cc3">https://github.com/droolsjbpm/jbpm/commit/b1dbe63b7b41ae719a1840020ba8ab96ed140cc3</a></div>

<div>Unfortunately, now I&#39;m having some issues when saving the knowledge base: StartProcessEventListener is required to be serialized, (and if I do declare it as Serializable, then ProcessRuntimeImpl is also required to be serialized)</div>

<div>I think the problem is that the knowledge base is trying to serialize the new listener added in line 201 of ProcessRuntimeImpl.java</div><div>Do you think there&#39;s a way to skip that listener from being serialized? </div>

<div><br></div><div>Thanks!</div><div><br><div class="gmail_quote">On Mon, May 16, 2011 at 11:12 PM, Kris Verlaenen <span dir="ltr">&lt;<a href="mailto:kverlaen@redhat.com">kverlaen@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Thanks, this indeed seems to be an issue with dynamically loading this process to the knowledge base.<br>
I&#39;ve create a JIRA issue for this and will look at fixing this:<br>
<a href="https://issues.jboss.org/browse/JBPM-3197" target="_blank">https://issues.jboss.org/browse/JBPM-3197</a><br>
<br>
Kris<br>
<br>
Federico Feller wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
Hi All,<br>
<br>
I need some help with the signal start event of bpmn2<br>
It seems that the signal start event doesn&#39;t work  when a process definition is added to a knowledge base of an already created session.<br>
I have slightly modified the testSignalStart() unit test of SimpleBPMNProcessTest.java to reproduce the problem<br>
Firstly, I&#39;ve added a new process definition named BPMN2-SignalStart2.bpmn2, based on the original BPMN2-SignalStart.bpmn2, just renaming the signal name from MySignalStart to MySignalStart2 and renaming the process id from Minimal to Minimal2<br>


<br>
The following test runs without any problem, since both process definitions are added before the session is created<br>
<br>
public void testSignalStart() throws Exception {<br>
        KnowledgeBase kbase = createKnowledgeBase(&quot;BPMN2-SignalStart.bpmn2&quot;);<br>
        KnowledgeBase kbase2 = createKnowledgeBase(&quot;BPMN2-SignalStart2.bpmn2&quot;);<br>
        kbase.addKnowledgePackages(kbase2.getKnowledgePackages());<br>
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);<br>
final List&lt;Long&gt; list = new ArrayList&lt;Long&gt;();<br>
ksession.addEventListener(new DefaultProcessEventListener() {<br>
public void afterProcessStarted(ProcessStartedEvent event) {<br>
list.add(event.getProcessInstance().getId());<br>
}<br>
});<br>
ksession.signalEvent(&quot;MyStartSignal&quot;, &quot;NewValue&quot;);<br>
        ksession.signalEvent(&quot;MyStartSignal2&quot;, &quot;NewValue&quot;);<br>
assertEquals(2, list.size());<br>
    }<br>
<br>
However, the following test fail to run, as the process Minimal2 is never started when doing ksession.signalEvent(&quot;MyStartSignal2&quot;, &quot;NewValue&quot;);<br>
If I start the process directly using  ksession.startProcess(&quot;Minimal2&quot;) then the test passes. <br>
    public void testSignalStart2() throws Exception {<br>
        KnowledgeBase kbase = createKnowledgeBase(&quot;BPMN2-SignalStart.bpmn2&quot;);<br>
        KnowledgeBase kbase2 = createKnowledgeBase(&quot;BPMN2-SignalStart2.bpmn2&quot;);<br>
                StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);<br>
        ksession.getKnowledgeBase().addKnowledgePackages(kbase2.getKnowledgePackages());<br>
final List&lt;Long&gt; list = new ArrayList&lt;Long&gt;();<br>
ksession.addEventListener(new DefaultProcessEventListener() {<br>
public void afterProcessStarted(ProcessStartedEvent event) {<br>
list.add(event.getProcessInstance().getId());<br>
}<br>
});<br>
ksession.signalEvent(&quot;MyStartSignal&quot;, &quot;NewValue&quot;);<br>
                ksession.signalEvent(&quot;MyStartSignal2&quot;, &quot;NewValue&quot;);<br>
//ksession.startProcess(&quot;Minimal2&quot;);<br>
assertEquals(2, list.size());<br>
    }<br>
<br>
I found some clues on why this is happening.<br>
The first test works because, when the session is created, the method ProcessRuntimeImpl::initProcessEventListeners() is invoked, and the event listeners are properly initialized<br>
But in the second test, the event listeners are not initialized since adding a package does not reinitialize the session.<br>
Any ideas on where I can start looking to fix this? or any workaround?<br>
<br>
 Thanks!<br>
<br>
Federico<br>
<br></div></div>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
jbpm-dev mailing list<br>
<a href="mailto:jbpm-dev@lists.jboss.org" target="_blank">jbpm-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/jbpm-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/jbpm-dev</a><br>
  <br>
</blockquote>
</blockquote></div><br></div>