@Override FieldConstraint constructSingleFieldConstraint(ConditionCol52 c, List<DTCellValue52> columnData) { SingleFieldConstraint sfc = new SingleFieldConstraint( c.getFactField() ); sfc.setConstraintValueType( c.getConstraintValueType() ); sfc.setFieldType( c.getFieldType() ); sfc.setOperator( "not in" ); List<String> consumedValues = new ArrayList<String>(); StringBuilder value = new StringBuilder(); value.append( "( " ); for ( DTCellValue52 cv : columnData ) { //Ensure cell values start and end with quotes String scv = GuidedDTDRLUtilities.convertDTCellValueToString( cv ); if ( scv != null ) { if ( !consumedValues.contains( scv ) ) { value.append( scv ).append( ", " ); } consumedValues.add( scv ); } } value.delete( value.lastIndexOf( "," ), value.length() - 1 ); value.append( ")" ); sfc.setValue( value.toString() ); return sfc; }
@Override SingleFieldConstraint constructSingleFieldConstraint(ConditionCol52 c, List<DTCellValue52> columnData) { SingleFieldConstraint sfc = new SingleFieldConstraint( c.getFactField() ); sfc.setConstraintValueType( c.getConstraintValueType() ); sfc.setFieldType( c.getFieldType() ); sfc.setOperator( "in" ); List<String> consumedValues = new ArrayList<String>(); StringBuilder value = new StringBuilder(); value.append( "( " ); for ( DTCellValue52 cv : columnData ) { //Ensure cell values start and end with quotes String scv = GuidedDTDRLUtilities.convertDTCellValueToString( cv ); if ( scv != null ) { if ( !consumedValues.contains( scv ) ) { value.append( scv ).append( ", " ); } consumedValues.add( scv ); } } value.delete( value.lastIndexOf( "," ), value.length() - 1 ); value.append( ")" ); sfc.setValue( value.toString() ); return sfc; }
@Override FieldConstraint constructSingleFieldConstraint(ConditionCol52 c, List<DTCellValue52> columnData) { SingleFieldConstraint sfc = new SingleFieldConstraint( c.getFactField() ); sfc.setConstraintValueType( c.getConstraintValueType() ); sfc.setFieldType( c.getFieldType() ); sfc.setOperator( "not in" ); List<String> consumedValues = new ArrayList<String>(); StringBuilder value = new StringBuilder(); value.append( "( " ); for ( DTCellValue52 cv : columnData ) { //Ensure cell values start and end with quotes String scv = GuidedDTDRLUtilities.convertDTCellValueToString( cv ); if ( scv != null ) { if ( !consumedValues.contains( scv ) ) { value.append( scv ).append( ", " ); } consumedValues.add( scv ); } } value.delete( value.lastIndexOf( "," ), value.length() - 1 ); value.append( ")" ); sfc.setValue( value.toString() ); return sfc; }
@Override SingleFieldConstraint constructSingleFieldConstraint(ConditionCol52 c, List<DTCellValue52> columnData) { SingleFieldConstraint sfc = new SingleFieldConstraint( c.getFactField() ); sfc.setConstraintValueType( c.getConstraintValueType() ); sfc.setFieldType( c.getFieldType() ); sfc.setOperator( "in" ); List<String> consumedValues = new ArrayList<String>(); StringBuilder value = new StringBuilder(); value.append( "( " ); for ( DTCellValue52 cv : columnData ) { //Ensure cell values start and end with quotes String scv = GuidedDTDRLUtilities.convertDTCellValueToString( cv ); if ( scv != null ) { if ( !consumedValues.contains( scv ) ) { value.append( scv ).append( ", " ); } consumedValues.add( scv ); } } value.delete( value.lastIndexOf( "," ), value.length() - 1 ); value.append( ")" ); sfc.setValue( value.toString() ); return sfc; }
if ( col.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_LITERAL ) { if ( col.getOperator() == null || "".equals( col.getOperator() ) ) { return SuggestionCompletionEngine.TYPE_STRING; if ( col.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ) { return SuggestionCompletionEngine.TYPE_STRING; if ( col.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_RET_VALUE ) { return SuggestionCompletionEngine.TYPE_STRING;
if ( col.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_LITERAL ) { if ( col.getOperator() == null || "".equals( col.getOperator() ) ) { return SuggestionCompletionEngine.TYPE_STRING; if ( col.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_PREDICATE ) { return SuggestionCompletionEngine.TYPE_STRING; if ( col.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_RET_VALUE ) { return SuggestionCompletionEngine.TYPE_STRING;
if ( c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_LITERAL ) { if ( c.getFactField() == null || c.getFactField().equals( "" ) ) {
if ( c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_LITERAL ) { if ( c.getFactField() == null || c.getFactField().equals( "" ) ) {
if ( c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_LITERAL && c.isBound() ) { sfc.setFieldBinding( c.getBinding() ); sfc.setConstraintValueType( c.getConstraintValueType() ); sfc.setFieldType( c.getFieldType() ); return sfc;
if ( c.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_LITERAL && c.isBound() ) { sfc.setFieldBinding( c.getBinding() ); sfc.setConstraintValueType( c.getConstraintValueType() ); sfc.setFieldType( c.getFieldType() ); return sfc;
switch ( c.getConstraintValueType() ) { case BaseSingleFieldConstraint.TYPE_LITERAL : case BaseSingleFieldConstraint.TYPE_RET_VALUE : case BaseSingleFieldConstraint.TYPE_PREDICATE : SingleFieldConstraint pred = new SingleFieldConstraint(); pred.setConstraintValueType( c.getConstraintValueType() ); if ( c.getFactField() != null && c.getFactField().indexOf( "$param" ) > -1 ) { default : throw new IllegalArgumentException( "Unknown constraintValueType: " + c.getConstraintValueType() );
switch ( c.getConstraintValueType() ) { case BaseSingleFieldConstraint.TYPE_LITERAL : case BaseSingleFieldConstraint.TYPE_RET_VALUE : case BaseSingleFieldConstraint.TYPE_PREDICATE : SingleFieldConstraint pred = new SingleFieldConstraint(); pred.setConstraintValueType( c.getConstraintValueType() ); if ( c.getFactField() != null && c.getFactField().indexOf( "$param" ) > -1 ) { default : throw new IllegalArgumentException( "Unknown constraintValueType: " + c.getConstraintValueType() );
tsdt.getConditionPattern( "z1" ).getChildColumns().get( 0 ).getConstraintValueType() ); assertEquals( "age", tsdt.getConditionPattern( "z1" ).getChildColumns().get( 0 ).getFactField() ); tsdt.getConditionPattern( "z1" ).getChildColumns().get( 1 ).getConstraintValueType() ); assertEquals( "rating", tsdt.getConditionPattern( "z1" ).getChildColumns().get( 1 ).getFactField() ); tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getConstraintValueType() ); assertEquals( "name", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getFactField() ); tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getConstraintValueType() ); assertEquals( "(not needed)", tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getFactField() );
tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getConstraintValueType() ); assertEquals( "age", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getFactField() ); tsdt.getConditionPattern( "f1" ).getChildColumns().get( 1 ).getConstraintValueType() ); assertEquals( "rating", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 1 ).getFactField() ); tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getConstraintValueType() ); assertEquals( "name", tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getFactField() ); tsdt.getConditionPattern( "f2" ).getChildColumns().get( 1 ).getConstraintValueType() ); assertEquals( "(not needed)", tsdt.getConditionPattern( "f2" ).getChildColumns().get( 1 ).getFactField() );
tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getConstraintValueType() ); assertEquals( "age", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 0 ).getFactField() ); tsdt.getConditionPattern( "f1" ).getChildColumns().get( 1 ).getConstraintValueType() ); assertEquals( "name", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 1 ).getFactField() ); tsdt.getConditionPattern( "f1" ).getChildColumns().get( 2 ).getConstraintValueType() ); assertEquals( "rating", tsdt.getConditionPattern( "f1" ).getChildColumns().get( 2 ).getFactField() ); tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getConstraintValueType() ); assertEquals( "(not needed)", tsdt.getConditionPattern( "f2" ).getChildColumns().get( 0 ).getFactField() );