Defining extensible expression behavior in a rules system
First Claim
Patent Images
1. A method for enabling use of a custom expression in a rules engine, the method comprising:
- providing the custom expression with access to validation context provided by the rules engine, wherein the custom expression is defined by an expression tree;
validating the custom expression using the validation context using at least one processing unit;
if the custom expression passes validation;
determining which variables the custom expression reads from or writes to,providing the custom expression with access to execution context, andevaluating the custom expression; and
decompiling the expression tree into a string representation of the custom expression.
2 Assignments
0 Petitions
Accused Products
Abstract
Described herein is technology for, among other things, enabling use of custom expressions in a rules engine. The rules engine may be used in conjunction with a workflow. The technology involves providing a custom expression with access to validation context and execution context of the workflow. The custom expression can then participate in rules engine validation and execution. Furthermore, the technology allows for variables of the custom expression to be analyzed so that the rules engine can discover the variable dependencies of the custom expression and any side effects that drive forward chaining.
9 Citations
18 Claims
-
1. A method for enabling use of a custom expression in a rules engine, the method comprising:
-
providing the custom expression with access to validation context provided by the rules engine, wherein the custom expression is defined by an expression tree; validating the custom expression using the validation context using at least one processing unit; if the custom expression passes validation; determining which variables the custom expression reads from or writes to, providing the custom expression with access to execution context, and evaluating the custom expression; and decompiling the expression tree into a string representation of the custom expression.
-
-
2. A method for enabling use of a custom expression in a rules engine, the method comprising:
-
providing the custom expression with access to validation context provided by the rules engine; validating the custom expression using the validation context using at least one processing unit; if the custom expression passes validation; determining which variables the custom expression reads from or writes to, providing the custom expression with access to execution context, and evaluating the custom expression; and comparing the custom expression with a second expression to determine if a portion of the custom expression and the second expression are the same.
-
-
3. A method for enabling use of a custom expression in a rules engine, the method comprising:
-
providing the custom expression with access to validation context provided by the rules engine; validating the custom expression using the validation context using at least one processing unit; if the custom expression passes validation; determining which variables the custom expression reads from or writes to, providing the custom expression with access to execution context, and evaluating the custom expression; and creating a clone of the custom expression. - View Dependent Claims (4)
-
-
5. A method for enabling use of a custom expression in a rules engine, the method comprising:
-
providing the custom expression with access to validation context provided by the rules engine; validating the custom expression using the validation context using at least one processing unit; if the custom expression passes validation; determining which variables the custom expression reads from or writes to, providing the custom expression with access to execution context, and evaluating the custom expression; receiving a string representation of the custom expression; and parsing the string representation into a form understood by the rules engine. - View Dependent Claims (6)
-
-
7. A method for enabling use of a custom expression in a rules engine, the method comprising:
-
providing the custom expression with access to validation context provided by the rules engine; validating the custom expression using the validation context using at least one processing unit; and if the custom expression passes validation; determining which variables the custom expression reads from or writes to, providing the custom expression with access to execution context, and evaluating the custom expression; wherein the validation context comprises access to; type information and expression information that have been discovered through previous validation processes; a target type that the custom expression is going to be executed against; and errors that have occurred in previous validation processes.
-
-
8. A method for enabling use of a custom expression in a rules engine, the method comprising:
-
providing the custom expression with access to validation context provided by the rules engine; validating the custom expression using the validation context using at least one processing unit; and if the custom expression passes validation; determining which variables the custom expression reads from or writes to, providing the custom expression with access to execution context, and evaluating the custom expression; wherein the execution context comprises access to; variable dependency information describing variable dependencies between the custom expression and a second expression; an instance of the object that is being evaluated; runtime services of the instance; type information and expression information that have been discovered through previous validation processes; a target type that the custom expression is going to be executed against; and errors that have occurred in previous validation processes.
-
-
9. A method for enabling use of a custom expression in a rules engine, the method comprising:
-
providing the custom expression with access to validation context provided by the rules engine; validating the custom expression using the validation context using at least one processing unit; if the custom expression passes validation; determining which variables the custom expression reads from or writes to, said determining generating usage information, providing the custom expression with access to execution context, and evaluating the custom expression; discovering variable dependencies between the custom expression and a second expression using the usage information; re-evaluating the custom expression if the second expression changes a variable that the custom expression reads from; and re-evaluating the second expression if the custom expression changes a variable that the second expression reads from.
-
-
10. A method for enabling use of a custom expression in a rules engine, the method comprising:
-
providing the custom expression with access to validation context provided by the rules engine; validating the custom expression using the validation context using at least one processing unit; if the custom expression passes validation; determining which variables the custom expression reads from or writes to, providing the custom expression with access to execution context, and evaluating the custom expression; validating a sub-expression of the custom expression; determining which variables the sub-expression reads from or writes to; and evaluating the sub-expression.
-
-
11. A system comprising:
-
at least one computer that includes at least one processing unit; a rules engine implemented at least partially by the at least one processing unit for managing rules; a custom expression defined by an expression tree that has an associated string representation, the string representation including a public constructor; a validation interface for interfacing between the custom expression and the rules engine, wherein the validation interface is configurable to access validation context provided by the rules engine, wherein further the validation interface is configurable to validate the custom expression using the validation context; an evaluation interface for interfacing between the custom expression and the rules engine, wherein the evaluation interface is configurable to access execution context provided by the rules engine, wherein further the evaluation interface is configurable to evaluate the custom expression; and a usage analysis interface for interfacing between the custom expression and the rules engine, wherein the usage analysis interface is configurable to analyze the usage of variables by the custom expression and provide usage information to the rules engine. - View Dependent Claims (12, 13, 14, 15, 16)
-
-
17. A computer storage medium having computer-readable program code stored thereon for causing a computer system to execute a method for enabling use of a custom expression in a rules engine, comprising:
-
(a) receiving a call associated with a particular expression, wherein the expression is defined by an expression tree; (b) determining whether the expression is custom; (c) if the expression is custom; (i) validating the expression using the validation context provided by the rules engine, (ii) analyzing the usage of variables by the custom expression, and (iii) evaluating the expression. (d) decompiling the expression tree into a string representation of the custom expression; (e) creating a clone of the custom expression; (f) providing a user interface for editing the clone; (g) receiving a string representation of the custom expression; (h) parsing the string representation into a form understood by the rules engine; and (i) comparing the custom expression with a second expression to determine if a portion of the custom expression and the second expression are the same. - View Dependent Claims (18)
-
Specification