public void afterVariableChanged(ProcessVariableChangedEvent event) { FactHandle handle = getProcessInstanceFactHandle(event.getProcessInstance().getId(), event.getKieRuntime()); if (handle != null) { event.getKieRuntime().update(handle, event.getProcessInstance()); } else { handle = event.getKieRuntime().insert(event.getProcessInstance()); store.put(event.getProcessInstance().getId(), handle); } }
@Override public AuditEvent buildEvent(ProcessVariableChangedEvent pvce) { long processInstanceId = pvce.getProcessInstance().getId(); String processId = pvce.getProcessInstance().getProcessId(); String variableId = pvce.getVariableId(); String variableInstanceId = pvce.getVariableInstanceId(); String oldValue = (pvce.getOldValue() != null)?pvce.getOldValue().toString():""; String newValue = (pvce.getNewValue() != null)?pvce.getNewValue().toString():""; VariableInstanceLog log = new VariableInstanceLog( processInstanceId, processId, variableInstanceId, variableId, newValue, oldValue); log.setExternalId(""+((KieSession) pvce.getKieRuntime()).getIdentifier()); return log; }
public KnowledgeRuntime getKnowledgeRuntime() { return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime()); } public String getVariableId() {
public KnowledgeRuntime getKnowledgeRuntime() { return new KnowledgeRuntimeAdapter((org.kie.internal.runtime.KnowledgeRuntime) event.getKieRuntime()); } public String getVariableId() {
public void afterVariableChanged(ProcessVariableChangedEvent event) { FactHandle handle = getProcessInstanceFactHandle(event.getProcessInstance().getId(), event.getKieRuntime()); if (handle != null) { event.getKieRuntime().update(handle, event.getProcessInstance()); } else { event.getKieRuntime().insert(event.getProcessInstance()); } }
public void afterVariableChanged(ProcessVariableChangedEvent event) { FactHandle handle = getProcessInstanceFactHandle(event.getProcessInstance().getId(), event.getKieRuntime()); if (handle != null) { event.getKieRuntime().update(handle, event.getProcessInstance()); } else { handle = event.getKieRuntime().insert(event.getProcessInstance()); store.put(event.getProcessInstance().getId(), handle); } }