package ensaio; import org.kie.api.event.process.ProcessCompletedEvent; import org.kie.api.event.process.ProcessEventListener; import org.kie.api.event.process.ProcessNodeLeftEvent; import org.kie.api.event.process.ProcessNodeTriggeredEvent; import org.kie.api.event.process.ProcessStartedEvent; import org.kie.api.event.process.ProcessVariableChangedEvent; import org.kie.api.runtime.process.ProcessInstance; public class TestEventListener implements ProcessEventListener { ProcessInstance pi; String tes; @Override public void afterNodeLeft(ProcessNodeLeftEvent arg0) { // TODO Auto-generated method stub } @Override public void afterNodeTriggered(ProcessNodeTriggeredEvent event) { if(event.getNodeInstance().getNodeName().equals("CreateAgent")){ pi.signalEvent("Signal_1", null); } } @Override public void afterProcessCompleted(ProcessCompletedEvent arg0) { // TODO Auto-generated method stub } @Override public void afterProcessStarted(ProcessStartedEvent event) { } @Override public void afterVariableChanged(ProcessVariableChangedEvent arg0) { // TODO Auto-generated method stub } @Override public void beforeNodeLeft(ProcessNodeLeftEvent arg0) { // TODO Auto-generated method stub } @Override public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) { System.out.println("Before Node triggered event received for node: "+ event.getNodeInstance().getNodeName()); if(event.getNodeInstance().getNodeName().equals("CreateAgent")){ tes="CreateAgentSucess"; } } @Override public void beforeProcessCompleted(ProcessCompletedEvent arg0) { // TODO Auto-generated method stub } @Override public void beforeProcessStarted(ProcessStartedEvent event) { pi=event.getProcessInstance(); } @Override public void beforeVariableChanged(ProcessVariableChangedEvent arg0) { // TODO Auto-generated method stub } }