本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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);
}
}