本文整理匯總了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);
}
}