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


Java RuntimeService.hasVariableLocal方法代码示例

本文整理汇总了Java中org.activiti.engine.RuntimeService.hasVariableLocal方法的典型用法代码示例。如果您正苦于以下问题:Java RuntimeService.hasVariableLocal方法的具体用法?Java RuntimeService.hasVariableLocal怎么用?Java RuntimeService.hasVariableLocal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.engine.RuntimeService的用法示例。


在下文中一共展示了RuntimeService.hasVariableLocal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hasVariableOnScope

import org.activiti.engine.RuntimeService; //导入方法依赖的package包/类
protected boolean hasVariableOnScope(Execution execution, String variableName, RestVariable.RestVariableScope scope) {
    boolean variableFound = false;
    RuntimeService runtimeService = BPMNOSGIService.getRuntimeService();
    if (scope == RestVariable.RestVariableScope.GLOBAL) {
        if (execution.getParentId() != null && runtimeService.hasVariable(execution.getParentId(), variableName)) {
            variableFound = true;
        }

    } else if (scope == RestVariable.RestVariableScope.LOCAL) {
        if (runtimeService.hasVariableLocal(execution.getId(), variableName)) {
            variableFound = true;
        }
    }
    return variableFound;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:16,代码来源:BaseExecutionService.java

示例2: hasVariableOnScope

import org.activiti.engine.RuntimeService; //导入方法依赖的package包/类
protected boolean hasVariableOnScope(Execution execution, String variableName, RestVariable.RestVariableScope scope) {
    boolean logEnabled = log.isDebugEnabled();
    if (logEnabled) {
        log.debug("invoked hasVariableOnScope" + scope);
    }
    boolean variableFound = false;
    RuntimeService runtimeService = BPMNOSGIService.getRuntimeService();

    if (scope == RestVariable.RestVariableScope.GLOBAL) {

        boolean test = false;
        if (execution.getParentId() != null) {
            test = true;
        }
        if (logEnabled) {
            log.debug("Execution has parentID:" + test);
        }
        if (execution.getParentId() != null && runtimeService.hasVariable(execution.getParentId(), variableName)) {
            variableFound = true;
        }

    } else if (scope == RestVariable.RestVariableScope.LOCAL) {
        if (runtimeService.hasVariableLocal(execution.getId(), variableName)) {
            variableFound = true;
        }
    }

    if (logEnabled) {
        log.debug("variableFound:" + variableFound);
    }
    return variableFound;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:33,代码来源:ProcessInstanceService.java

示例3: getVariableFromRequest

import org.activiti.engine.RuntimeService; //导入方法依赖的package包/类
public RestVariable getVariableFromRequest(Execution execution, String variableName, String scope,
                                           boolean includeBinary, UriInfo uriInfo) {

    boolean variableFound = false;
    Object value = null;

    if (execution == null) {
        throw new ActivitiObjectNotFoundException("Could not find an execution", Execution.class);
    }
    RuntimeService runtimeService = BPMNOSGIService.getRuntimeService();
    RestVariable.RestVariableScope variableScope = RestVariable.getScopeFromString(scope);
    if (variableScope == null) {
        // First, check local variables (which have precedence when no scope is supplied)
        if (runtimeService.hasVariableLocal(execution.getId(), variableName)) {
            value = runtimeService.getVariableLocal(execution.getId(), variableName);
            variableScope = RestVariable.RestVariableScope.LOCAL;
            variableFound = true;
        } else {
            if (execution.getParentId() != null) {
                value = runtimeService.getVariable(execution.getParentId(), variableName);
                variableScope = RestVariable.RestVariableScope.GLOBAL;
                variableFound = true;
            }
        }
    } else if (variableScope == RestVariable.RestVariableScope.GLOBAL) {
        // Use parent to get variables
        if (execution.getParentId() != null) {
            value = runtimeService.getVariable(execution.getParentId(), variableName);
            variableScope = RestVariable.RestVariableScope.GLOBAL;
            variableFound = true;
        }
    } else if (variableScope == RestVariable.RestVariableScope.LOCAL) {

        value = runtimeService.getVariableLocal(execution.getId(), variableName);
        variableScope = RestVariable.RestVariableScope.LOCAL;
        variableFound = true;
    }

    if (!variableFound) {
        throw new ActivitiObjectNotFoundException("Execution '" + execution.getId() +
                "' doesn't have a variable with name: '" + variableName + "'.", VariableInstanceEntity.class);
    } else {
        return constructRestVariable(variableName, value, variableScope, execution.getId(), includeBinary, uriInfo);
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:46,代码来源:BaseExecutionService.java

示例4: getVariableFromRequest

import org.activiti.engine.RuntimeService; //导入方法依赖的package包/类
public RestVariable getVariableFromRequest(Execution execution, String variableName, String scope,
                                           boolean includeBinary) {

    boolean variableFound = false;
    Object value = null;

    if (execution == null) {
        throw new ActivitiObjectNotFoundException("Could not find an execution", Execution.class);
    }

    RuntimeService runtimeService = BPMNOSGIService.getRuntimeService();

    RestVariable.RestVariableScope variableScope = RestVariable.getScopeFromString(scope);
    if (variableScope == null) {
        // First, check local variables (which have precedence when no scope is supplied)
        if (runtimeService.hasVariableLocal(execution.getId(), variableName)) {
            value = runtimeService.getVariableLocal(execution.getId(), variableName);
            variableScope = RestVariable.RestVariableScope.LOCAL;
            variableFound = true;
        } else {
            if (execution.getParentId() != null) {
                value = runtimeService.getVariable(execution.getParentId(), variableName);
                variableScope = RestVariable.RestVariableScope.GLOBAL;
                variableFound = true;
            }
        }
    } else if (variableScope == RestVariable.RestVariableScope.GLOBAL) {
        // Use parent to get variables
        if (execution.getParentId() != null) {
            value = runtimeService.getVariable(execution.getParentId(), variableName);
            variableScope = RestVariable.RestVariableScope.GLOBAL;
            variableFound = true;
        }
    } else if (variableScope == RestVariable.RestVariableScope.LOCAL) {

        value = runtimeService.getVariableLocal(execution.getId(), variableName);
        variableScope = RestVariable.RestVariableScope.LOCAL;
        variableFound = true;
    }

    if (!variableFound) {
        throw new ActivitiObjectNotFoundException("Execution '" + execution.getId() +
                "' doesn't have a variable with name: '" + variableName + "'.", VariableInstanceEntity.class);
    } else {
        return constructRestVariable(variableName, value, variableScope, execution.getId(), includeBinary);
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:48,代码来源:ProcessInstanceService.java


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