org.drools.ide.common.client.modeldriven.dt52
Class BRLRuleModel

java.lang.Object
  extended by org.drools.ide.common.client.modeldriven.brl.RuleModel
      extended by org.drools.ide.common.client.modeldriven.dt52.BRLRuleModel
All Implemented Interfaces:
Serializable, PortableObject

public class BRLRuleModel
extends RuleModel

A RuleModel that can provide details of bound Facts and Fields from an associated Decision Table. This allows columns using BRL fragments to integrate with Decision Table columns

See Also:
Serialized Form

Nested Class Summary
static class BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor
           
static class BRLRuleModel.ActionInsertFactCol52ActionInsertLogicalFactAdaptor
           
static class BRLRuleModel.ConditionCol52FieldConstraintAdaptor
           
static class BRLRuleModel.Pattern52FactPatternAdaptor
           
 
Field Summary
 
Fields inherited from class org.drools.ide.common.client.modeldriven.brl.RuleModel
attributes, lhs, metadataList, modelVersion, name, parentName, rhs
 
Constructor Summary
BRLRuleModel(GuidedDecisionTable52 dtable)
           
 
Method Summary
 List<String> getAllLHSVariables()
          This will get a list of all LHS bound variables, including bound fields..
 List<String> getAllRHSVariables()
          This will get a list of all RHS bound variables.
 List<String> getAllVariables()
          This will get a list of all bound variables (LHS and RHS), including bound fields..
 List<String> getBoundVariablesInScope(BaseSingleFieldConstraint con)
          This uses a deceptively simple algorithm to determine what bound variables are in scope for a given constraint (including connectives).
 String getLHSBindingType(String var)
          Get the data-type associated with the binding
 FactPattern getLHSBoundFact(String var)
          This will return the FactPattern that a variable is bound Eto.
 List<String> getLHSBoundFacts()
          This will return a List of all FactPattern bindings
 FieldConstraint getLHSBoundField(String var)
          This will return the FieldConstraint that a variable is bound to.
 FactPattern getLHSParentFactPatternForBinding(String var)
          This will return the FactPattern that a variable is bound to.
 ActionInsertFact getRHSBoundFact(String var)
          This will return the ActionInsertFact that a variable is bound to.
 List<String> getRHSBoundFacts()
          This will return a List of all ActionInsertFact bindings
 boolean isBoundFactUsed(String binding)
           
 boolean isVariableNameUsed(String s)
          Checks to see if a variable is used or not, includes fields as well as facts.
 
Methods inherited from class org.drools.ide.common.client.modeldriven.brl.RuleModel
addAttribute, addLhsItem, addLhsItem, addLhsItem, addMetadata, addRhsItem, addRhsItem, addRhsItem, getFieldBinding, getFieldBinding, getMetaData, hasDSLSentences, isNegated, moveLhsItemDown, moveLhsItemUp, moveRhsItemDown, moveRhsItemUp, removeAttribute, removeLhsItem, removeMetadata, removeRhsItem, setNegated, updateMetadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BRLRuleModel

public BRLRuleModel(GuidedDecisionTable52 dtable)
Method Detail

getLHSBoundFacts

public List<String> getLHSBoundFacts()
Description copied from class: RuleModel
This will return a List of all FactPattern bindings

Overrides:
getLHSBoundFacts in class RuleModel
Returns:
The bindings or an empty list if no bindings are found.

getLHSBoundFact

public FactPattern getLHSBoundFact(String var)
Description copied from class: RuleModel
This will return the FactPattern that a variable is bound Eto.

Overrides:
getLHSBoundFact in class RuleModel
Parameters:
var - The bound fact variable (NOT bound field).
Returns:
null or the FactPattern found.

getLHSBoundField

public FieldConstraint getLHSBoundField(String var)
Description copied from class: RuleModel
This will return the FieldConstraint that a variable is bound to.

Overrides:
getLHSBoundField in class RuleModel
Parameters:
var - The bound field variable (NOT bound fact).
Returns:
null or the FieldConstraint found.

getLHSBindingType

public String getLHSBindingType(String var)
Description copied from class: RuleModel
Get the data-type associated with the binding

Overrides:
getLHSBindingType in class RuleModel
Returns:
The data-type, or null if the binding could not be found

getLHSParentFactPatternForBinding

public FactPattern getLHSParentFactPatternForBinding(String var)
Description copied from class: RuleModel
This will return the FactPattern that a variable is bound to. If the variable is bound to a FieldConstraint the parent FactPattern will be returned.

Overrides:
getLHSParentFactPatternForBinding in class RuleModel
Parameters:
var - The variable binding
Returns:
null or the FactPattern found.

getAllVariables

public List<String> getAllVariables()
Description copied from class: RuleModel
This will get a list of all bound variables (LHS and RHS), including bound fields..

Overrides:
getAllVariables in class RuleModel

getAllLHSVariables

public List<String> getAllLHSVariables()
Description copied from class: RuleModel
This will get a list of all LHS bound variables, including bound fields..

Overrides:
getAllLHSVariables in class RuleModel

getAllRHSVariables

public List<String> getAllRHSVariables()
Description copied from class: RuleModel
This will get a list of all RHS bound variables.

Overrides:
getAllRHSVariables in class RuleModel

isBoundFactUsed

public boolean isBoundFactUsed(String binding)
Overrides:
isBoundFactUsed in class RuleModel
Parameters:
binding - The name of the LHS fact binding.
Returns:
Returns true if the specified binding is used on the RHS.

getBoundVariablesInScope

public List<String> getBoundVariablesInScope(BaseSingleFieldConstraint con)
Description copied from class: RuleModel
This uses a deceptively simple algorithm to determine what bound variables are in scope for a given constraint (including connectives). Does not take into account globals.

Overrides:
getBoundVariablesInScope in class RuleModel

isVariableNameUsed

public boolean isVariableNameUsed(String s)
Description copied from class: RuleModel
Checks to see if a variable is used or not, includes fields as well as facts.

Overrides:
isVariableNameUsed in class RuleModel

getRHSBoundFacts

public List<String> getRHSBoundFacts()
Description copied from class: RuleModel
This will return a List of all ActionInsertFact bindings

Overrides:
getRHSBoundFacts in class RuleModel
Returns:
The bindings or an empty list if no bindings are found.

getRHSBoundFact

public ActionInsertFact getRHSBoundFact(String var)
Description copied from class: RuleModel
This will return the ActionInsertFact that a variable is bound to.

Overrides:
getRHSBoundFact in class RuleModel
Parameters:
var - The bound fact variable (NOT bound field).
Returns:
null or the ActionInsertFact found.


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.