| 
29 | 29 | import org.drools.workbench.models.datamodel.rule.ActionFieldValue;  | 
30 | 30 | import org.drools.workbench.models.datamodel.rule.ActionGlobalCollectionAdd;  | 
31 | 31 | import org.drools.workbench.models.datamodel.rule.ActionSetField;  | 
 | 32 | +import org.drools.workbench.models.datamodel.rule.ActionUpdateField;  | 
32 | 33 | import org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint;  | 
33 | 34 | import org.drools.workbench.models.datamodel.rule.CEPWindow;  | 
34 | 35 | import org.drools.workbench.models.datamodel.rule.CompositeFactPattern;  | 
@@ -2022,6 +2023,33 @@ public void testMVELInlineList() throws Exception {  | 
2022 | 2023 | 
 
  | 
2023 | 2024 |     }  | 
2024 | 2025 | 
 
  | 
 | 2026 | +    @Test  | 
 | 2027 | +    @Ignore("https://bugzilla.redhat.com/show_bug.cgi?id=1043395 -  Invalid rules in jboss-bpm-example (Big App) - can't be opened/validated in Guider Rule Editor")  | 
 | 2028 | +    public void testFunctionInRHS() throws Exception {  | 
 | 2029 | +        String drl = "" +  | 
 | 2030 | +                "rule \"Borked\"\n" +  | 
 | 2031 | +                "  dialect \"mvel\"\n" +  | 
 | 2032 | +                "  when\n" +  | 
 | 2033 | +                "    application : Application( )\n" +  | 
 | 2034 | +                "  then\n" +  | 
 | 2035 | +                "    application.setApr( application.getApr() + 5 );\n" +  | 
 | 2036 | +                "    update( application )" +  | 
 | 2037 | +                "end";  | 
 | 2038 | + | 
 | 2039 | +        RuleModel m = RuleModelDRLPersistenceImpl.getInstance().unmarshal(drl,  | 
 | 2040 | +                dmo);  | 
 | 2041 | + | 
 | 2042 | +        assertTrue(m.rhs[0] instanceof ActionUpdateField);  | 
 | 2043 | + | 
 | 2044 | +        ActionUpdateField field = (ActionUpdateField) m.rhs[0];  | 
 | 2045 | +        assertTrue(field.getFieldValues()[0] instanceof ActionFieldValue);  | 
 | 2046 | +        ActionFieldValue value = field.getFieldValues()[0];  | 
 | 2047 | +        assertEquals("apr", value.getField());  | 
 | 2048 | +        assertEquals("application.getApr() + 5", value.getValue());  | 
 | 2049 | +        assertEquals(3, value.getNature());  | 
 | 2050 | +        assertEquals("Numeric", value.getType());  | 
 | 2051 | +    }  | 
 | 2052 | + | 
2025 | 2053 |     private void assertEqualsIgnoreWhitespace( final String expected,  | 
2026 | 2054 |                                                final String actual ) {  | 
2027 | 2055 |         final String cleanExpected = expected.replaceAll( "\\s+",  | 
 | 
0 commit comments