SingleFieldConstraintEBLeftSide makeSingleFieldConstraintEBLeftSide(final String factType) { final SingleFieldConstraintEBLeftSide constraint = new SingleFieldConstraintEBLeftSide(); final ExpressionFormLine expression = makeExpressionFormLine(factType); constraint.setConstraintValueType(SingleFieldConstraint.TYPE_UNDEFINED); constraint.setExpressionLeftSide(expression); constraint.setFactType(factType); return constraint; }
SingleFieldConstraintEBLeftSide makeSingleFieldConstraintEBLeftSide(final String factType) { final SingleFieldConstraintEBLeftSide constraint = new SingleFieldConstraintEBLeftSide(); final ExpressionFormLine expression = makeExpressionFormLine(factType); constraint.setConstraintValueType(SingleFieldConstraint.TYPE_UNDEFINED); constraint.setExpressionLeftSide(expression); constraint.setFactType(factType); return constraint; }
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; }
private SingleFieldConstraintEBLeftSide visitSingleFieldConstraint(SingleFieldConstraintEBLeftSide sfexp) { SingleFieldConstraintEBLeftSide clone = new SingleFieldConstraintEBLeftSide(); clone.setConstraintValueType(sfexp.getConstraintValueType()); clone.setExpressionLeftSide((ExpressionFormLine) visit(sfexp.getExpressionLeftSide())); clone.setExpressionValue((ExpressionFormLine) visit(sfexp.getExpressionValue())); clone.setFactType(sfexp.getFactType()); // skip setting fieldBinding, fieldName and fieldType, these are computed from expressionLeftSide clone.setId(sfexp.getId()); clone.setOperator(sfexp.getOperator()); for (Map.Entry<String, String> entry : sfexp.getParameters().entrySet()) { clone.setParameter(entry.getKey(), entry.getValue()); } clone.setParent(sfexp.getParent()); clone.setValue(sfexp.getValue()); if (sfexp.getConnectives() != null) { clone.setConnectives(new ConnectiveConstraint[sfexp.getConnectives().length]); for (int i = 0; i < sfexp.getConnectives().length; i++) { clone.getConnectives()[i] = (ConnectiveConstraint) visit(sfexp.getConnectives()[i]); } } return clone; } }
private SingleFieldConstraintEBLeftSide visitSingleFieldConstraint(SingleFieldConstraintEBLeftSide sfexp) { SingleFieldConstraintEBLeftSide clone = new SingleFieldConstraintEBLeftSide(); clone.setConstraintValueType(sfexp.getConstraintValueType()); clone.setExpressionLeftSide((ExpressionFormLine) visit(sfexp.getExpressionLeftSide())); clone.setExpressionValue((ExpressionFormLine) visit(sfexp.getExpressionValue())); clone.setFactType(sfexp.getFactType()); // skip setting fieldBinding, fieldName and fieldType, these are computed from expressionLeftSide clone.setId(sfexp.getId()); clone.setOperator(sfexp.getOperator()); for (Map.Entry<String, String> entry : sfexp.getParameters().entrySet()) { clone.setParameter(entry.getKey(), entry.getValue()); } clone.setParent(sfexp.getParent()); clone.setValue(sfexp.getValue()); if (sfexp.getConnectives() != null) { clone.setConnectives(new ConnectiveConstraint[sfexp.getConnectives().length]); for (int i = 0; i < sfexp.getConnectives().length; i++) { clone.getConnectives()[i] = (ConnectiveConstraint) visit(sfexp.getConnectives()[i]); } } return clone; } }
private static SingleFieldConstraintEBLeftSide buildSingleFieldConstraintEBLeftSide() { SingleFieldConstraintEBLeftSide sfc = new SingleFieldConstraintEBLeftSide(); sfc.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL ); sfc.setExpressionValue( buildExpressionFormLine() ); sfc.setExpressionLeftSide( buildExpressionFormLine() ); sfc.setFactType( "FactType" ); // do not set fieldBinding, fieldName and fieldType, these are computed from expressionLeftSide sfc.setId( "id" ); sfc.setOperator( "operator" ); sfc.setParameter( "key", "parameter" ); sfc.setParent( new SingleFieldConstraint( "parentFieldName" ) ); sfc.setValue( "value" ); sfc.addNewConnective(); return sfc; }