[jboss-svn-commits] JBL Code SVN: r34979 - labs/jbossrules/branches/diega_esteban_jpm_integration_r34940/drools-process/drools-persistent-timer/drools-timer-executor/src/main/java/org/drools/job/executor/timer.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Sep 2 15:58:54 EDT 2010
Author: diegoll
Date: 2010-09-02 15:58:54 -0400 (Thu, 02 Sep 2010)
New Revision: 34979
Modified:
labs/jbossrules/branches/diega_esteban_jpm_integration_r34940/drools-process/drools-persistent-timer/drools-timer-executor/src/main/java/org/drools/job/executor/timer/TimerJobExecutor.java
Log:
[JBRULES-2616] fixed calling signal manager
Modified: labs/jbossrules/branches/diega_esteban_jpm_integration_r34940/drools-process/drools-persistent-timer/drools-timer-executor/src/main/java/org/drools/job/executor/timer/TimerJobExecutor.java
===================================================================
--- labs/jbossrules/branches/diega_esteban_jpm_integration_r34940/drools-process/drools-persistent-timer/drools-timer-executor/src/main/java/org/drools/job/executor/timer/TimerJobExecutor.java 2010-09-02 19:54:43 UTC (rev 34978)
+++ labs/jbossrules/branches/diega_esteban_jpm_integration_r34940/drools-process/drools-persistent-timer/drools-timer-executor/src/main/java/org/drools/job/executor/timer/TimerJobExecutor.java 2010-09-02 19:58:54 UTC (rev 34979)
@@ -2,12 +2,9 @@
import org.drools.KnowledgeBase;
import org.drools.command.impl.CommandBasedStatefulKnowledgeSession;
-import org.drools.command.impl.KnowledgeCommandContext;
-import org.drools.impl.StatefulKnowledgeSessionImpl;
+import org.drools.command.runtime.process.SignalEventCommand;
import org.drools.job.executor.JobExecutor;
import org.drools.persistence.jpa.KnowledgeStoreService;
-import org.drools.process.instance.InternalProcessRuntime;
-import org.drools.process.instance.event.SignalManager;
import org.drools.process.instance.timer.TimerInstance;
import org.drools.runtime.Environment;
import org.drools.runtime.StatefulKnowledgeSession;
@@ -40,15 +37,21 @@
throw new IllegalArgumentException("unexistent process instance with ID: " + processInstanceId);
}
- StatefulKnowledgeSessionImpl sessionImpl = (StatefulKnowledgeSessionImpl) ((KnowledgeCommandContext) ((CommandBasedStatefulKnowledgeSession)ksession).getCommandService().getContext()).getStatefulKnowledgesession();
- SignalManager signalManager = ((InternalProcessRuntime)sessionImpl.getInternalWorkingMemory().getProcessRuntime()).getSignalManager();
+ CommandBasedStatefulKnowledgeSession executorService = (CommandBasedStatefulKnowledgeSession) ksession;
+
TimerInstance timerInstance = new TimerInstance();
timerInstance.setId(job.getTimerId());
timerInstance.setTimerId(job.getTimerId());
timerInstance.setPeriod(job.getPeriod());
+
+ SignalEventCommand signalCommand = new SignalEventCommand();
+ signalCommand.setProcessInstanceId(processInstanceId);
+ signalCommand.setEventType("timerTriggered");
+ signalCommand.setEvent(timerInstance);
- signalManager.signalEvent( processInstanceId, "timerTriggered", timerInstance );
+ executorService.execute(signalCommand);
+
ksession.dispose();
}
More information about the jboss-svn-commits
mailing list