@Test
public void testRuleConditionWithNestedFunctions() throws Exception {

	DDMForm ddmForm = DDMFormTestUtil.createDDMForm();
	ddmForm.addDDMFormField(
		createDDMFormField("field0", "numeric", FieldConstants.DOUBLE));
	ddmForm.addDDMFormField(
		createDDMFormField("field1", "numeric", FieldConstants.DOUBLE));
	ddmForm.addDDMFormRule(
		new DDMFormRule(
			"equals(sum(getValue('field0'), 10), 28)",
			"setValue('field1', getValue('field0'))"));
	DDMFormValues ddmFormValues = DDMFormValuesTestUtil.createDDMFormValues(
		ddmForm);
	ddmFormValues.addDDMFormFieldValue(
		DDMFormValuesTestUtil.createDDMFormFieldValue(
			"field0_instanceId", "field0", new UnlocalizedValue("18")));
	ddmFormValues.addDDMFormFieldValue(
		DDMFormValuesTestUtil.createDDMFormFieldValue(
			"field1_instanceId", "field1", new UnlocalizedValue("")));
	DDMFormEvaluatorEvaluateResponse ddmFormEvaluatorEvaluateResponse =
		doEvaluate(ddmForm, ddmFormValues);
	Map<DDMFormEvaluatorFieldContextKey, Map<String, Object>>
		ddmFormFieldsPropertyChanges =
			ddmFormEvaluatorEvaluateResponse.
				getDDMFormFieldsPropertyChanges();
	Map<String, Object> ddmFormFieldPropertyChanges =
		ddmFormFieldsPropertyChanges.get(
			new DDMFormEvaluatorFieldContextKey(
				"field1", "field1_instanceId"));
	Assert.assertEquals(
		new BigDecimal(18), ddmFormFieldPropertyChanges.get("value"));
}