Java Doc for Rule.java in  » Rule-Engine » drolls-Rule-Engine » org » drools » rule » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Rule Engine » drolls Rule Engine » org.drools.rule 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.drools.rule.Rule

All known Subclasses:   org.drools.rule.Query,
Rule
public class Rule implements Serializable(Code)
A Rule contains a set of Tests and a Consequence.

The Tests describe the circumstances that representrepresent a match for this rule. The Consequence gets fired when the Conditions match.
See Also:   Eval
See Also:   Consequence
author:
   bob mcwhirter
author:
   Simon Harris
author:
   mark proctor




Constructor Summary
public  Rule(String name, String pkg, String agendaGroup)
    
public  Rule(String name, String agendaGroup)
    
public  Rule(String name)
    

Method Summary
public  voidaddPattern(RuleConditionElement element)
     Add a pattern to the rule.
public  booleanequals(Object obj)
    
public  StringgetActivationGroup()
    
public  StringgetAgendaGroup()
    
public  booleangetAutoFocus()
    
public  ConsequencegetConsequence()
     Retrieve the Consequence associated with this Rule.
public  CalendargetDateEffective()
    
public  CalendargetDateExpires()
    
public  DeclarationgetDeclaration(String identifier)
     Retrieve a parameter Declaration by identifier.
Parameters:
  identifier - The identifier.
public  Declaration[]getDeclarations()
     Retrieve the set of all root fact object parameter Declarations.
public  StringgetDialect()
    
public  DurationgetDuration()
     Retrieve the truthness duration object.
public  GroupElementgetLhs()
     Retrieve the List of Conditions for this rule.
public  longgetLoadOrder()
    
public  StringgetName()
     Retrieve the name of this rule.
public  StringgetPackage()
    
public  StringgetRuleFlowGroup()
    
public  SaliencegetSalience()
     Retrieve the Rule salience.
public  intgetSpecifity()
    
public  GroupElement[]getTransformedLhs()
     Uses the LogicTransformer to process the Rule patters - if no ORs are used this will return an array of a single AND element.
public  booleanhasLogicalDependency()
     This field is updated at runtime, when the first logical assertion is done.
public  inthashCode()
    
public  booleanisEffective()
     This returns true is the rule is effective.
public  booleanisEnabled()
    
public  booleanisLockOnActive()
    
public  booleanisNoLoop()
    
public  booleanisSemanticallyValid()
     This will return if the semantic actions or predicates in the rules are valid.
public  booleanisValid()
     Determine if this rule is internally consistent and valid.
public  voidsetActivationGroup(String activationGroup)
    
public  voidsetAgendaGroup(String agendaGroup)
    
public  voidsetAutoFocus(boolean autoFocus)
    
public  voidsetConsequence(Consequence consequence)
     Set the Consequence that is associated with the successful match of this rule.
public  voidsetDateEffective(Calendar effectiveDate)
     Sets the date from which this rule takes effect (can include time to the millisecond).
public  voidsetDateExpires(Calendar expiresDate)
     Sets the date after which the rule will no longer apply (can include time to the millisecond).
public  voidsetDialect(String dialect)
    
public  voidsetDuration(long ms)
     Set the truthness duration.
public  voidsetDuration(Duration duration)
     Set the truthness duration object.
public  voidsetEnabled(boolean b)
     A rule is enabled by default.
public  voidsetHasLogicalDependency(boolean hasLogicalDependency)
    
public  voidsetLhs(GroupElement lhsRoot)
    
public  voidsetLoadOrder(long loadOrder)
    
public  voidsetLockOnActive(boolean lockOnActive)
    
public  voidsetNoLoop(boolean noLoop)
    
public  voidsetRuleFlowGroup(String ruleFlowGroup)
    
public  voidsetSalience(Salience salience)
     Set the Rule salience.
public  voidsetSemanticallyValid(boolean valid)
    
public  StringtoString()
    


Constructor Detail
Rule
public Rule(String name, String pkg, String agendaGroup)(Code)
Construct a Rule with the given name for the specified pkg parent
Parameters:
  name - The name of this rule.



Rule
public Rule(String name, String agendaGroup)(Code)
Construct a Rule with the given name for the specified pkg parent
Parameters:
  name - The name of this rule.



Rule
public Rule(String name)(Code)




Method Detail
addPattern
public void addPattern(RuleConditionElement element)(Code)
Add a pattern to the rule. All patterns are searched for bindings which are then added to the rule as declarations
Parameters:
  condition - The Test to add.
throws:
  InvalidRuleException -



equals
public boolean equals(Object obj)(Code)



getActivationGroup
public String getActivationGroup()(Code)



getAgendaGroup
public String getAgendaGroup()(Code)



getAutoFocus
public boolean getAutoFocus()(Code)



getConsequence
public Consequence getConsequence()(Code)
Retrieve the Consequence associated with this Rule. The Consequence.



getDateEffective
public Calendar getDateEffective()(Code)



