@Override public FactPattern getLHSParentFactPatternForBinding(String var) { return model.getLHSParentFactPatternForBinding(var); }
@Override public FactPattern getLHSParentFactPatternForBinding(String var) { return model.getLHSParentFactPatternForBinding(var); }
@Override public FactPattern getLHSParentFactPatternForBinding(final String var) { for (CompositeColumn<? extends BaseColumn> col : dtable.getConditions()) { if (col instanceof Pattern52) { final Pattern52 p = (Pattern52) col; if (p.isBound() && p.getBoundName().equals(var)) { return new Pattern52FactPatternAdaptor(p); } for (ConditionCol52 cc : p.getChildColumns()) { if (cc.isBound() && cc.getBinding().equals(var)) { return new Pattern52FactPatternAdaptor(p); } } } else if (col instanceof BRLConditionColumn) { //Delegate to super class's implementation final RuleModel rm = new RuleModel(); final BRLConditionColumn brl = (BRLConditionColumn) col; rm.lhs = brl.getDefinition().toArray(new IPattern[brl.getDefinition().size()]); final FactPattern fp = rm.getLHSParentFactPatternForBinding(var); if (fp != null) { return fp; } } } return super.getLHSParentFactPatternForBinding(var); }
private boolean isLHSFieldTypeEquivalent(String boundVariable) { String boundFieldType = modeller.getModel().getLHSBindingType(boundVariable); //If the fieldTypes are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent if (boundFieldType.equals(DataType.TYPE_COMPARABLE)) { if (!this.variableType.equals(DataType.TYPE_COMPARABLE)) { return false; } SingleFieldConstraint fc = this.modeller.getModel().getLHSBoundField(boundVariable); String fieldName = fc.getFieldName(); String parentFactTypeForBinding = this.modeller.getModel().getLHSParentFactPatternForBinding(boundVariable).getFactType(); String[] dd = this.modeller.getDataModelOracle().getEnumValues(parentFactTypeForBinding, fieldName); return isEnumEquivalent(dd); } //If the fieldTypes are identical (and not SuggestionCompletionEngine.TYPE_COMPARABLE) then return true if (boundFieldType.equals(this.variableType)) { return true; } return false; }
private boolean isLHSFieldTypeEquivalent(String boundVariable) { String boundFieldType = modeller.getModel().getLHSBindingType(boundVariable); //If the fieldTypes are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent if (boundFieldType.equals(DataType.TYPE_COMPARABLE)) { if (!this.variableType.equals(DataType.TYPE_COMPARABLE)) { return false; } SingleFieldConstraint fc = this.modeller.getModel().getLHSBoundField(boundVariable); String fieldName = fc.getFieldName(); String parentFactTypeForBinding = this.modeller.getModel().getLHSParentFactPatternForBinding(boundVariable).getFactType(); String[] dd = this.modeller.getDataModelOracle().getEnumValues(parentFactTypeForBinding, fieldName); return isEnumEquivalent(dd); } //If the fieldTypes are identical (and not SuggestionCompletionEngine.TYPE_COMPARABLE) then return true if (boundFieldType.equals(this.variableType)) { return true; } return false; }
private void isLHSFieldTypeEquivalent(final String boundVariable, final Callback<Boolean> callback) { String boundFieldType = this.model.getLHSBindingType(boundVariable); //If the fieldTypes are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent if (Objects.equals(boundFieldType, DataType.TYPE_COMPARABLE)) { if (!Objects.equals(fieldType, DataType.TYPE_COMPARABLE)) { callback.callback(false); return; } SingleFieldConstraint fc = this.model.getLHSBoundField(boundVariable); String fieldName = fc.getFieldName(); String parentFactTypeForBinding = this.model.getLHSParentFactPatternForBinding(boundVariable).getFactType(); String[] dd = this.oracle.getEnumValues(parentFactTypeForBinding, fieldName); callback.callback(isEnumEquivalent(dd, dropDownData)); return; } isBoundVariableApplicableByFieldType(boundFieldType, callback); }
private void isLHSFieldTypeEquivalent(final String boundVariable, final Callback<Boolean> callback) { String boundFieldType = this.model.getLHSBindingType(boundVariable); //If the fieldTypes are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent if (Objects.equals(boundFieldType, DataType.TYPE_COMPARABLE)) { if (!Objects.equals(fieldType, DataType.TYPE_COMPARABLE)) { callback.callback(false); return; } SingleFieldConstraint fc = this.model.getLHSBoundField(boundVariable); String fieldName = fc.getFieldName(); String parentFactTypeForBinding = this.model.getLHSParentFactPatternForBinding(boundVariable).getFactType(); String[] dd = this.oracle.getEnumValues(parentFactTypeForBinding, fieldName); callback.callback(isEnumEquivalent(dd, dropDownData)); return; } isBoundVariableApplicableByFieldType(boundFieldType, callback); }