Help with Signal Start Event
by Federico Feller
Hi All,
I need some help with the signal start event of bpmn2
It seems that the signal start event doesn't work when a process definition
is added to a knowledge base of an already created session.
I have slightly modified the testSignalStart() unit test
of SimpleBPMNProcessTest.java to reproduce the problem
Firstly, I'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
The following test runs without any problem, since both process definitions
are added before the session is created
public void testSignalStart() throws Exception {
KnowledgeBase kbase =
createKnowledgeBase("BPMN2-SignalStart.bpmn2");
KnowledgeBase kbase2 =
createKnowledgeBase("BPMN2-SignalStart2.bpmn2");
kbase.addKnowledgePackages(kbase2.getKnowledgePackages());
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
final List<Long> list = new ArrayList<Long>();
ksession.addEventListener(new DefaultProcessEventListener() {
public void afterProcessStarted(ProcessStartedEvent event) {
list.add(event.getProcessInstance().getId());
}
});
ksession.signalEvent("MyStartSignal", "NewValue");
ksession.signalEvent("MyStartSignal2", "NewValue");
assertEquals(2, list.size());
}
However, the following test fail to run, as the process Minimal2 is never
started when doing ksession.signalEvent("MyStartSignal2", "NewValue");
If I start the process directly using ksession.startProcess("Minimal2") then
the test passes.
public void testSignalStart2() throws Exception {
KnowledgeBase kbase =
createKnowledgeBase("BPMN2-SignalStart.bpmn2");
KnowledgeBase kbase2 =
createKnowledgeBase("BPMN2-SignalStart2.bpmn2");
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
ksession.getKnowledgeBase().addKnowledgePackages(kbase2.getKnowledgePackages());
final List<Long> list = new ArrayList<Long>();
ksession.addEventListener(new DefaultProcessEventListener() {
public void afterProcessStarted(ProcessStartedEvent event) {
list.add(event.getProcessInstance().getId());
}
});
ksession.signalEvent("MyStartSignal", "NewValue");
ksession.signalEvent("MyStartSignal2", "NewValue");
//ksession.startProcess("Minimal2");
assertEquals(2, list.size());
}
I found some clues on why this is happening.
The first test works because, when the session is created, the
method ProcessRuntimeImpl::initProcessEventListeners() is invoked, and the
event listeners are properly initialized
But in the second test, the event listeners are not initialized since adding
a package does not reinitialize the session.
Any ideas on where I can start looking to fix this? or any workaround?
Thanks!
Federico
13 years, 6 months
Contributing to jbpm: Code Style for Eclipse.
by Nicolas Melendez
Hi there, i am implementing Link Event Definition in jbpm + drools,
i would like to contribute to the project with that code,
but i need the code formatter for eclipse that is used in the project,
Where i can download it?
Thanks!
--
NM
Nicolás Meléndez - Developer Intalio
Skype: nicomelendez
Twitter: @nfmelendez
Cell: +54 9 1157535454
13 years, 6 months
Support for assignments with dialects
by Antoine Toulme
Hi all,
I heard from Kris that there was some work for assignments with support for
dialects in the works.
We did an initial pass at implementing the assignments in the Intalio fork,
but we actually would like to embrace the dialect approach as we think it
makes a lot more sense.
We would like to help out if possible. Would there be a way for us to work
on it on a branch ? I understand master is locked right now.
Antoine
13 years, 6 months