From: <jbo...@li...> - 2006-04-20 07:20:48
|
Author: mic...@jb... Date: 2006-04-20 03:20:38 -0400 (Thu, 20 Apr 2006) New Revision: 3840 Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Setup.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-DSL.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Query.xml labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml Log: more goodness Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Setup.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Setup.xml 2006-04-20 07:15:02 UTC (rev 3839) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Install/Section-Setup.xml 2006-04-20 07:20:38 UTC (rev 3840) @@ -15,7 +15,7 @@ <listitem> <para><indexterm> <primary>eclipse</primary> - </indexterm>Eclipse 3.2M5</para> + </indexterm>Eclipse 3.2</para> <para>http://www.eclipse.org/</para> </listitem> @@ -43,7 +43,7 @@ <listitem> <para><indexterm> - <primary>naven</primary> + <primary>Maven</primary> </indexterm>Maven 2</para> <para>http://maven.apache.org</para> Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-DSL.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-DSL.xml 2006-04-20 07:15:02 UTC (rev 3839) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-DSL.xml 2006-04-20 07:20:38 UTC (rev 3840) @@ -2,7 +2,9 @@ <section> <title>Domain Specific Languages</title> - <para>As mentioned previously, Domain Specific Languages (or DSLs) are a way + <para>As mentioned previously, <indexterm> + <primary>Domain Specific Languages</primary> + </indexterm>(or DSLs) are a way of extending the rule language to your problem domain. They are wired in to the rule language for you, and can make use of all the underlying rule langauge and engine features.</para> @@ -20,29 +22,51 @@ in a template. You wish to hide away your implementation details, and focus on the business rule. You want to provide a controlled means of editing rules based on pre-defined templates.</para> + + <para>DSLs have no impact on the rules at runtime, they are just a + parse/compile time feature.</para> </section> <section> - <title>Creating a DSL</title> + <title>Creating and editing a DSL</title> - <para>A DSL's configuration like most things is stored in plain text. If you use the IDE, you get a nice graphical editor, but the format - of the file is quite simple, and is basically a properties file.</para> + <para>A DSL's configuration like most things is stored in plain text. If + you use the IDE, you get a nice graphical editor, but the format of the + file is quite simple, and is basically a properties file.</para> <example> - <title>Example DSL mapping</title> + <title>Example <indexterm><primary>DSL</primary></indexterm> mapping</title> <programlisting>[when]This is {something}=Something(something=={something})</programlisting> </example> - </section> + + <para>Refering to the above example, the [when] refers to the scope of the + expression: ie does it belong on the LHS or the RHS of a rule. The part + after the [scope] is the expression that you use in the rule (typically a + natural language expression, but it doesn't have to be). The part on the + right of the "=" is the mapping into the rule language (of course the form + of this depends on if you are talking about the RHS or the LHS).</para> + + <para>The parser will take the expression you specify, and extract the + values that match where the {something} appear in the input. The values are + then interpolated with the corresponding {something} on the right hand side + of the mapping.</para> + + <para> + It is important to note that the DSL expressions are processed one line at a time. This means that in the above example, all the text after "There is " will be included as the value for "{something}" when it is interpolated into the target string. This may not be exactly what you want, as you may want to "chain" together different + </para> + + <example> + <title>Example with quotes</title> + + <programlisting>[when]This is "{something}" and "{another}"=Something(something=="{something}", another="{another}")</programlisting> + </example> + <para> - Refering to the above example, the [when] refers to the scope of the expression: ie does it belong on the LHS or the RHS of a rule. - The part after the [scope] is the expression that you use in the rule (typically a natural language expression, but it doesn't have to be). - The part on the right of the "=" is the mapping into the rule language (of course the form of this depends on if you are talking about the RHS or the LHS). + </para> - <para> - The parser will take the expression you specify, and extract the values that match where the {something} appear in the input. The values are then interpolated with the corresponding {something} on the right hand side of the mapping. - </para> +</section> <section> <title>Using a DSL in your rules</title> @@ -78,6 +102,6 @@ <section> <title>How it works</title> - <para></para> + <para /> </section> </section> \ No newline at end of file Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Query.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Query.xml 2006-04-20 07:15:02 UTC (rev 3839) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Query.xml 2006-04-20 07:20:38 UTC (rev 3840) @@ -21,7 +21,5 @@ for facts that match the conditions stated. </para> <para>You use WorkingMemory.getQueryResults("name") by using the query name. - This will return a list of Tuple instances. Each Tuple instance has one or - more FactHandles. To get to the original Fact object, use - WorkingMemory.getObject(factHandle).</para> + This will return a QueryResults object. This contains a list of query results, which allow you to to get to the objects that matched the query.</para> </section> \ No newline at end of file Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml =================================================================== --- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-20 07:15:02 UTC (rev 3839) +++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2006-04-20 07:20:38 UTC (rev 3840) @@ -427,7 +427,7 @@ <example> <title>Boolean Literal Constraint</title> - <programlisting>Cheese( smelly = true )</programlisting> + <programlisting>Cheese( smelly == true )</programlisting> </example> </simplesect> |