@Override public FactPattern getLHSBoundFact(String var) { return model.getLHSBoundFact(var); }
@Override public FactPattern getLHSBoundFact(String var) { return model.getLHSBoundFact(var); }
private String getFactTypeLHS() { FactPattern lhsBoundFact = modeller.getModel().getLHSBoundFact(model.getVariable()); if (lhsBoundFact != null) { return lhsBoundFact.getFactType(); } return null; }
private String getFactTypeLHS() { FactPattern lhsBoundFact = modeller.getModel().getLHSBoundFact(model.getVariable()); if (lhsBoundFact != null) { return lhsBoundFact.getFactType(); } return null; }
@Override public FactPattern getLHSBoundFact(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); } } 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.getLHSBoundFact(var); if (fp != null) { return fp; } } } return super.getLHSBoundFact(var); }
private void isBoundVariableApplicableByFactType(final String boundVariable, final Callback<Boolean> callback) { FactPattern lhsBoundFact = model.getLHSBoundFact(boundVariable); if (lhsBoundFact != null) { String boundFactType = lhsBoundFact.getFactType(); //For collection, present the list of possible bound variable String factCollectionType = oracle.getParametricFieldType(this.factType, this.fieldName); if (boundFactType != null && factCollectionType != null && boundFactType.equals(factCollectionType)) { callback.callback(true); return; } } callback.callback(false); }
private void isBoundVariableApplicableByFactType(final String boundVariable, final Callback<Boolean> callback) { FactPattern lhsBoundFact = model.getLHSBoundFact(boundVariable); if (lhsBoundFact != null) { String boundFactType = lhsBoundFact.getFactType(); //For collection, present the list of possible bound variable String factCollectionType = oracle.getParametricFieldType(this.factType, this.fieldName); if (boundFactType != null && factCollectionType != null && boundFactType.equals(factCollectionType)) { callback.callback(true); return; } } callback.callback(false); }
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.getDataModelOracle().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 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.getDataModelOracle().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 void isLHSFactTypeEquivalent(final String boundVariable, final Callback<Boolean> callback) { FactPattern factPattern = model.getLHSBoundFact(boundVariable); if (factPattern == null) { callback.callback(false); return; } //Both types are identical final String boundFactType = factPattern.getFactType(); final String fieldType = getFieldTypeClazz(); if (fieldType.equals(boundFactType)) { callback.callback(true); return; } else { isLHSFactTypeAnEvent(boundVariable, boundFactType, fieldType, callback); } }
private void isLHSFactTypeEquivalent(final String boundVariable, final Callback<Boolean> callback) { FactPattern factPattern = model.getLHSBoundFact(boundVariable); if (factPattern == null) { callback.callback(false); return; } //Both types are identical final String boundFactType = factPattern.getFactType(); final String fieldType = getFieldTypeClazz(); if (fieldType.equals(boundFactType)) { callback.callback(true); return; } else { isLHSFactTypeAnEvent(boundVariable, boundFactType, fieldType, callback); } }
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; }
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; }
FactPattern fact = getRuleModel().getLHSBoundFact(attrib); ExpressionPart variable; if (fact != null) {
FactPattern fact = getRuleModel().getLHSBoundFact(attrib); ExpressionPart variable; if (fact != null) {