站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

RuleModel (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.brms.client.modeldriven.brxml
Class RuleModel

java.lang.Object
  extended by org.drools.brms.client.modeldriven.brxml.RuleModel
All Implemented Interfaces:
PortableObject

public class RuleModel
extends Object
implements PortableObject


Field Summary
 RuleAttribute[] attributes
           
 IPattern[] lhs
           
 String modelVersion
           
 String name
           
 IAction[] rhs
           
 
Constructor Summary
RuleModel()
           
 
Method Summary
 void addAttribute(RuleAttribute attribute)
           
 void addLhsItem(IPattern pat)
           
 void addRhsItem(IAction action)
           
 List getAllVariables()
          This will get a list of all bound variables, including bound fields.
 FactPattern getBoundFact(String var)
          This will return the fact pattern that a variable is bound to.
 List getBoundFacts()
           
 List getBoundVariablesInScope(IConstraint con)
          This uses a deceptively simple algorithm to determine what bound variables are in scope for a given constraint (including connectives).
 boolean isBoundFactUsed(String binding)
           
 boolean isVariableNameUsed(String s)
          Checks to see if a variable is used or not, includes fields as well as facts.
 void removeAttribute(int idx)
           
 boolean removeLhsItem(int idx)
           
 void removeRhsItem(int idx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public String name

modelVersion

public String modelVersion

attributes

public RuleAttribute[] attributes

lhs

public IPattern[] lhs

rhs

public IAction[] rhs
Constructor Detail

RuleModel

public RuleModel()
Method Detail

getBoundFact

public FactPattern getBoundFact(String var)
This will return the fact pattern that a variable is bound to.

Parameters:
var - The bound fact variable (NOT bound field).
Returns:
null or the FactPattern found.

getBoundFacts

public List getBoundFacts()
Returns:
A list of bound facts (String). Or empty list if none are found.

removeLhsItem

public boolean removeLhsItem(int idx)
Parameters:
idx - Remove this index from the LHS.
Returns - false if it was NOT allowed to remove this item (ie it is used on the RHS).

isBoundFactUsed

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

addLhsItem

public void addLhsItem(IPattern pat)

addRhsItem

public void addRhsItem(IAction action)

removeRhsItem

public void removeRhsItem(int idx)

addAttribute

public void addAttribute(RuleAttribute attribute)

removeAttribute

public void removeAttribute(int idx)

getBoundVariablesInScope

public List getBoundVariablesInScope(IConstraint con)
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.


getAllVariables

public List getAllVariables()
This will get a list of all bound variables, including bound fields.


isVariableNameUsed

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



Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.