本文整理汇总了Java中org.activiti.engine.impl.context.Context.removeProcessEngineConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java Context.removeProcessEngineConfiguration方法的具体用法?Java Context.removeProcessEngineConfiguration怎么用?Java Context.removeProcessEngineConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.impl.context.Context
的用法示例。
在下文中一共展示了Context.removeProcessEngineConfiguration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.activiti.engine.impl.context.Context; //导入方法依赖的package包/类
@Override
public <T> T execute(CommandConfig config, Command<T> command) {
CommandContext context = Context.getCommandContext();
boolean contextReused = false;
// We need to check the exception, because the transaction can be in a rollback state,
// and some other command is being fired to compensate (eg. decrementing job retries)
if (!config.isContextReusePossible() || context == null || context.getException() != null) {
context = commandContextFactory.createCommandContext(command);
} else {
LOGGER.debug("Valid context found. Reusing it for the current command '{}'", command.getClass().getCanonicalName());
contextReused = true;
}
try {
// Push on stack
Context.setCommandContext(context);
Context.setProcessEngineConfiguration(processEngineConfiguration);
Flowable5CompatibilityContext.setFallbackFlowable5CompatibilityHandler(processEngineConfiguration.getFlowable5CompatibilityHandler());
return next.execute(config, command);
} catch (Exception e) {
context.exception(e);
} finally {
try {
if (!contextReused) {
context.close();
}
} finally {
// Pop from stack
Context.removeCommandContext();
Context.removeProcessEngineConfiguration();
Context.removeBpmnOverrideContext();
// don't remove the fallback because it's needed in Activiti 6 code like the Camel module
// org.activiti.engine.impl.context.Context.removeFallbackcompatibilityHandler();
}
}
return null;
}