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 void afterVariableChanged(ProcessVariableChangedEvent event) { logger.debug("after variable"); VariableScope variableScope = (VariableScope) ((org.jbpm.process.core.impl.ProcessImpl) event.getProcessInstance().getProcess()) .resolveContext(VariableScope.VARIABLE_SCOPE, event.getVariableId()); if (variableScope == null) { return; } Map<String, Object> metaData = variableScope.findVariable(event.getVariableId()).getMetaData(); for (Map.Entry<String, Object> entry: metaData.entrySet()) { logger.debug(entry.getKey() + " " + entry.getValue()); } String customTag = (String) metaData.get("customTagVar"); if (customTag != null) { list3.add(customTag); } } public void afterProcessStarted(ProcessStartedEvent event) {
public ProcessInstance getProcessInstance() { return new ProcessInstanceAdapter(event.getProcessInstance()); } public KnowledgeRuntime getKnowledgeRuntime() {
public ProcessInstance getProcessInstance() { return new ProcessInstanceAdapter(event.getProcessInstance()); } public KnowledgeRuntime getKnowledgeRuntime() {
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); } }
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) { logger.debug("after variable"); VariableScope variableScope = (VariableScope) ((org.jbpm.process.core.impl.ProcessImpl) event.getProcessInstance().getProcess()) .resolveContext(VariableScope.VARIABLE_SCOPE, event.getVariableId()); if (variableScope == null) { return; } Map<String, Object> metaData = variableScope.findVariable(event.getVariableId()).getMetaData(); for (Map.Entry<String, Object> entry: metaData.entrySet()) { logger.debug(entry.getKey() + " " + entry.getValue()); } String customTag = (String) metaData.get("customTagVar"); if (customTag != null) { list3.add(customTag); } } public void afterProcessStarted(ProcessStartedEvent event) {