changeset 913:2d3c95787578

Added description for Configuration of InputValue of States doc/trunk@1047 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 04 May 2010 09:43:31 +0000
parents 3ca45a124985
children 4c701fd2b3bb
files doc/ChangeLog doc/config-manual/model_of_transitions.tex
diffstat 2 files changed, 171 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog	Tue May 04 06:57:25 2010 +0000
+++ b/doc/ChangeLog	Tue May 04 09:43:31 2010 +0000
@@ -1,3 +1,9 @@
+2010-05-04  Tim Englich <tim@intevation.de>
+
+	* config-manual/model_of_transitions.tex:
+	Added description for Configuration of InputValue of states and short
+	examples of the usage in SQL-statements to the Documentation.
+
 2010-05-04  Hans Plum <hans@intevation.de>
 
 	* config-manual/config-manual.tex,
--- a/doc/config-manual/model_of_transitions.tex	Tue May 04 06:57:25 2010 +0000
+++ b/doc/config-manual/model_of_transitions.tex	Tue May 04 09:43:31 2010 +0000
@@ -121,8 +121,6 @@
     \item artifact: The Name of the Class of the Artifact which should be created.
 \end{itemize}
 
-// TODO: List of Artifacts which currently used in this Configuration? 
-
 The next listing shows the dependencies between the FIS and the Name
 of the Artifactfactory which belongs to it.
 
@@ -237,9 +235,7 @@
    <dataname>parameterid</dataname>
    <data-multiselect>true</data-multiselect>
    <inputvalues>
-        <inputvalue name="featureid" type="Integer" multiselect="false"/>
-        <inputvalue name="fisname" type="String" multiselect="false" usedinquery="0"/>
-        <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="0"/>
+      ...
    </inputvalues>
 </state>
 \end{lstlisting}
@@ -254,10 +250,172 @@
                     The ID will be use to localize the description of the Data.
     \item data-multiselect: true it is possible to select 1 or more Items.
                             false ist is possible to select only one Item.
-    \item inputvalues: The Values which can be "feed" //TODO: How to explain this
-                       to this State.
+    \item inputvalues: The Values which can be "feed" to this State and which 
+                       will be used as Values in SQL-statements.
 \end{itemize}
 
+\paragraph{Input Values of a State}
+At Section /state/inputvalues it is possible to add Definitions for InputValues.
+Those values have two meanings for the State.
+
+\begin{itemize}
+     \item They were used to fill the SQL-Statements to fetch the Data
+           (Each entry replace one ore more "?" )
+     \item They were used to validate the Inputdata which is "feed" to
+           the FIS in the current State
+\end{itemize}
+
+WARNING: The Order of the InputValues is significant at which position the Value will
+be put into the SQL-Statement.
+
+It is possible to add one InputValue twice or more often to put its value at
+different positions of the SQl-Statement.
+
+\begin{lstlisting}
+<inputvalues>
+    <inputvalue name="featureid" type="Integer" multiselect="false" usedinquery="1"/>
+    <inputvalue name="fisname" type="String" multiselect="false" usedinquery="0"/>
+    <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="0"/>
+</inputvalues>
+\end{lstlisting}
+
+\begin{itemize}
+    \item name: Name of the Value that could be feed or should be used in SQl-statment.
+                The name must fit to one dataname configured in this State or one other
+                State which was visited before.
+    \item type: The type of the Value. This is required for the Validation 
+                of the Value.
+                This might be String, Integer, Double, Date, Point, LineString, 
+                Polygon, Coordinate, Geometry and AttributeName.
+    \item multiselect: true if more than on Value can be feed or put into the SQl-statement.
+                       false if one on Value will be accepted.
+    \item usedinquery: Number how often the value should be put into the SQL-Statement:
+                       0: Value will not out into the Statement.
+                       1: Value will put once into the Staement,
+                       2 or more: Value will be put as often as configured 
+                                  into the SQL-Statement (this is useful if 
+                                  Inner-Selects are used)
+\end{itemize}
+
+The next part will explain the usage of inputvalues.
+
+This SQL-statment is configured to use in the State above.
+
+\begin{lstlisting}
+SELECT DISTINCT 
+       p.PARAMETERID KEY, 
+       p.GERMANNAME || '  ['|| p.UNIT ||']' VALUE, 
+       p.GERMANNAME 
+FROM MEDIAN.PARAMETER P, 
+     MEDIAN.TIMESERIES TS, 
+     MEDIAN.TIMESERIESVALUE TSV, 
+     MEDIAN.MEASUREMENT M, 
+     MEDIAN.TIMESERIESPOINT TSP 
+WHERE M.FEATUREID = TSP.FEATUREID AND 
+      M.MEASUREMENTID = TSV.MEASUREMENTID AND 
+      TS.TIMESERIESID = TSV.TIMESERIESID AND 
+      P.PARAMETERID = TS.PARAMETERID AND 
+      TSP.FEATUREID = ? 
+ORDER BY P.GERMANNAME
+\end{lstlisting}
+
+If there are put the Inputvalues in it it will look like this
+if we assume that the inputvalues has got the following values:
+\begin{itemize}
+    \item featureid: 4 (Marnet)
+    \item fisname: fis\_marnet
+    \item parameterid: not set because it's the value that should be 
+                       chosen in this state. 
+\end{itemize}
+
+\begin{lstlisting}
+SELECT DISTINCT 
+       p.PARAMETERID KEY, 
+       p.GERMANNAME || '  ['|| p.UNIT ||']' VALUE, 
+       p.GERMANNAME 
+FROM MEDIAN.PARAMETER P,  
+       MEDIAN.TIMESERIES TS, 
+       MEDIAN.TIMESERIESVALUE TSV, 
+       MEDIAN.MEASUREMENT M, 
+       MEDIAN.TIMESERIESPOINT TSP  
+WHERE M.FEATUREID = TSP.FEATUREID AND 
+      M.MEASUREMENTID = TSV.MEASUREMENTID AND 
+      TS.TIMESERIESID = TSV.TIMESERIESID AND 
+      P.PARAMETERID = TS.PARAMETERID AND 
+      TSP.FEATUREID = 4 
+ORDER BY P.GERMANNAME
+\end{lstlisting}
+
+The value of featureid will be inserted into the Query because
+the Attribute usedinquery is set to "1".
+
+The values of the inputvalues fisname and parameterid will be
+excluded because the Attribute usedinquery is set to "0"
+
+
+If the Attribute usedinquery of the inputvalue featureid is set to "2"
+this might happen.
+
+\begin{lstlisting}
+<inputvalues>
+    <inputvalue name="featureid" type="Integer" multiselect="false" usedinquery="2"/>
+    <inputvalue name="fisname" type="String" multiselect="false" usedinquery="0"/>
+    <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="0"/>
+</inputvalues>
+\end{lstlisting}
+
+
+\begin{lstlisting}
+SELECT DISTINCT 
+    ...
+    TSP.FEATUREID = ? AND
+    TSP.FEATUREID = ? 
+ ORDER BY P.GERMANNAME
+\end{lstlisting}
+
+This SQL-statement will be modified to
+
+\begin{lstlisting}
+SELECT DISTINCT 
+    ...
+    TSP.FEATUREID = 4 AND
+    TSP.FEATUREID = 4 
+ORDER BY P.GERMANNAME
+\end{lstlisting}
+
+
+If the Attribute usedinquery of the inputvalue fisname additionally is set to "1"
+this might happen.
+
+\begin{lstlisting}
+<inputvalues>
+    <inputvalue name="featureid" type="Integer" multiselect="false" usedinquery="2"/>
+    <inputvalue name="fisname" type="String" multiselect="false" usedinquery="1"/>
+    <inputvalue name="parameterid" type="Integer" multiselect="true" usedinquery="0"/>
+</inputvalues>
+\end{lstlisting}
+
+
+\begin{lstlisting}
+ SELECT DISTINCT 
+    ...
+    TSP.FEATUREID = ? AND
+    TSP.FEATUREID = ? AND
+    NOCOLUMNINDB  = ?
+ORDER BY P.GERMANNAME
+\end{lstlisting}
+
+This SQL-statement will be modified to
+
+\begin{lstlisting}
+SELECT DISTINCT 
+    ...
+    TSP.FEATUREID = 4 AND
+    TSP.FEATUREID = 4 AND
+    NOCOLUMNINDB  = 'fis\_marnet' 
+ORDER BY P.GERMANNAME
+\end{lstlisting}
+
 
 \paragraph{Transitions}
 

http://dive4elements.wald.intevation.org