Add clonning of values in fact logging to keep initial values - debug
This commit is contained in:
parent
998eb9980f
commit
760ae20f49
35 changed files with 82 additions and 43 deletions
|
|
@ -36,13 +36,17 @@ public class HistoryEvent implements Serializable {
|
|||
private Long sessionId;
|
||||
private DroolsChtijbugException droolsChtijbugException;
|
||||
private ArrayList<KnowledgeResource> knowledgeResources = new ArrayList<KnowledgeResource>();
|
||||
|
||||
private ClassLoader businessClassLoader;
|
||||
/**
|
||||
* Mandatory for GWT Serialization
|
||||
*/
|
||||
public HistoryEvent() {
|
||||
}
|
||||
|
||||
public void setBusinessClassLoader(ClassLoader businessClassLoader) {
|
||||
this.businessClassLoader = businessClassLoader;
|
||||
}
|
||||
|
||||
public HistoryEvent(Long eventID, Date dateEvent, TypeEvent typeEvent) {
|
||||
|
||||
this.eventID = eventID;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.chtijbug.drools.runtimeevent;
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
|
||||
|
|
@ -8,9 +9,10 @@ import org.chtijbug.drools.entity.history.HistoryEvent;
|
|||
*/
|
||||
public interface AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
public abstract void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext);
|
||||
public abstract void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner);
|
||||
|
||||
public abstract boolean isEventSupported(HistoryEvent historyEvent);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
package org.chtijbug.drools.runtimeevent;
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import com.rits.cloning.ObjenesisInstantiationStrategy;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.runtimeevent.impl.fact.*;
|
||||
|
|
@ -39,6 +41,8 @@ public class MessageHandlerResolver {
|
|||
@Resource
|
||||
private List<AbstractMemoryEventHandlerStrategy> allMemoryStrategies = new ArrayList<>();
|
||||
|
||||
private ClassLoader classLoader;
|
||||
|
||||
public MessageHandlerResolver() {
|
||||
allMemoryStrategies.add(new DeleteFactEventStrategy());
|
||||
allMemoryStrategies.add(new InsertedByRelectionFactEndEventStrategy());
|
||||
|
|
@ -68,16 +72,19 @@ public class MessageHandlerResolver {
|
|||
allMemoryStrategies.add(new AfterRuleflowGroupDeactivatedEventStrategy());
|
||||
allMemoryStrategies.add(new BeforeRuleFiredEventStrategy());
|
||||
|
||||
|
||||
}
|
||||
|
||||
public SessionContext getSessionFromHistoryEvent(List<HistoryEvent> historyEvents) {
|
||||
Thread currentThread = Thread.currentThread();
|
||||
ClassLoader old = currentThread.getContextClassLoader();
|
||||
currentThread.setContextClassLoader(classLoader);
|
||||
SessionContext sessionContext = new SessionContext();
|
||||
Cloner cloner=new Cloner(new ObjenesisInstantiationStrategy());
|
||||
for (HistoryEvent historyEvent : historyEvents) {
|
||||
AbstractMemoryEventHandlerStrategy strategy = this.resolveMessageHandlerMemory(historyEvent);
|
||||
if (strategy != null) {
|
||||
try {
|
||||
strategy.handleMessageInternally(historyEvent, sessionContext);
|
||||
strategy.handleMessageInternally(historyEvent, sessionContext,cloner);
|
||||
}catch (Exception e){
|
||||
logger.error("MessageHandle for class" + historyEvent.getClass().toString(), historyEvent, e);
|
||||
}
|
||||
|
|
@ -85,6 +92,7 @@ public class MessageHandlerResolver {
|
|||
}
|
||||
|
||||
sessionContext.getRuleflowGroups().clear();
|
||||
currentThread.setContextClassLoader(old);
|
||||
return sessionContext;
|
||||
}
|
||||
|
||||
|
|
@ -95,4 +103,8 @@ public class MessageHandlerResolver {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setClassLoader(ClassLoader classLoader) {
|
||||
this.classLoader=classLoader;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,14 +28,12 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
|
||||
public class DeleteFactEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext,Cloner cloner) {
|
||||
DeletedFactHistoryEvent deletedFactHistoryEvent = (DeletedFactHistoryEvent) historyEvent;
|
||||
Fact fact = new Fact();
|
||||
fact.setFullClassName(deletedFactHistoryEvent.getDeletedObject().getFullClassName());
|
||||
fact.setObjectVersion(deletedFactHistoryEvent.getDeletedObject().getObjectVersion());
|
||||
Cloner cloner = new Cloner();
|
||||
fact.setRealFact(cloner.deepClone(deletedFactHistoryEvent.getDeletedObject().getRealObject()));
|
||||
fact.setModificationDate(deletedFactHistoryEvent.getDateEvent());
|
||||
fact.setFactType(FactType.DELETED);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.fact;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.fact.InsertedByReflectionFactEndHistoryEvent;
|
||||
|
|
@ -26,7 +27,7 @@ public class InsertedByRelectionFactEndEventStrategy implements AbstractMemoryEv
|
|||
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.fact;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.fact.InsertedByReflectionFactStartHistoryEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
|
||||
public class InsertedByRelectionFactStartEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,12 +29,11 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class InsertedFactEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext,Cloner cloner) {
|
||||
InsertedFactHistoryEvent insertedFactHistoryEvent = (InsertedFactHistoryEvent) historyEvent;
|
||||
Fact fact = new Fact();
|
||||
fact.setFullClassName(insertedFactHistoryEvent.getInsertedObject().getFullClassName());
|
||||
fact.setObjectVersion(insertedFactHistoryEvent.getInsertedObject().getObjectVersion());
|
||||
Cloner cloner = new Cloner();
|
||||
fact.setRealFact(cloner.deepClone(insertedFactHistoryEvent.getInsertedObject().getRealObject()));
|
||||
fact.setModificationDate(insertedFactHistoryEvent.getDateEvent());
|
||||
fact.setFactType(FactType.INSERTED);
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@ public class UpdatedFactEventStrategy implements AbstractMemoryEventHandlerStrat
|
|||
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext,Cloner cloner) {
|
||||
UpdatedFactHistoryEvent updatedFactHistoryEvent = (UpdatedFactHistoryEvent) historyEvent;
|
||||
Cloner cloner=new Cloner();
|
||||
Fact factOldValue = new Fact();
|
||||
factOldValue.setFullClassName(updatedFactHistoryEvent.getObjectOldValue().getFullClassName());
|
||||
factOldValue.setObjectVersion(updatedFactHistoryEvent.getObjectOldValue().getObjectVersion());
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.knowledgeSession;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.session.SessionCreatedEvent;
|
||||
|
|
@ -29,7 +30,7 @@ public class KnowledgeSessionCreateEventStrategy implements AbstractMemoryEventH
|
|||
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
SessionExecution sessionExecution = new SessionExecution();
|
||||
SessionCreatedEvent sessionCreatedEvent = (SessionCreatedEvent) historyEvent;
|
||||
sessionExecution.setProcessingStartDate(new Date());
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.knowledgeSession;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.session.SessionDisposedEvent;
|
||||
|
|
@ -29,7 +30,7 @@ public class KnowledgeSessionDisposeEventStrategy implements AbstractMemoryEvent
|
|||
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
SessionDisposedEvent sessionDisposedEvent = (SessionDisposedEvent) historyEvent;
|
||||
SessionExecution existingSessionRutime = sessionContext.getSessionExecution();
|
||||
existingSessionRutime.setEndDate(sessionDisposedEvent.getDateEvent());
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class KnowledgeSessionFireAllRulesAndStartProcessEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext,Cloner cloner) {
|
||||
SessionFireAllRulesAndStartProcess sessionFireAllRulesAndStartProcess = (SessionFireAllRulesAndStartProcess) historyEvent;
|
||||
SessionExecution existingSessionRutime = sessionContext.getSessionExecution();
|
||||
|
||||
|
|
@ -40,7 +40,6 @@ public class KnowledgeSessionFireAllRulesAndStartProcessEventStrategy implements
|
|||
inputFact.setEventid(sessionContext.getSessionExecution().getStartEventID());
|
||||
inputFact.setFactType(FactType.INPUTDATA);
|
||||
inputFact.setFullClassName(inputObject.getFullClassName());
|
||||
Cloner cloner=new Cloner();
|
||||
inputFact.setRealFact(cloner.deepClone(inputObject.getRealObject()));
|
||||
inputFact.setModificationDate(sessionFireAllRulesAndStartProcess.getDateEvent());
|
||||
inputFact.setObjectVersion(inputObject.getObjectVersion());
|
||||
|
|
@ -52,7 +51,6 @@ public class KnowledgeSessionFireAllRulesAndStartProcessEventStrategy implements
|
|||
outputFact.setEventid(sessionContext.getSessionExecution().getStopEventID());
|
||||
outputFact.setFactType(FactType.OUTPUTDATA);
|
||||
outputFact.setFullClassName(outputObject.getFullClassName());
|
||||
Cloner cloner=new Cloner();
|
||||
outputFact.setRealFact(cloner.deepClone(outputObject.getRealObject()));
|
||||
outputFact.setModificationDate(sessionFireAllRulesAndStartProcess.getDateEvent());
|
||||
outputFact.setObjectVersion(outputObject.getObjectVersion());
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.knowledgeSession;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.session.SessionFireAllRulesBeginEvent;
|
||||
|
|
@ -27,7 +28,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class KnowledgeSessionFireAllRulesBeginEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
SessionFireAllRulesBeginEvent sessionFireAllRulesBeginEvent = (SessionFireAllRulesBeginEvent) historyEvent;
|
||||
|
||||
SessionExecution existingSessionRutime = sessionContext.getSessionExecution();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.knowledgeSession;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.session.SessionFireAllRulesEndEvent;
|
||||
|
|
@ -26,7 +27,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class KnowledgeSessionFireAllRulesEndEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
SessionFireAllRulesEndEvent sessionFireAllRulesEndEvent = (SessionFireAllRulesEndEvent) historyEvent;
|
||||
FireAllRulesExecution fireAllRulesExecution = sessionContext.getFireAllRulesExecution();
|
||||
fireAllRulesExecution.setStopEventID(sessionFireAllRulesEndEvent.getEventID());
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.knowledgeSession;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.session.SessionFireAllRulesMaxNumberReachedEvent;
|
||||
|
|
@ -25,7 +26,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
|
||||
public class KnowledgeSessionFireAllRulesMaxRulesEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
SessionFireAllRulesMaxNumberReachedEvent sessionFireAllRulesMaxNumberReachedEvent = (SessionFireAllRulesMaxNumberReachedEvent) historyEvent;
|
||||
FireAllRulesExecution fireAllRulesExecution = sessionContext.getFireAllRulesExecution();
|
||||
fireAllRulesExecution.setMaxRulesEventID(sessionFireAllRulesMaxNumberReachedEvent.getEventID());
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.knowledgeSession;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.session.SessionStartProcessBeginEvent;
|
||||
|
|
@ -23,7 +24,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
|
||||
public class KnowledgeSessionProcessBeginEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.knowledgeSession;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.session.SessionStartProcessEndEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class KnowledgeSessionProcessEndEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.DroolsNodeType;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
|
|
@ -28,7 +29,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class AfterNodeInstanceTriggeredEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
AfterNodeInstanceTriggeredHistoryEvent afterNodeInstanceTriggeredHistoryEvent = (AfterNodeInstanceTriggeredHistoryEvent) historyEvent;
|
||||
if (afterNodeInstanceTriggeredHistoryEvent.getNodeInstance().getNode().getNodeType() == DroolsNodeType.RuleNode) {
|
||||
String ruleFLowName = afterNodeInstanceTriggeredHistoryEvent.getNodeInstance().getNode().getRuleflowGroupName();
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.DroolsNodeType;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
|
|
@ -27,7 +28,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class AfterNodeLeftEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
AfterNodeLeftHistoryEvent afterNodeLeftHistoryEvent = (AfterNodeLeftHistoryEvent) historyEvent;
|
||||
if (afterNodeLeftHistoryEvent.getNodeInstance().getNode().getNodeType() == DroolsNodeType.RuleNode) {
|
||||
String ruleFlowName = afterNodeLeftHistoryEvent.getNodeInstance().getNode().getRuleflowGroupName();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.process.AfterProcessEndHistoryEvent;
|
||||
|
|
@ -26,7 +27,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class AfterProcessEndHistoryEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
AfterProcessEndHistoryEvent afterProcessEndHistoryEvent = (AfterProcessEndHistoryEvent) historyEvent;
|
||||
|
||||
ProcessExecution processExecution = sessionContext.getProcessExecution();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.process.AfterProcessStartHistoryEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class AfterProcessStartEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.process.AfterVariableChangeChangedHistoryEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class AfterVariableChangeEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.process.BeforeNodeInstanceTriggeredHistoryEvent;
|
||||
|
|
@ -23,7 +24,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class BeforeNodeInstanceTriggeredEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.process.BeforeNodeLeftHistoryEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class BeforeNodeLeftEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.process.BeforeProcessEndHistoryEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class BeforeProcessEndEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.process.BeforeProcessStartHistoryEvent;
|
||||
|
|
@ -26,7 +27,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class BeforeProcessStartEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
BeforeProcessStartHistoryEvent beforeProcessStartHistoryEvent = (BeforeProcessStartHistoryEvent) historyEvent;
|
||||
|
||||
ProcessExecution processExecution = new ProcessExecution();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.process;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.process.BeforeVariableChangeChangedHistoryEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class BeforeVariableChangeEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.rule;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.rule.AfterRuleFiredHistoryEvent;
|
||||
|
|
@ -25,7 +26,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class AfterRuleFiredEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
AfterRuleFiredHistoryEvent afterRuleFiredHistoryEvent = (AfterRuleFiredHistoryEvent) historyEvent;
|
||||
|
||||
RuleExecution ruleExecution = sessionContext.getRuleExecution();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.rule;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.rule.AfterRuleFlowActivatedHistoryEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class AfterRuleflowGroupActivatedEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
package org.chtijbug.drools.runtimeevent.impl.rule;
|
||||
|
||||
|
||||
import com.rits.cloning.Cloner;
|
||||
import org.chtijbug.drools.SessionContext;
|
||||
import org.chtijbug.drools.entity.history.HistoryEvent;
|
||||
import org.chtijbug.drools.entity.history.rule.AfterRuleFlowDeactivatedHistoryEvent;
|
||||
|
|
@ -24,7 +25,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class AfterRuleflowGroupDeactivatedEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext, Cloner cloner) {
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.chtijbug.drools.runtimeevent.AbstractMemoryEventHandlerStrategy;
|
|||
public class BeforeRuleFiredEventStrategy implements AbstractMemoryEventHandlerStrategy {
|
||||
|
||||
@Override
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext) {
|
||||
public void handleMessageInternally(HistoryEvent historyEvent, SessionContext sessionContext,Cloner cloner) {
|
||||
BeforeRuleFiredHistoryEvent beforeRuleFiredHistoryEvent = (BeforeRuleFiredHistoryEvent) historyEvent;
|
||||
RuleExecution ruleExecution = new RuleExecution();
|
||||
sessionContext.setRuleExecution(ruleExecution);
|
||||
|
|
@ -50,7 +50,6 @@ public class BeforeRuleFiredEventStrategy implements AbstractMemoryEventHandlerS
|
|||
ruleExecution.setRuleName(beforeRuleFiredHistoryEvent.getRule().getRuleName());
|
||||
ruleExecution.setPackageName(beforeRuleFiredHistoryEvent.getRule().getRulePackageName());
|
||||
ruleExecution.setStartEventID(beforeRuleFiredHistoryEvent.getEventID());
|
||||
Cloner cloner = new Cloner();
|
||||
for (DroolsFactObject droolsFactObject : beforeRuleFiredHistoryEvent.getWhenObjects()) {
|
||||
if (droolsFactObject != null) {
|
||||
Fact fact = new Fact();
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue