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()); }
@Override void setValueIntoDictionary(Dictionary<String, String> dictionary, DelegateExecution execution) { if (execution.getCurrentTransitionId() != null) { dictionary.put(getPropertyKey(), execution.getCurrentTransitionId()); } }
public void notify(DelegateExecution execution) throws Exception { ExecutionEntity executionCasted = ((ExecutionEntity)execution); String parameterValue = null; if (parameter != null) { parameterValue = (String)parameter.getValue(execution); } String activityName = null; if (executionCasted.getActivity() != null) { activityName = executionCasted.getActivity().getProperties().get(new PropertyKey<String>("name")); } recordedEvents.add( new RecordedEvent( executionCasted.getActivityId(), activityName, execution.getEventName(), parameterValue, execution.getActivityInstanceId(), execution.getCurrentTransitionId(), execution.isCanceled(), execution.getId())); }
@Override void setValueIntoDictionary(Dictionary<String, String> dictionary, DelegateTask task) { if (task.getExecution().getCurrentTransitionId() != null) { dictionary.put(getPropertyKey(), task.getExecution().getCurrentTransitionId()); } } },
public static DelegateEvent fromExecution(DelegateExecution delegateExecution) { DelegateEvent event = new DelegateEvent(); event.activityInstanceId = delegateExecution.getActivityInstanceId(); event.businessKey = delegateExecution.getBusinessKey(); event.currentActivityId = delegateExecution.getCurrentActivityId(); event.currentActivityName = delegateExecution.getCurrentActivityName(); event.currentTransitionId = delegateExecution.getCurrentTransitionId(); event.eventName = delegateExecution.getEventName(); event.id = delegateExecution.getId(); event.parentActivityInstanceId = delegateExecution.getParentActivityInstanceId(); event.parentId = delegateExecution.getParentId(); event.processBusinessKey = delegateExecution.getProcessBusinessKey(); event.processDefinitionId = delegateExecution.getProcessDefinitionId(); event.processInstanceId = delegateExecution.getProcessInstanceId(); event.tenantId = delegateExecution.getTenantId(); event.variableScopeKey = delegateExecution.getVariableScopeKey(); return event; }
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()); }
public static SelectorBuilder selector(final DelegateExecution delegateExecution) { String typeName = extractTypeName(delegateExecution); String element = ("sequenceFlow".equals(typeName)) ? delegateExecution.getCurrentTransitionId() : delegateExecution.getCurrentActivityId(); return selector() .context(Context.bpmn) .type(typeName) .process(GetProcessDefinitionKey.from(delegateExecution)) .element(element) .event(delegateExecution.getEventName()); }
@Override public void notify(DelegateExecution execution) throws Exception { if (coverageTestRunState == null) { logger.warning("Coverage execution listener in use but no coverage run state assigned!"); return; } final RepositoryService repositoryService = execution.getProcessEngineServices().getRepositoryService(); // Get the process definition in order to obtain the key final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId( execution.getProcessDefinitionId()).singleResult(); final String transitionId = execution.getCurrentTransitionId(); // Record sequence flow coverage final CoveredSequenceFlow coveredSequenceFlow = new CoveredSequenceFlow(processDefinition.getKey(), transitionId); coverageTestRunState.addCoveredElement(coveredSequenceFlow); // Record possible event coverage handleEvent(transitionId, processDefinition, repositoryService); }
public void notify(DelegateExecution execution) throws Exception { ExecutionEntity executionCasted = ((ExecutionEntity)execution); String parameterValue = null; if (parameter != null) { parameterValue = (String)parameter.getValue(execution); } String activityName = null; if (executionCasted.getActivity() != null) { activityName = executionCasted.getActivity().getProperties().get(new PropertyKey<String>("name")); } recordedEvents.add( new RecordedEvent( executionCasted.getActivityId(), activityName, execution.getEventName(), parameterValue, execution.getActivityInstanceId(), execution.getCurrentTransitionId(), execution.isCanceled(), execution.getId())); }
public static DelegateEvent fromExecution(DelegateExecution delegateExecution) { DelegateEvent event = new DelegateEvent(); event.activityInstanceId = delegateExecution.getActivityInstanceId(); event.businessKey = delegateExecution.getBusinessKey(); event.currentActivityId = delegateExecution.getCurrentActivityId(); event.currentActivityName = delegateExecution.getCurrentActivityName(); event.currentTransitionId = delegateExecution.getCurrentTransitionId(); event.eventName = delegateExecution.getEventName(); event.id = delegateExecution.getId(); event.parentActivityInstanceId = delegateExecution.getParentActivityInstanceId(); event.parentId = delegateExecution.getParentId(); event.processBusinessKey = delegateExecution.getProcessBusinessKey(); event.processDefinitionId = delegateExecution.getProcessDefinitionId(); event.processInstanceId = delegateExecution.getProcessInstanceId(); event.tenantId = delegateExecution.getTenantId(); event.variableScopeKey = delegateExecution.getVariableScopeKey(); return event; }