@Override public void callback(final ExpressionPart part) { expression.appendPart(part); onChangeSelectionUpdateExpressionWidget(oldType); } });
@Override public void callback(final ExpressionPart part) { expression.appendPart(part); onChangeSelectionUpdateExpressionWidget(oldType); } });
@Override public void callback(final ExpressionPart part) { expression.appendPart(part); onStartPointChangeUpdateWidget(); } });
@Override public void callback(final ExpressionPart part) { expression.appendPart(part); onStartPointChangeUpdateWidget(); } });
@Override public void callback(final ExpressionPart part) { expression.appendPart(part); onChangeSelectionUpdateExpressionWidget(oldType); } });
@Override public void callback(final ExpressionPart part) { expression.appendPart(part); onChangeSelectionUpdateExpressionWidget(oldType); } });
public ExpressionFormLine( ExpressionPart part ) { appendPart( part ); }
private static ExpressionFormLine buildExpressionFormLine() { ExpressionFormLine efl = new ExpressionFormLine(); efl.setBinding( "eflBinding" ); efl.appendPart( new ExpressionText( "text" ) ); efl.appendPart( new ExpressionCollectionIndex( "collectionIndex", "CT", "GT" ) ); return efl; }
if (paramValue != null) { final ExpressionFormLine param = new ExpressionFormLine(index); param.appendPart(new ExpressionMethodParameter(paramValue, paramDataType, paramDataType)); expression.appendPart(em); } else { expression.appendPart(new ExpressionText(expressionPart)); expression.appendPart(new ExpressionCollection(expressionPart, currentField.getClassName(), currentField.getType(), ); } else { expression.appendPart(new ExpressionField(expressionPart, currentField.getClassName(), currentField.getType()));
onChangeSelectionUpdateExpressionWidget(oldType); } else if (TEXT_VALUE.equals(value)) { expression.appendPart(new ExpressionText("")); onChangeSelectionUpdateExpressionWidget(oldType); } else {
onChangeSelectionUpdateExpressionWidget(oldType); } else if (TEXT_VALUE.equals(value)) { expression.appendPart(new ExpressionText("")); onChangeSelectionUpdateExpressionWidget(oldType); } else {
lhsBindingType); expression.appendPart(variable); onStartPointChangeUpdateWidget(); } else if (prefix.equals(GLOBAL_VARIABLE_VALUE_PREFIX)) {
lhsBindingType); expression.appendPart(variable); onStartPointChangeUpdateWidget(); } else if (prefix.equals(GLOBAL_VARIABLE_VALUE_PREFIX)) {
@Override public void callback(final MethodInfo mi) { if (DataType.TYPE_COLLECTION.equals(mi.getGenericType())) { callback.callback(new ExpressionCollection(mi.getName(), mi.getReturnClassType(), mi.getGenericType(), mi.getParametricReturnType())); } else { final ExpressionMethod em = new ExpressionMethod(mi.getName(), mi.getReturnClassType(), mi.getGenericType(), mi.getParametricReturnType()); //Add applicable parameters for (int index = 0; index < mi.getParams().size(); index++) { final String paramDataType = mi.getParams().get(index); final ExpressionFormLine param = new ExpressionFormLine(index); param.appendPart(new ExpressionMethodParameter("", paramDataType, paramDataType)); em.putParam(paramDataType, param); } callback.callback(em); } } });
@Override public void callback(final MethodInfo mi) { if (DataType.TYPE_COLLECTION.equals(mi.getGenericType())) { callback.callback(new ExpressionCollection(mi.getName(), mi.getReturnClassType(), mi.getGenericType(), mi.getParametricReturnType())); } else { final ExpressionMethod em = new ExpressionMethod(mi.getName(), mi.getReturnClassType(), mi.getGenericType(), mi.getParametricReturnType()); //Add applicable parameters for (int index = 0; index < mi.getParams().size(); index++) { final String paramDataType = mi.getParams().get(index); final ExpressionFormLine param = new ExpressionFormLine(index); param.appendPart(new ExpressionMethodParameter("", paramDataType, paramDataType)); em.putParam(paramDataType, param); } callback.callback(em); } } });
private SingleFieldConstraintEBLeftSide createSingleFieldConstraintEBLeftSide(final RuleModel m, final FactPattern factPattern, String fieldName, final String operator, final String value) { SingleFieldConstraintEBLeftSide con = new SingleFieldConstraintEBLeftSide(); fieldName = setFieldBindingOnContraint(factPattern.getFactType(), fieldName, m, con, boundParams); String classType = RuleModelPersistenceHelper.getFQFactType(m, factPattern.getFactType(), dmo); con.getExpressionLeftSide().appendPart(new ExpressionUnboundFact(factPattern.getFactType())); parseExpression(m, classType, fieldName, con.getExpressionLeftSide()); setOperatorAndValueOnConstraint(m, operator, value, factPattern, con); return con; }
@Test public void testValidFromCompositeFactPattern() throws Exception { FactPattern factPattern = new FactPattern("SomeList"); factPattern.setBoundName("list"); FromCompositeFactPattern fromCompositeFactPattern = new FromCompositeFactPattern(); fromCompositeFactPattern.setFactPattern(new FactPattern("Person")); ExpressionFormLine expression = new ExpressionFormLine(); expression.appendPart(new ExpressionVariable("list", "SomeList", "SomeList")); fromCompositeFactPattern.setExpression(expression); model.lhs = new IPattern[]{fromCompositeFactPattern}; assertTrue(validator.isValid()); }
@Test public void testValidFromCompositeFactPattern() throws Exception { FactPattern factPattern = new FactPattern("SomeList"); factPattern.setBoundName("list"); FromCompositeFactPattern fromCompositeFactPattern = new FromCompositeFactPattern(); fromCompositeFactPattern.setFactPattern(new FactPattern("Person")); ExpressionFormLine expression = new ExpressionFormLine(); expression.appendPart(new ExpressionVariable("list", "SomeList", "SomeList")); fromCompositeFactPattern.setExpression(expression); model.lhs = new IPattern[]{fromCompositeFactPattern}; assertTrue(validator.isValid()); }
@Test public void testComparingFieldToExpression() throws Exception { FactPattern f1 = new FactPattern(); f1.setBoundName("f1"); FactPattern f2 = new FactPattern(); SingleFieldConstraint constraint = new SingleFieldConstraint(); constraint.setOperator("=="); constraint.getExpressionValue().appendPart(new ExpressionVariable("field", "java.lang.Number", "Number")); f2.addConstraint(constraint); model.lhs = new IPattern[]{f1, f2}; assertTrue(validator.isValid()); }
@Test public void testComparingFieldToExpression() throws Exception { FactPattern f1 = new FactPattern(); f1.setBoundName("f1"); FactPattern f2 = new FactPattern(); SingleFieldConstraint constraint = new SingleFieldConstraint(); constraint.setOperator("=="); constraint.getExpressionValue().appendPart(new ExpressionVariable("field", "java.lang.Number", "Number")); f2.addConstraint(constraint); model.lhs = new IPattern[]{f1, f2}; assertTrue(validator.isValid()); }