use of org.camunda.bpm.engine.impl.history.event.HistoryEvent in project camunda-bpm-platform by camunda.
the class DefaultFormHandler method fireFormPropertyHistoryEvents.
protected void fireFormPropertyHistoryEvents(VariableMap properties, VariableScope variableScope) {
final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = processEngineConfiguration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.FORM_PROPERTY_UPDATE, variableScope)) {
// fire history events
final ExecutionEntity executionEntity;
final String taskId;
if (variableScope instanceof ExecutionEntity) {
executionEntity = (ExecutionEntity) variableScope;
taskId = null;
} else if (variableScope instanceof TaskEntity) {
TaskEntity task = (TaskEntity) variableScope;
executionEntity = task.getExecution();
taskId = task.getId();
} else {
executionEntity = null;
taskId = null;
}
if (executionEntity != null) {
for (final String variableName : properties.keySet()) {
final TypedValue value = properties.getValueTyped(variableName);
// NOTE: SerializableValues are never stored as form properties
if (!(value instanceof SerializableValue) && value.getValue() != null && value.getValue() instanceof String) {
final String stringValue = (String) value.getValue();
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createFormPropertyUpdateEvt(executionEntity, variableName, stringValue, taskId);
}
});
}
}
}
}
}
use of org.camunda.bpm.engine.impl.history.event.HistoryEvent in project camunda-bpm-platform by camunda.
the class HistoryExecutionListener method notify.
public void notify(DelegateExecution execution) throws Exception {
// get the event handler
final HistoryEventHandler historyEventHandler = Context.getProcessEngineConfiguration().getHistoryEventHandler();
// delegate creation of the history event to the producer
HistoryEvent historyEvent = createHistoryEvent(execution);
if (historyEvent != null) {
// pass the event to the handler
historyEventHandler.handleEvent(historyEvent);
}
}
use of org.camunda.bpm.engine.impl.history.event.HistoryEvent in project camunda-bpm-platform by camunda.
the class HistoryTaskListener method notify.
public void notify(DelegateTask task) {
// get the event handler
final HistoryEventHandler historyEventHandler = Context.getProcessEngineConfiguration().getHistoryEventHandler();
ExecutionEntity execution = ((TaskEntity) task).getExecution();
if (execution != null) {
// delegate creation of the history event to the producer
HistoryEvent historyEvent = createHistoryEvent(task, execution);
if (historyEvent != null) {
// pass the event to the handler
historyEventHandler.handleEvent(historyEvent);
}
}
}
use of org.camunda.bpm.engine.impl.history.event.HistoryEvent in project camunda-bpm-platform by camunda.
the class CaseExecutionEntity method fireHistoricCaseActivityInstanceUpdate.
public void fireHistoricCaseActivityInstanceUpdate() {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.CASE_ACTIVITY_INSTANCE_UPDATE, this)) {
CmmnHistoryEventProducer eventProducer = configuration.getCmmnHistoryEventProducer();
HistoryEventHandler eventHandler = configuration.getHistoryEventHandler();
HistoryEvent event = eventProducer.createCaseActivityInstanceUpdateEvt(this);
eventHandler.handleEvent(event);
}
}
use of org.camunda.bpm.engine.impl.history.event.HistoryEvent in project camunda-bpm-platform by camunda.
the class ExecutionEntity method fireHistoricProcessStartEvent.
@Override
public void fireHistoricProcessStartEvent() {
ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
HistoryLevel historyLevel = configuration.getHistoryLevel();
// ParseListener
if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_START, processInstance)) {
HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() {
@Override
public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return producer.createProcessInstanceStartEvt(processInstance);
}
});
}
}
Aggregations