當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。