Java Code Examples for org.camunda.bpm.engine.delegate.DelegateTask#getEventName()

The following examples show how to use org.camunda.bpm.engine.delegate.DelegateTask#getEventName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskEvent.java    From camunda-bpm-spring-boot-starter with Apache License 2.0 6 votes vote down vote up
public TaskEvent(DelegateTask delegateTask) {
  this.assignee = delegateTask.getAssignee();
  this.caseDefinitionId = delegateTask.getCaseDefinitionId();
  this.caseExecutionId = delegateTask.getCaseExecutionId();
  this.caseInstanceId = delegateTask.getCaseInstanceId();
  this.createTime = delegateTask.getCreateTime();
  this.deleteReason = delegateTask.getDeleteReason();
  this.description = delegateTask.getDescription();
  this.dueDate = delegateTask.getDueDate();
  this.eventName = delegateTask.getEventName();
  this.executionId = delegateTask.getExecutionId();
  this.followUpDate = delegateTask.getFollowUpDate();
  this.id = delegateTask.getId();
  this.name = delegateTask.getName();
  this.owner = delegateTask.getOwner();
  this.priority = delegateTask.getPriority();
  this.processDefinitionId = delegateTask.getProcessDefinitionId();
  this.processInstanceId = delegateTask.getProcessInstanceId();
  this.taskDefinitionKey = delegateTask.getTaskDefinitionKey();
  this.tenantId = delegateTask.getTenantId();
}
 
Example 2
Source File: TaskEvent.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
public TaskEvent(DelegateTask delegateTask) {
  this.assignee = delegateTask.getAssignee();
  this.caseDefinitionId = delegateTask.getCaseDefinitionId();
  this.caseExecutionId = delegateTask.getCaseExecutionId();
  this.caseInstanceId = delegateTask.getCaseInstanceId();
  this.createTime = delegateTask.getCreateTime();
  this.deleteReason = delegateTask.getDeleteReason();
  this.description = delegateTask.getDescription();
  this.dueDate = delegateTask.getDueDate();
  this.eventName = delegateTask.getEventName();
  this.executionId = delegateTask.getExecutionId();
  this.followUpDate = delegateTask.getFollowUpDate();
  this.id = delegateTask.getId();
  this.name = delegateTask.getName();
  this.owner = delegateTask.getOwner();
  this.priority = delegateTask.getPriority();
  this.processDefinitionId = delegateTask.getProcessDefinitionId();
  this.processInstanceId = delegateTask.getProcessInstanceId();
  this.taskDefinitionKey = delegateTask.getTaskDefinitionKey();
  this.tenantId = delegateTask.getTenantId();
}
 
Example 3
Source File: RecorderTaskListener.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
public void notify(DelegateTask task) {
  DelegateExecution execution = task.getExecution();
  String eventName = task.getEventName();

  recordedEvents.add(new RecordedTaskEvent(task.getId(),
                                           task.getExecutionId(),
                                           eventName,
                                           execution.getActivityInstanceId()));
  orderedEvents.addLast(eventName);

  Integer counter = eventCounters.get(eventName);
  if (counter == null) {
    eventCounters.put(eventName, 1);
  } else {
    eventCounters.put(eventName, ++counter);
  }
}
 
Example 4
Source File: CdiEventListener.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
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_UPDATE.equals(eventName)) {
    type = BusinessProcessEventType.UPDATE_TASK;
  }
  else if (TaskListener.EVENTNAME_DELETE.equals(eventName)) {
    type = BusinessProcessEventType.DELETE_TASK;
  }

  return new CdiBusinessProcessEvent(task, processDefinition, type, ClockUtil.getCurrentTime());
}