private List<String> getApplicableBindingsInScope( List<String> bindingsInScope ) { List<String> applicableBindingsInScope = new ArrayList<String>(); //Examine LHS Fact and Field bindings and RHS (new) Fact bindings for ( String v : bindingsInScope ) { //LHS FactPattern FactPattern fp = model.getLHSBoundFact( v ); if ( fp != null ) { if ( isLHSFactTypeEquivalent( v ) ) { applicableBindingsInScope.add( v ); } } //LHS FieldConstraint FieldConstraint fc = model.getLHSBoundField( v ); if ( fc != null ) { if ( isLHSFieldTypeEquivalent( v ) ) { applicableBindingsInScope.add( v ); } } } return applicableBindingsInScope; }
List<String> vars = model.getModel().getLHSBoundFacts(); for ( String v : vars ) { FactPattern factPattern = model.getModel().getLHSBoundFact( v ); if ( factPattern.getFactType().equals( this.methodParameter.getType() ) ) {
Button variable = new Button( Constants.INSTANCE.BoundVariable() ); if ( vars2.contains( v ) == false ) { FactPattern factPattern = model.getModel().getLHSBoundFact( v ); if ( factPattern.getFactType().equals( this.parameterType ) ) { createButton = true;
private boolean isLHSFactTypeEquivalent( String boundVariable ) { String boundFactType = model.getLHSBoundFact( boundVariable ).getFactType(); String boundFieldType = model.getLHSBindingType( boundVariable ); //If the types are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent if ( boundFactType.equals( DataType.TYPE_COMPARABLE ) ) { if ( !this.fieldType.equals( DataType.TYPE_COMPARABLE ) ) { return false; } String[] dd = this.sce.getEnumValues( boundFactType, this.fieldName ); return isEnumEquivalent( dd ); } return isBoundVariableApplicable( boundFactType, boundFieldType ); }
model.getLHSBoundFact( "x" ) );
private boolean isLHSFactTypeEquivalent( String boundVariable ) { String boundFactType = modeller.getModel().getLHSBoundFact( boundVariable ).getFactType(); //If the types are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent if ( boundFactType.equals( DataType.TYPE_COMPARABLE ) ) { if ( !this.variableType.equals( DataType.TYPE_COMPARABLE ) ) { return false; } String[] dd = this.modeller.getSuggestionCompletions().getEnumValues( boundFactType, this.value.getField() ); return isEnumEquivalent( dd ); } //If the types are identical (and not SuggestionCompletionEngine.TYPE_COMPARABLE) then return true if ( boundFactType.equals( this.variableType ) ) { return true; } return false; }
private List<String> getApplicableBindings() { List<String> bindings = new ArrayList<String>(); //Examine LHS Fact and Field bindings and RHS (new) Fact bindings for ( String v : modeller.getModel().getAllVariables() ) { //LHS FactPattern FactPattern fp = modeller.getModel().getLHSBoundFact( v ); if ( fp != null ) { if ( isLHSFactTypeEquivalent( v ) ) { bindings.add( v ); } } //LHS FieldConstraint FieldConstraint fc = modeller.getModel().getLHSBoundField( v ); if ( fc != null ) { if ( isLHSFieldTypeEquivalent( v ) ) { bindings.add( v ); } } //RHS ActionInsertFact ActionInsertFact aif = modeller.getModel().getRHSBoundFact( v ); if ( aif != null ) { if ( isRHSFieldTypeEquivalent( v ) ) { bindings.add( v ); } } } return bindings; }
String attrib = value.substring( dotPos + 1 ); if ( prefix.equals( VARIABLE_VALUE_PREFIX ) ) { FactPattern fact = getRuleModel().getLHSBoundFact( attrib ); ExpressionPart variable; if ( fact != null ) {
final RuleModel model = new RuleModel(); assertNull( model.getLHSBoundFact( "x" ) ); model.lhs = new IPattern[3]; x.setBoundName( "x" ); assertNotNull( model.getLHSBoundFact( "x" ) ); assertEquals( x, model.getLHSBoundFact( "x" ) ); model.getLHSBoundFact( "y" ) ); assertEquals( x, model.getLHSBoundFact( "x" ) );
FactPattern pattern = mod.getModel().getLHSBoundFact( set.getVariable() ); if ( pattern != null ) { List<String> methodList = completions.getMethodNames( pattern.getFactType() );