use of org.camunda.bpm.engine.impl.context.ExecutionContext in project camunda-bpm-platform by camunda.
the class CdiEventListener method createEvent.
protected BusinessProcessEvent createEvent(DelegateTask task) {
ExecutionContext executionContext = Context.getExecutionContext();
ProcessDefinitionEntity processDefinition = null;
if (executionContext != null) {
processDefinition = executionContext.getProcessDefinition();
}
// map type
String eventName = task.getEventName();
BusinessProcessEventType type = null;
if (TaskListener.EVENTNAME_CREATE.equals(eventName)) {
type = BusinessProcessEventType.CREATE_TASK;
} else if (TaskListener.EVENTNAME_ASSIGNMENT.equals(eventName)) {
type = BusinessProcessEventType.ASSIGN_TASK;
} else if (TaskListener.EVENTNAME_COMPLETE.equals(eventName)) {
type = BusinessProcessEventType.COMPLETE_TASK;
} else if (TaskListener.EVENTNAME_DELETE.equals(eventName)) {
type = BusinessProcessEventType.DELETE_TASK;
}
return new CdiBusinessProcessEvent(task, processDefinition, type, ClockUtil.getCurrentTime());
}
Aggregations