Commit 4c7d9383 by Kunj Gupta

Fixed - handle the null value.

parent d094cfdb
......@@ -186,6 +186,8 @@ public class CatalogueVariableScreen extends HandleNotificationActivity {
if (mApplication.isNetConnected()) {
isProgressRequire = mCatalogueVariableList.isEmpty();
new FetchCatalogueVariable().execute();
} else if(mCatalogueVariableList.isEmpty()) {
DialogUtils.showNoConnectionDialog(CatalogueVariableScreen.this);
}
}
......@@ -1145,19 +1147,24 @@ public class CatalogueVariableScreen extends HandleNotificationActivity {
continue;
}
boolean conditionsSatisfied = true;
for(int j=0; j<item.getPartialConditions().size(); j++) {
for (int j = 0; j < item.getPartialConditions().size(); j++) {
PartialCondition partialCondition = item.getPartialConditions().get(j);
CatalogueVariable variable = getVariableForSysId(partialCondition.getViewSysId());
VariableViewContainer variableViewContainer = mVariableViewMap.get(variable.getSysId());
if(variableViewContainer == null || variableViewContainer.getInputView() == null) {
VariableViewContainer variableViewContainer;
if (variable == null) {
continue;
} else {
variableViewContainer = mVariableViewMap.get(variable.getSysId());
}
if (variableViewContainer == null || variableViewContainer.getInputView() == null) {
continue;
}
String value = Util.getVariableViewValueForUIPolicy(variableViewContainer.getInputView(), variable);
switch(partialCondition.getOperator()) {
switch (partialCondition.getOperator()) {
case EQUAL:
conditionsSatisfied = conditionsSatisfied && value.equals(partialCondition.getOperatorValue());
break;
case IS_NOT_EMPTY:
case IS_NOT_EMPTY:
conditionsSatisfied = conditionsSatisfied && !TextUtils.isEmpty(value);
break;
}
......
......@@ -64,6 +64,7 @@ import com.vsoft.servicenow.db.managers.HRCaseUiPolicyActionManager;
import com.vsoft.servicenow.db.managers.HRCaseUiPolicyItemManager;
import com.vsoft.servicenow.db.managers.HRCaseVariableChoiceManager;
import com.vsoft.servicenow.db.managers.HRCaseVariableManager;
import com.vsoft.servicenow.db.models.CatalogueVariable;
import com.vsoft.servicenow.db.models.HRCaseAttachment;
import com.vsoft.servicenow.db.models.HRCaseItem;
import com.vsoft.servicenow.db.models.HRCaseItemInput;
......@@ -185,6 +186,8 @@ public class HRCaseVariableScreen extends HandleNotificationActivity {
if (mApplication.isNetConnected()) {
isProgressRequire = mHRCaseVariableList.isEmpty();
new FetchCatalogueVariable().execute();
} else if(mHRCaseVariableList.isEmpty()) {
DialogUtils.showNoConnectionDialog(HRCaseVariableScreen.this);
}
}
......@@ -1144,19 +1147,24 @@ public class HRCaseVariableScreen extends HandleNotificationActivity {
continue;
}
boolean conditionsSatisfied = true;
for(int j=0; j<item.getPartialConditions().size(); j++) {
for (int j = 0; j < item.getPartialConditions().size(); j++) {
PartialCondition partialCondition = item.getPartialConditions().get(j);
HRCaseVariable variable = getVariableForSysId(partialCondition.getViewSysId());
VariableViewContainer variableViewContainer = mVariableViewMap.get(variable.getSysId());
if(variableViewContainer == null || variableViewContainer.getInputView() == null) {
VariableViewContainer variableViewContainer;
if (variable == null) {
continue;
} else {
variableViewContainer = mVariableViewMap.get(variable.getSysId());
}
if (variableViewContainer == null || variableViewContainer.getInputView() == null) {
continue;
}
String value = Util.getVariableViewValueForUIPolicy(variableViewContainer.getInputView(), variable);
switch(partialCondition.getOperator()) {
switch (partialCondition.getOperator()) {
case EQUAL:
conditionsSatisfied = conditionsSatisfied && value.equals(partialCondition.getOperatorValue());
break;
case IS_NOT_EMPTY:
case IS_NOT_EMPTY:
conditionsSatisfied = conditionsSatisfied && !TextUtils.isEmpty(value);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment