@Test public void testDecisionCase() throws Exception { final JSONObject j = getObjectByLayerId("decisionCase", "layout"); assertEquals(10l, getExpressionEvaluation(j, "case-trueFalseDefault")); assertEquals("aString", getExpressionEvaluation(j, "case-falseTrueDefault")); assertEquals(true, getExpressionEvaluation(j, "case-falseFalseDefault")); assertEquals(10l, getExpressionEvaluation(j, "case-chainedTrueFalseDefault")); assertEquals("aString", getExpressionEvaluation(j, "case-chainedFalseTrueDefault")); assertEquals(true, getExpressionEvaluation(j, "case-chainedFalseFalseDefault")); }
private Expression decisionCase() { if (json.size() < 3) { throwInsufficientArgumentCount(ALL, 2); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("case", expressions); }
MBDecision extends MBExpression { private Expression decisionCase() { if (json.size() < 3) { throwInsufficientArgumentCount(ALL, 2); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("case", expressions); } }
MBDecision extends MBExpression { private Expression decisionCase() { if (json.size() < 3) { throwInsufficientArgumentCount(ALL, 2); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("case", expressions); } MBDecision(JSONArray json); }
MBDecision extends MBExpression { private Expression decisionCase() { if (json.size() < 3) { throwInsufficientArgumentCount(ALL, 2); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("case", expressions); } MBDecision(JSONArray json); @Override Expression getExpression(); }
MBDecision extends MBExpression { private Expression decisionCase() { if (json.size() < 3) { throwInsufficientArgumentCount(ALL, 2); } Expression[] expressions = new Expression[json.size() - 1]; for (int i = 1; i < json.size(); ++i) { Expression expression = parse.string(json, i); expressions[i - 1] = expression; } return ff.function("case", expressions); } MBDecision(JSONArray json); @Override Expression getExpression();  }