[JBoss JIRA] Updated: (JBRULES-261) Mismatched types in field constraints
by Mark Proctor (JIRA)
[ http://jira.jboss.com/jira/browse/JBRULES-261?page=all ]
Mark Proctor updated JBRULES-261:
---------------------------------
Fix Version/s: 4.0.0.MR3
(was: 4.0.0.MR2)
> Mismatched types in field constraints
> -------------------------------------
>
> Key: JBRULES-261
> URL: http://jira.jboss.com/jira/browse/JBRULES-261
> Project: JBoss Rules
> Issue Type: Task
> Security Level: Public(Everyone can see)
> Components: Rule Assemply/SPI
> Affects Versions: 3.0.1
> Reporter: Michael Neale
> Assigned To: Mark Proctor
> Priority: Minor
> Fix For: 4.0.0.MR3
>
>
> Problem: If a rule compares two fields and one of them is a char and the
> other one is a String, the match is always negative. No type-mismatch error
> or warning is displayed. This can be quite confusing. The attached Eclipse
> project illustrates this problem.
> Suggested Solution: If all information is available at compile-time an error
> should be generated on type mismatches. Otherwise there should be a warning
> during run-time and maybe a type conversion attempt.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months
[JBoss JIRA] Updated: (JBRULES-264) Fine grained Meta-Data driven intelligent parser
by Mark Proctor (JIRA)
[ http://jira.jboss.com/jira/browse/JBRULES-264?page=all ]
Mark Proctor updated JBRULES-264:
---------------------------------
Fix Version/s: 4.0.0.MR3
(was: 4.0.0.MR2)
> Fine grained Meta-Data driven intelligent parser
> ------------------------------------------------
>
> Key: JBRULES-264
> URL: http://jira.jboss.com/jira/browse/JBRULES-264
> Project: JBoss Rules
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Drl Parser/Builder
> Reporter: Mark Proctor
> Assigned To: Bob McWhirter
> Fix For: 4.0.0.MR3
>
>
> Currently we use the same API to parse and compile packages as we do for the IDE. This is proving quite heavy. I propose that we make an additional API for IDE integration that is fine grained and meta data driven. I believe that Eclipse has extensive meta data capabilities, which it stores on disk, we should really try and leverage this. Although the core API should try and be independent, so other IDEs can leverage it.
> 1) Split the main document up into package, imports, globals, functions and rules ? but do not parse contents.
> a. Maybe we will build up the meta-data for imports and globals at this stage, as I imagine that?s easy.
> b. Record, as meta data, the start and end line numbers, i.e. the range, for all sections.
>
> 2) Tokenise all expressions and blocks ? do not loose line numbers though, so will need to pad.
> a. Record, as meta data, the start and end line/col numbers, i.e. the range, for all expressions and blocks.
>
> 3) Parse each Rule
> a. Validate Conditional Element and Field Constraint structure
> b. Validate Columns and Fields ? record this in meta data. So we know the dependant classes and fields for this rule.
> c. Record Column and Field bindings as meta data ? as used for expressions.
> d. Validate operators and the RHS value type, checks it?s valid with LHS and operator.
>
> 4) Determine required declarations for each expression and record as meta data
> a. If we can it might be nice to also determine dependant classes from the Imports and Globals , beyond declarations, and record as meta data.
>
> 5) Compile each expression and block, using a helper util, record the errors as meta data and then forget the compiled .class
> 6) Develop intelligent balanced-text recovery. So when scanning 1) and 2) we need to check for balanced text, if we detect incorrect balancing we then mark that section as invalid and find the start of the next valid section ? nothing inside those invalid sections will be parsed.
> a. i.e. if we have an invalid expression, incorrect number of brackets on the LHS of the rule, we try and recover to the next valid area, ideally this would be the next valid conditional element ? but that may be hard and it could be the RHS of the rule. Start simple, make it coarse, and intelligent fine grained can be added later.
>
> 7) Intelligent re-parsing for project wide changes.
> a. We have class dependencies in meta-data for the various sections ? and also fields in constraints. So we can determine errors from the meta data, without having to reparse.
> b. In the case of expressions we can use the meta data, to avoid re-compiling. I guess if the changes are too dramatic then we can recompile the expression/consequence. We have the ranges in meta data for the dependant sections, so we can rescan to suck up the expression, without having to parse the entire document
> c. In document editing we only recompile expressions consequence if the user edits them ? again we should know that we are in an expression, we know the start so we scan from the start of t he expression/block to the end and compile. Avoid reparse the entire document or even the rule. If bindings are changed we can also determine the dependant expressions and recompile to get errors.
>
>
> I am sure there is a lot more complexity to this and missed stages. But it should be enough to show you the direction I want to take this. So we are extensively using meta data to minimise the re-parsing and re-compiling. We are also using meta data to localise the areas that we do need to re-parse for changes. The key to this is always being able to know exactly what we are editing. We may have to extend the descr, or create a new structure to handle meta data driven parsing. Non of this replaces the existing ruleparse/descry/packagebuidler implementations which are still required for compiling and deploying real rule bases - although hopefully we can leverage parts from both, to avoid duplication.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months
[JBoss JIRA] Updated: (JBRULES-315) map lookup access for fields
by Mark Proctor (JIRA)
[ http://jira.jboss.com/jira/browse/JBRULES-315?page=all ]
Mark Proctor updated JBRULES-315:
---------------------------------
Fix Version/s: 4.0.0.MR3
(was: 4.0.0.MR2)
> map lookup access for fields
> ----------------------------
>
> Key: JBRULES-315
> URL: http://jira.jboss.com/jira/browse/JBRULES-315
> Project: JBoss Rules
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Reporter: Michael Neale
> Assigned To: Edson Tirelli
> Priority: Minor
> Fix For: 4.0.0.MR3
>
>
> Would be nice to have a feature like:
> Map(foo == bar) as being accessed as: map.get("foo")
> This can work as in the ClassFieldInspector it can tell that there is no "getFoo" method, but there is a get(xxx) method - hence it can pass in the key as the field name (as a string).
> A limitation may be that we want to use a prev bound variable as a key, but I can't see how that will work short of adding new syntax (this currently stays within the current grammar which is good - and looking up fields via a String key is more then useful !).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 7 months