当前位置: 首页>>代码示例>>Java>>正文


Java Context.removeProcessEngineConfiguration方法代码示例

本文整理汇总了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;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:44,代码来源:CommandContextInterceptor.java


注:本文中的org.activiti.engine.impl.context.Context.removeProcessEngineConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。