本文整理汇总了Java中org.activiti.engine.impl.pvm.delegate.ActivityExecution.destroyScope方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityExecution.destroyScope方法的具体用法?Java ActivityExecution.destroyScope怎么用?Java ActivityExecution.destroyScope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.pvm.delegate.ActivityExecution
的用法示例。
在下文中一共展示了ActivityExecution.destroyScope方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) {
ActivityExecution activityExecution = (ActivityExecution) execution;
InterpretableExecution interpretableExecution = (InterpretableExecution) execution;
ActivityImpl activity = interpretableExecution.getProcessDefinition().findActivity(activityId);
ActivityExecution outgoingExecution = activityExecution;
if (isInterrupting) {
activityExecution.destroyScope("Event subprocess triggered using activity " + activityId);
} else {
outgoingExecution = activityExecution.createExecution();
outgoingExecution.setActive(true);
outgoingExecution.setScope(false);
outgoingExecution.setConcurrent(true);
}
// set the outgoing execution to this activity
((InterpretableExecution) outgoingExecution).setActivity(activity);
// continue execution
outgoingExecution.takeAll(activity.getOutgoingTransitions(), Collections.EMPTY_LIST);
}
示例2: terminateExecution
import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
protected void terminateExecution(ActivityExecution execution, ActivityImpl terminateEndEventActivity, ActivityExecution scopeExecution) {
// send cancelled event
sendCancelledEvent(execution, terminateEndEventActivity, scopeExecution);
// destroy the scope
scopeExecution.destroyScope("terminate end event fired");
// set the scope execution to the terminate end event and make it end here.
// (the history should reflect that the execution ended here and we want an 'end time' for the
// historic activity instance.)
((InterpretableExecution) scopeExecution).setActivity(terminateEndEventActivity);
// end the scope execution
scopeExecution.end();
// Scope execution can already have been ended (for example when multiple seq flow arrive in the same terminate end event)
// in that case, we need to make sure the activity instance is ended
if (scopeExecution.isEnded()) {
Context.getCommandContext().getHistoryManager().recordActivityEnd((ExecutionEntity) execution);
}
}
示例3: execute
import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) {
ActivityExecution activityExecution = (ActivityExecution) execution;
// find cancel boundary event:
ActivityImpl cancelBoundaryEvent = ScopeUtil
.findInParentScopesByBehaviorType((ActivityImpl) activityExecution.getActivity(), CancelBoundaryEventActivityBehavior.class);
if (cancelBoundaryEvent == null) {
throw new ActivitiException("Could not find cancel boundary event for cancel end event " + activityExecution.getActivity());
}
ActivityExecution scopeExecution = ScopeUtil.findScopeExecutionForScope((ExecutionEntity) execution, cancelBoundaryEvent.getParentActivity());
// end all executions and process instances in the scope of the transaction
scopeExecution.destroyScope("cancel end event fired");
// the scope execution executes the boundary event
InterpretableExecution outgoingExecution = (InterpretableExecution) scopeExecution;
outgoingExecution.setActivity(cancelBoundaryEvent);
outgoingExecution.setActive(true);
// execute the boundary
cancelBoundaryEvent
.getActivityBehavior()
.execute(outgoingExecution);
}