本文整理了Java中org.activiti.bpmn.model.Activity.getBoundaryEvents()
方法的一些代码示例,展示了Activity.getBoundaryEvents()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.getBoundaryEvents()
方法的具体详情如下:
包路径:org.activiti.bpmn.model.Activity
类名称:Activity
方法名:getBoundaryEvents
暂无
代码示例来源:origin: Activiti/Activiti
protected void cleanupExecutions(FlowElement currentFlowElement) {
if (execution.getParentId() != null && execution.isScope()) {
// If the execution is a scope (and not a process instance), the scope must first be
// destroyed before we can continue and follow the sequence flow
Context.getAgenda().planDestroyScopeOperation(execution);
} else if (currentFlowElement instanceof Activity) {
// If the current activity is an activity, we need to remove any currently active boundary events
Activity activity = (Activity) currentFlowElement;
if (CollectionUtil.isNotEmpty(activity.getBoundaryEvents())) {
// Cancel events are not removed
List<String> notToDeleteEvents = new ArrayList<String>();
for (BoundaryEvent event : activity.getBoundaryEvents()) {
if (CollectionUtil.isNotEmpty(event.getEventDefinitions()) &&
event.getEventDefinitions().get(0) instanceof CancelEventDefinition) {
notToDeleteEvents.add(event.getId());
}
}
// Delete all child executions
Collection<ExecutionEntity> childExecutions = commandContext.getExecutionEntityManager().findChildExecutionsByParentExecutionId(execution.getId());
for (ExecutionEntity childExecution : childExecutions) {
if (childExecution.getCurrentFlowElement() == null || !notToDeleteEvents.contains(childExecution.getCurrentFlowElement().getId())) {
commandContext.getExecutionEntityManager().deleteExecutionAndRelatedData(childExecution,
null,
false);
}
}
}
}
}
代码示例来源:origin: Activiti/Activiti
Activity attachedActivity = (Activity) attachedToElement;
boundaryEvent.setAttachedToRef(attachedActivity);
attachedActivity.getBoundaryEvents().add(boundaryEvent);
代码示例来源:origin: Activiti/Activiti
} else {
boundaryEvent.setAttachedToRef(activity);
activity.getBoundaryEvents().add(boundaryEvent);
代码示例来源:origin: Activiti/Activiti
for (BoundaryEvent boundaryEvent : activity.getBoundaryEvents()) {
outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(boundaryEvent.getId()));
代码示例来源:origin: Activiti/Activiti
protected void executeMultiInstanceSynchronous(FlowNode flowNode) {
// Execution listener: event 'start'
if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) {
executeExecutionListeners(flowNode,
ExecutionListener.EVENTNAME_START);
}
// Execute any boundary events, sub process boundary events will be executed from the activity behavior
if (!inCompensation && flowNode instanceof Activity) { // Only activities can have boundary events
List<BoundaryEvent> boundaryEvents = ((Activity) flowNode).getBoundaryEvents();
if (CollectionUtil.isNotEmpty(boundaryEvents)) {
executeBoundaryEvents(boundaryEvents,
execution);
}
}
// Execute the multi instance behavior
ActivityBehavior activityBehavior = (ActivityBehavior) flowNode.getBehavior();
if (activityBehavior != null) {
executeActivityBehavior(activityBehavior,
flowNode);
} else {
throw new ActivitiException("Expected an activity behavior in flow node " + flowNode.getId());
}
}
代码示例来源:origin: Activiti/Activiti
protected void executeSynchronous(FlowNode flowNode) {
commandContext.getHistoryManager().recordActivityStart(execution);
// Execution listener: event 'start'
if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) {
executeExecutionListeners(flowNode,
ExecutionListener.EVENTNAME_START);
}
// Execute any boundary events, sub process boundary events will be executed from the activity behavior
if (!inCompensation && flowNode instanceof Activity) { // Only activities can have boundary events
List<BoundaryEvent> boundaryEvents = ((Activity) flowNode).getBoundaryEvents();
if (CollectionUtil.isNotEmpty(boundaryEvents)) {
executeBoundaryEvents(boundaryEvents,
execution);
}
}
// Execute actual behavior
ActivityBehavior activityBehavior = (ActivityBehavior) flowNode.getBehavior();
if (activityBehavior != null) {
executeActivityBehavior(activityBehavior,
flowNode);
} else {
logger.debug("No activityBehavior on activity '{}' with execution {}",
flowNode.getId(),
execution.getId());
Context.getAgenda().planTakeOutgoingSequenceFlowsOperation(execution,
true);
}
}
代码示例来源:origin: Activiti/Activiti
if (subElement instanceof Activity) {
Activity subActivity = (Activity) subElement;
if (CollectionUtil.isNotEmpty(subActivity.getBoundaryEvents())) {
for (BoundaryEvent boundaryEvent : subActivity.getBoundaryEvents()) {
if (CollectionUtil.isNotEmpty(boundaryEvent.getEventDefinitions()) &&
boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
代码示例来源:origin: Activiti/Activiti
if (subElement instanceof Activity) {
Activity subActivity = (Activity) subElement;
if (CollectionUtil.isNotEmpty(subActivity.getBoundaryEvents())) {
for (BoundaryEvent boundaryEvent : subActivity.getBoundaryEvents()) {
if (CollectionUtil.isNotEmpty(boundaryEvent.getEventDefinitions()) &&
boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
代码示例来源:origin: org.activiti/activiti-engine
protected void cleanupExecutions(FlowElement currentFlowElement) {
if (execution.getParentId() != null && execution.isScope()) {
// If the execution is a scope (and not a process instance), the scope must first be
// destroyed before we can continue and follow the sequence flow
Context.getAgenda().planDestroyScopeOperation(execution);
} else if (currentFlowElement instanceof Activity) {
// If the current activity is an activity, we need to remove any currently active boundary events
Activity activity = (Activity) currentFlowElement;
if (CollectionUtil.isNotEmpty(activity.getBoundaryEvents())) {
// Cancel events are not removed
List<String> notToDeleteEvents = new ArrayList<String>();
for (BoundaryEvent event : activity.getBoundaryEvents()) {
if (CollectionUtil.isNotEmpty(event.getEventDefinitions()) &&
event.getEventDefinitions().get(0) instanceof CancelEventDefinition) {
notToDeleteEvents.add(event.getId());
}
}
// Delete all child executions
Collection<ExecutionEntity> childExecutions = commandContext.getExecutionEntityManager().findChildExecutionsByParentExecutionId(execution.getId());
for (ExecutionEntity childExecution : childExecutions) {
if (childExecution.getCurrentFlowElement() == null || !notToDeleteEvents.contains(childExecution.getCurrentFlowElement().getId())) {
commandContext.getExecutionEntityManager().deleteExecutionAndRelatedData(childExecution, null, false);
}
}
}
}
}
代码示例来源:origin: com.bbossgroups.activiti/activiti-bpmn-converter
private void processFlowElements(Collection<FlowElement> flowElementList, BaseElement parentScope) {
for (FlowElement flowElement : flowElementList) {
if (flowElement instanceof SequenceFlow) {
SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
FlowNode sourceNode = getFlowNodeFromScope(sequenceFlow.getSourceRef(), parentScope);
if (sourceNode != null) {
sourceNode.getOutgoingFlows().add(sequenceFlow);
}
FlowNode targetNode = getFlowNodeFromScope(sequenceFlow.getTargetRef(), parentScope);
if (targetNode != null) {
targetNode.getIncomingFlows().add(sequenceFlow);
}
} else if (flowElement instanceof BoundaryEvent) {
BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
FlowElement attachedToElement = getFlowNodeFromScope(boundaryEvent.getAttachedToRefId(), parentScope);
if(attachedToElement != null) {
boundaryEvent.setAttachedToRef((Activity) attachedToElement);
((Activity) attachedToElement).getBoundaryEvents().add(boundaryEvent);
}
} else if(flowElement instanceof SubProcess) {
SubProcess subProcess = (SubProcess) flowElement;
processFlowElements(subProcess.getFlowElements(), subProcess);
}
}
}
代码示例来源:origin: org.activiti/activiti-bpmn-converter
Activity attachedActivity = (Activity) attachedToElement;
boundaryEvent.setAttachedToRef(attachedActivity);
attachedActivity.getBoundaryEvents().add(boundaryEvent);
代码示例来源:origin: org.activiti/activiti-json-converter
} else {
boundaryEvent.setAttachedToRef(activity);
activity.getBoundaryEvents().add(boundaryEvent);
代码示例来源:origin: org.activiti/activiti-engine
protected void executeMultiInstanceSynchronous(FlowNode flowNode) {
// Execution listener: event 'start'
if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) {
executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_START);
}
// Execute any boundary events, sub process boundary events will be executed from the activity behavior
if (!inCompensation && flowNode instanceof Activity) { // Only activities can have boundary events
List<BoundaryEvent> boundaryEvents = ((Activity) flowNode).getBoundaryEvents();
if (CollectionUtil.isNotEmpty(boundaryEvents)) {
executeBoundaryEvents(boundaryEvents, execution);
}
}
// Execute the multi instance behavior
ActivityBehavior activityBehavior = (ActivityBehavior) flowNode.getBehavior();
if (activityBehavior != null) {
executeActivityBehavior(activityBehavior, flowNode);
} else {
throw new ActivitiException("Expected an activity behavior in flow node " + flowNode.getId());
}
}
代码示例来源:origin: org.activiti/activiti-json-converter
for (BoundaryEvent boundaryEvent : activity.getBoundaryEvents()) {
outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(boundaryEvent.getId()));
代码示例来源:origin: org.activiti/activiti-engine
protected void executeSynchronous(FlowNode flowNode) {
commandContext.getHistoryManager().recordActivityStart(execution);
// Execution listener: event 'start'
if (CollectionUtil.isNotEmpty(flowNode.getExecutionListeners())) {
executeExecutionListeners(flowNode, ExecutionListener.EVENTNAME_START);
}
// Execute any boundary events, sub process boundary events will be executed from the activity behavior
if (!inCompensation && flowNode instanceof Activity) { // Only activities can have boundary events
List<BoundaryEvent> boundaryEvents = ((Activity) flowNode).getBoundaryEvents();
if (CollectionUtil.isNotEmpty(boundaryEvents)) {
executeBoundaryEvents(boundaryEvents, execution);
}
}
// Execute actual behavior
ActivityBehavior activityBehavior = (ActivityBehavior) flowNode.getBehavior();
if (activityBehavior != null) {
executeActivityBehavior(activityBehavior, flowNode);
} else {
logger.debug("No activityBehavior on activity '{}' with execution {}", flowNode.getId(), execution.getId());
Context.getAgenda().planTakeOutgoingSequenceFlowsOperation(execution, true);
}
}
代码示例来源:origin: org.activiti/activiti-engine
if (subElement instanceof Activity) {
Activity subActivity = (Activity) subElement;
if (CollectionUtil.isNotEmpty(subActivity.getBoundaryEvents())) {
for (BoundaryEvent boundaryEvent : subActivity.getBoundaryEvents()) {
if (CollectionUtil.isNotEmpty(boundaryEvent.getEventDefinitions()) &&
boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
代码示例来源:origin: org.activiti/activiti-engine
if (subElement instanceof Activity) {
Activity subActivity = (Activity) subElement;
if (CollectionUtil.isNotEmpty(subActivity.getBoundaryEvents())) {
for (BoundaryEvent boundaryEvent : subActivity.getBoundaryEvents()) {
if (CollectionUtil.isNotEmpty(boundaryEvent.getEventDefinitions()) &&
boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
内容来源于网络,如有侵权,请联系作者删除!