use of org.camunda.bpm.engine.cdi.BusinessProcessEventType in project camunda-bpm-platform by camunda.
the class CdiEventListener method createEvent.
protected BusinessProcessEvent createEvent(DelegateExecution execution) {
ProcessDefinition processDefinition = Context.getExecutionContext().getProcessDefinition();
// map type
String eventName = execution.getEventName();
BusinessProcessEventType type = null;
if (ExecutionListener.EVENTNAME_START.equals(eventName)) {
type = BusinessProcessEventType.START_ACTIVITY;
} else if (ExecutionListener.EVENTNAME_END.equals(eventName)) {
type = BusinessProcessEventType.END_ACTIVITY;
} else if (ExecutionListener.EVENTNAME_TAKE.equals(eventName)) {
type = BusinessProcessEventType.TAKE;
}
return new CdiBusinessProcessEvent(execution.getCurrentActivityId(), execution.getCurrentTransitionId(), processDefinition, execution, type, ClockUtil.getCurrentTime());
}
use of org.camunda.bpm.engine.cdi.BusinessProcessEventType 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