本文整理汇总了Java中org.activiti.engine.impl.pvm.delegate.ActivityExecution.inactivate方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityExecution.inactivate方法的具体用法?Java ActivityExecution.inactivate怎么用?Java ActivityExecution.inactivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.pvm.delegate.ActivityExecution
的用法示例。
在下文中一共展示了ActivityExecution.inactivate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.activiti.engine.impl.pvm.delegate.ActivityExecution; //导入方法依赖的package包/类
@Override
public void execute(DelegateExecution execution) {
ActivityExecution activityExecution = (ActivityExecution) execution;
activityExecution.inactivate();
lockConcurrentRoot(activityExecution);
PvmActivity activity = activityExecution.getActivity();
if (!activeConcurrentExecutionsExist(activityExecution)) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("inclusive gateway '{}' activates", activity.getId());
}
List<ActivityExecution> joinedExecutions = activityExecution.findInactiveConcurrentExecutions(activity);
String defaultSequenceFlow = (String) activityExecution.getActivity().getProperty("default");
List<PvmTransition> transitionsToTake = new ArrayList<>();
for (PvmTransition outgoingTransition : activityExecution.getActivity().getOutgoingTransitions()) {
Expression skipExpression = outgoingTransition.getSkipExpression();
if (!SkipExpressionUtil.isSkipExpressionEnabled(activityExecution, skipExpression)) {
if (defaultSequenceFlow == null || !outgoingTransition.getId().equals(defaultSequenceFlow)) {
Condition condition = (Condition) outgoingTransition.getProperty(BpmnParse.PROPERTYNAME_CONDITION);
if (condition == null || condition.evaluate(outgoingTransition.getId(), execution)) {
transitionsToTake.add(outgoingTransition);
}
}
} else if (SkipExpressionUtil.shouldSkipFlowElement(activityExecution, skipExpression)) {
transitionsToTake.add(outgoingTransition);
}
}
if (!transitionsToTake.isEmpty()) {
activityExecution.takeAll(transitionsToTake, joinedExecutions);
} else {
if (defaultSequenceFlow != null) {
PvmTransition defaultTransition = activityExecution.getActivity().findOutgoingTransition(defaultSequenceFlow);
if (defaultTransition != null) {
activityExecution.take(defaultTransition);
} else {
throw new ActivitiException("Default sequence flow '"
+ defaultSequenceFlow + "' could not be not found");
}
} else {
// No sequence flow could be found, not even a default one
throw new ActivitiException(
"No outgoing sequence flow of the inclusive gateway '"
+ activityExecution.getActivity().getId()
+ "' could be selected for continuing the process");
}
}
} else {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Inclusive gateway '{}' does not activate", activity.getId());
}
}
}