本文整理汇总了Java中org.camunda.bpm.engine.delegate.DelegateExecution.getEventName方法的典型用法代码示例。如果您正苦于以下问题:Java DelegateExecution.getEventName方法的具体用法?Java DelegateExecution.getEventName怎么用?Java DelegateExecution.getEventName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.delegate.DelegateExecution
的用法示例。
在下文中一共展示了DelegateExecution.getEventName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEvent
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
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());
}
示例2: fromExecution
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
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;
}
示例3: notify
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void notify(DelegateExecution execution) throws Exception {
if (!execution.hasVariableLocal(variableName)) {
return;
}
Object value = execution.getVariableLocal(variableName);
VariableEvent event = new VariableEvent();
event.variableName = variableName;
event.variableValue = value;
event.eventName = execution.getEventName();
event.activityInstanceId = execution.getActivityInstanceId();
variableEvents.add(event);
}
示例4: handleProcessLog
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
/**
* Checks if the current execution matches the configuration. If {@code yes} performs desired
* operation; here just prints a message that was specified in the DMN model.
*
* @param execution the current execution
*/
private void handleProcessLog(final DelegateExecution execution) {
if (execution.getCurrentActivityId() != null && execution.getEventName() != null) {
VariableMap variables =
Variables.putValue("activityId", execution.getCurrentActivityId())
.putValue("eventName", execution.getEventName());
DmnDecisionTableResult result =
dmnEngine.evaluateDecisionTable(eventLogDecision, variables);
if (!result.isEmpty()) {
// the configuration matched the event
System.out.println(">>> " + result.getSingleEntry().toString());
}
}
}
示例5: testIntermediateTimerEvent
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Deployment
public void testIntermediateTimerEvent() {
// given
final List<String> timerEvents = new ArrayList<String>();
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication() {
public ExecutionListener getExecutionListener() {
return new ExecutionListener() {
public void notify(DelegateExecution delegateExecution) {
String currentActivityId = delegateExecution.getCurrentActivityId();
String eventName = delegateExecution.getEventName();
if ("timer".equals(currentActivityId) &&
(ExecutionListener.EVENTNAME_START.equals(eventName) || ExecutionListener.EVENTNAME_END.equals(eventName))) {
timerEvents.add(delegateExecution.getEventName());
}
}
};
}
};
// register app so that it is notified about events
managementService.registerProcessApplication(deploymentId, processApplication.getReference());
// when
runtimeService.startProcessInstanceByKey("process");
String jobId = managementService.createJobQuery().singleResult().getId();
managementService.executeJob(jobId);
// then
assertEquals(2, timerEvents.size());
// "start" event listener
assertEquals(ExecutionListener.EVENTNAME_START, timerEvents.get(0));
// "end" event listener
assertEquals(ExecutionListener.EVENTNAME_END, timerEvents.get(1));
}
示例6: testIntermediateSignalEvent
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Deployment
public void testIntermediateSignalEvent() {
// given
final List<String> timerEvents = new ArrayList<String>();
EmbeddedProcessApplication processApplication = new EmbeddedProcessApplication() {
public ExecutionListener getExecutionListener() {
return new ExecutionListener() {
public void notify(DelegateExecution delegateExecution) {
String currentActivityId = delegateExecution.getCurrentActivityId();
String eventName = delegateExecution.getEventName();
if ("signal".equals(currentActivityId) &&
(ExecutionListener.EVENTNAME_START.equals(eventName) || ExecutionListener.EVENTNAME_END.equals(eventName))) {
timerEvents.add(delegateExecution.getEventName());
}
}
};
}
};
// register app so that it is notified about events
managementService.registerProcessApplication(deploymentId, processApplication.getReference());
// when
runtimeService.startProcessInstanceByKey("process");
runtimeService.signalEventReceived("abort");
// then
assertEquals(2, timerEvents.size());
// "start" event listener
assertEquals(ExecutionListener.EVENTNAME_START, timerEvents.get(0));
// "end" event listener
assertEquals(ExecutionListener.EVENTNAME_END, timerEvents.get(1));
}
示例7: notify
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
@Override
public void notify(DelegateExecution execution) throws Exception {
final CoveredFlowNode coveredFlowNode = createCoveredFlowNode(execution);
final String eventName = execution.getEventName();
if (eventName.equals(ExecutionListener.EVENTNAME_START)) {
coverageTestRunState.addCoveredElement(coveredFlowNode);
} else if (eventName.equals(ExecutionListener.EVENTNAME_END)) {
coverageTestRunState.endCoveredElement(coveredFlowNode);
}
}
开发者ID:camunda,项目名称:camunda-bpm-process-test-coverage,代码行数:17,代码来源:IntermediateEventExecutionListener.java
示例8: notify
import org.camunda.bpm.engine.delegate.DelegateExecution; //导入方法依赖的package包/类
public void notify(DelegateExecution execution) throws Exception {
String counterKey = execution.getCurrentActivityId() + "-" +execution.getEventName();
collectedEvents.add(counterKey);
}