Position Function

Top Previous Topic Next Topic  Print this topic

Position function returns the position of the current iterated record in the referenced data source.

 

Note: In order to use this function, an iteration must be started on the data source.

 

The sample below describes the syntax of the position-function. All employees are diplayed in ascending order. Position attribute specifies the position of the current iterated record in Output View.

 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<das:job xmlns:das="http://www.ecrion.com/das/1.0" last-id="94">

       <das:output id="1">

               <das:element id="2" name="root">

                       <das:element-sequence id="76" name="element-name" data-source="64">

                               <das:attribute id="78" name="first-name" value="7"/>

                               <das:attribute id="80" name="last-name" value="9"/>

                               <das:attribute id="93" name="id" value="8"/>

                               <das:attribute id="85" name="position" value="83"/>

                       </das:element-sequence>

               </das:element>

       </das:output>

       <dia:diagram xmlns:dia="http://www.ecrion.com/dia/1.0">

               <dia:connection id="66" src="6" dest="64:datasource"/>

               <dia:connection id="67" src="7" dest="64:filter"/>

               <dia:connection id="77" src="64" dest="76"/>

               <dia:connection id="79" src="7" dest="78"/>

               <dia:connection id="81" src="9" dest="80"/>

               <dia:connection id="86" src="83" dest="85"/>

               <dia:connection id="92" src="64" dest="82"/>

               <dia:connection id="94" src="8" dest="93"/>

               <dia:diagram-output id="1" x="713.000" y="307.000" width="196.000" height="164.000"/>

               <dia:diagram-note id="3" x="392.000" y="25.000" width="500.000" height="100.000" text="The following sample lists all employees in ascending order. The position attribute specifies the position of the current iterated record in Output View." title="Position Sample"/>

               <dia:diagram-table-data-source id="6" x="9.000" y="294.000" width="200.000" height="100.000"/>

               <dia:diagram-sort-function id="64" x="259.000" y="211.000" width="200.000" height="100.000"/>

               <dia:diagram-function id="82" x="484.000" y="478.000" width="200.000" height="100.000"/>

       </dia:diagram>

       <das:position-function id="82" data-source="64">

               <das:return-value id="83"/>

       </das:position-function>

       <das:table-data-source id="6" name="Emp" connection="5">

               <das:field id="7" name="FIRST_NAME"/>

               <das:field id="8" name="ID"/>

               <das:field id="9" name="LAST_NAME"/>

       </das:table-data-source>

       <das:sort-function id="64" data-source="6" filter="7"/>

       <das:database-connections>

               <das:database-connection id="5" name="Sample DB"/>

       </das:database-connections>

</das:job>

 

 

Attributes:

id - unique identifier of this resource in the current processing job.

data-source - input data source.

 

Children elements:

<das:return-value> - specifies the id from which the result value of the function will be referenced in the current job.

 

Note. This sample can be found in Samples\Job Samples folder.