IDEMPIERE-2655 Get Context Variable Error in WebService queryData

This commit is contained in:
sauljabin 2015-07-29 16:00:30 -05:00
parent 1d982987e5
commit bcc12dbd30
2 changed files with 6 additions and 8 deletions

View File

@ -359,7 +359,7 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
Map<String, Object> requestCtx = getRequestCtx();
if (requestCtx != null && string.charAt(0) == '@') {
Object value = parseVatriable(getCompiereService(), requestCtx, parameterName, string);
Object value = parseVariable(getCompiereService(), requestCtx, parameterName, string);
if (value != null && value instanceof Number) {
return ((Number)value).intValue();
} else if (value != null ){
@ -1122,7 +1122,7 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
} else {
Map<String, Object> requestCtx = getRequestCtx();
if (requestCtx != null && strValue.charAt(0) == '@') {
value = parseVatriable(getCompiereService(), requestCtx, field.getColumn(), strValue);
value = parseVariable(getCompiereService(), requestCtx, field.getColumn(), strValue);
}
if (value == null) {
value = convertToObj(strValue, columnClass, field.getColumn());
@ -1141,11 +1141,9 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
Env.setContext(Env.getCtx(), 0, field.getColumn(), value==null ? null : value.toString());
}
public static Object parseVatriable(CompiereService cs, Map<String, Object> requestCtx, String name,
String strValue) {
public static Object parseVariable(CompiereService cs, Map<String, Object> requestCtx, String name, String strValue) {
String varName = strValue.substring(1);
if (varName.charAt(0) == '#') {
varName = varName.substring(1);
return cs.getCtx().getProperty(varName);
} else {
int indDot = varName.indexOf(".");

View File

@ -241,7 +241,7 @@ public class Process {
Object value = null;
String s = field.getVal();
if (requestCtx != null && !Util.isEmpty(s) && s.charAt(0) == '@') {
value = ModelADServiceImpl.parseVatriable(m_cs, requestCtx, field.getColumn(), s);
value = ModelADServiceImpl.parseVariable(m_cs, requestCtx, field.getColumn(), s);
if (value != null) {
if (value instanceof Number) {
m_record_id = ((Number)value).intValue();
@ -473,7 +473,7 @@ public class Process {
valueString = dataField.getVal();
if (requestCtx != null && valueString.charAt(0) == '@')
{
Object value = ModelADServiceImpl.parseVatriable(m_cs, requestCtx, iPara.getParameterName(), valueString);
Object value = ModelADServiceImpl.parseVariable(m_cs, requestCtx, iPara.getParameterName(), valueString);
valueString = value != null ? value.toString() : null;
}
}
@ -495,7 +495,7 @@ public class Process {
valueString2 = dataField.toString();
if (requestCtx != null && valueString2.charAt(0) == '@')
{
Object value = ModelADServiceImpl.parseVatriable(m_cs, requestCtx, iPara.getParameterName(), valueString2);
Object value = ModelADServiceImpl.parseVariable(m_cs, requestCtx, iPara.getParameterName(), valueString2);
valueString2 = value != null ? value.toString() : null;
}
}