getDateExpires
public Calendar getDateExpires()(Code)



getDeclaration
public Declaration getDeclaration(String identifier)(Code)
Retrieve a parameter Declaration by identifier.
Parameters:
  identifier - The identifier. The declaration or null if no declaration matchesthe identifier.



getDeclarations
public Declaration[] getDeclarations()(Code)
Retrieve the set of all root fact object parameter Declarations. The Set of Declarations in order which specify theroot fact objects.



getDialect
public String getDialect()(Code)



getDuration
public Duration getDuration()(Code)
Retrieve the truthness duration object. The truthness duration object.



getLhs
public GroupElement getLhs()(Code)
Retrieve the List of Conditions for this rule. The List of Conditions.



getLoadOrder
public long getLoadOrder()(Code)



getName
public String getName()(Code)
Retrieve the name of this rule. The name of this rule.



getPackage
public String getPackage()(Code)



getRuleFlowGroup
public String getRuleFlowGroup()(Code)



getSalience
public Salience getSalience()(Code)
Retrieve the Rule salience. The salience.



getSpecifity
public int getSpecifity()(Code)



getTransformedLhs
public GroupElement[] getTransformedLhs() throws InvalidPatternException(Code)
Uses the LogicTransformer to process the Rule patters - if no ORs are used this will return an array of a single AND element. If there are Ors it will return an And element for each possible logic branch. The processing uses as a clone of the Rule's patterns, so they are not changed.
throws:
  InvalidPatternException -



hasLogicalDependency
public boolean hasLogicalDependency()(Code)
This field is updated at runtime, when the first logical assertion is done. I'm currently not too happy about having this determine at runtime but its currently easier than trying to do this at compile time, although eventually this should be changed



hashCode
public int hashCode()(Code)



isEffective
public boolean isEffective()(Code)
This returns true is the rule is effective. If the rule is not effective, it cannot activate. This uses the dateEffective, dateExpires and enabled flag to decide this.



isEnabled
public boolean isEnabled()(Code)



isLockOnActive
public boolean isLockOnActive()(Code)



isNoLoop
public boolean isNoLoop()(Code)



isSemanticallyValid
public boolean isSemanticallyValid()(Code)
This will return if the semantic actions or predicates in the rules are valid. This is provided so that lists of rules can be provided even if their semantic actions do not "compile" etc.



isValid
public boolean isValid()(Code)
Determine if this rule is internally consistent and valid. This will include checks to make sure the rules semantic components (actions and predicates) are valid. No exception is thrown.

A Rule must include at least one parameter declaration and one condition.

true if this rule is valid, elsefalse.



setActivationGroup
public void setActivationGroup(String activationGroup)(Code)



setAgendaGroup
public void setAgendaGroup(String agendaGroup)(Code)



setAutoFocus
public void setAutoFocus(boolean autoFocus)(Code)



setConsequence
public void setConsequence(Consequence consequence)(Code)
Set the Consequence that is associated with the successful match of this rule.
Parameters:
  consequence - The Consequence to attach to thisRule.



setDateEffective
public void setDateEffective(Calendar effectiveDate)(Code)
Sets the date from which this rule takes effect (can include time to the millisecond).
Parameters:
  effectiveDate -



setDateExpires
public void setDateExpires(Calendar expiresDate)(Code)
Sets the date after which the rule will no longer apply (can include time to the millisecond).
Parameters:
  expiresDate -



setDialect
public void setDialect(String dialect)(Code)



setDuration
public void setDuration(long ms)(Code)
Set the truthness duration. This causes a delay before the firing of the Consequence if the rule is still true at the end of the duration.

This is merely a convenience method for calling Rule.setDuration(Duration) with a FixedDuration.


See Also:   Rule.setDuration(Duration)
See Also:   FixedDuration
Parameters:
  seconds - -The number of seconds the rule must hold true in order tofire.



setDuration
public void setDuration(Duration duration)(Code)
Set the truthness duration object. This causes a delay before the firing of the Consequence if the rule is still true at the end of the duration.
Parameters:
  duration - The truth duration object.



setEnabled
public void setEnabled(boolean b)(Code)
A rule is enabled by default. This can explicitly disable it in which case it will never activate.



setHasLogicalDependency
public void setHasLogicalDependency(boolean hasLogicalDependency)(Code)



setLhs
public void setLhs(GroupElement lhsRoot)(Code)



setLoadOrder
public void setLoadOrder(long loadOrder)(Code)



setLockOnActive
public void setLockOnActive(boolean lockOnActive)(Code)



setNoLoop
public void setNoLoop(boolean noLoop)(Code)



setRuleFlowGroup
public void setRuleFlowGroup(String ruleFlowGroup)(Code)



setSalience
public void setSalience(Salience salience)(Code)
Set the Rule salience.
Parameters:
  salience - The salience.



setSemanticallyValid
public void setSemanticallyValid(boolean valid)(Code)



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.