devendra katiyar [
http://community.jboss.org/people/dev.katiyar] created the discussion
"Event Listener Problem"
To view the discussion, visit:
http://community.jboss.org/message/569802#569802
--------------------------------------------------------------
I am implement Log Event Listener using example given in user guide
<process name="EventListener"
xmlns="http://jbpm.org/4.4/jpdl">
<on event="start">
<event-listener class="org.jbpm.examples.eventlistener.LogListener">
<field name="msg"><string value="start on process
definition"/></field>
</event-listener>
</on>
<start>
<transition to="wait"/>
</start>
<state name="wait">
<on event="start">
<event-listener
class="org.jbpm.examples.eventlistener.LogListener">
<field name="msg"><string value="start on activity
wait"/></field>
</event-listener>
</on>
<on event="end">
<event-listener
class="org.jbpm.examples.eventlistener.LogListener">
<field name="msg"><string value="end on activity
wait"/></field>
</event-listener>
</on>
<transition to="park">
<event-listener
class="org.jbpm.examples.eventlistener.LogListener">
<field name="msg"><string value="take
transition"/></field>
</event-listener>
</transition>
</state>
<state name="park"/>
</process>
and LogListener class like below
public class *LogListener* implements EventListener {
// value gets injected from process definition
String msg;
public void notify(EventListenerExecution execution) {
List<String> logs = (List<String>)
execution.getVariable("logs");
if (logs==null) {
logs = new ArrayList<String>();
execution.setVariable("logs", logs);
}
logs.add(msg);
execution.setVariable("logs", logs);
}
}
but when I am testing using Junit
ProcessInstance processInstance =
executionService.startProcessInstanceByKey("EventListener");
In above line getting Nullpointer Exception?
can any one help regards this , or any other reference to implement Event Listener in
jbpm4
Thanks all
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/569802#569802]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]