Join Function

Top Previous Topic Next Topic  Print this topic

Join Function synchronizes two data sources by starting a joined iteration on both of them. One of the data sources is called a parent data source and the other one a child-data source. When a new record is received from the parent data source, the join function will iterate through the child data source until a condition is satisfied.

 

The following sample lists for each employee the department he worked in:

 

 

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

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

<!--

Join Function synchronizes two data sources by starting a joined iteration on both of them. One of the data sources is called a parent data source and the other one a child data source. When a new record is received from the parent data source, the join function will iterate through the child data source until a condition is satisfied.

-->

 

 <!--The resulting xml structure-->

 <das:output id="1">

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

     <das:element-sequence id="17" name="Emp" data-source="11">

       <das:attribute id="19" name="DEPARTMENT" value="23"/>

       <das:attribute id="1b" name="LAST_NAME" value="a"/>

     </das:element-sequence>

   </das:element>

 </das:output>

 

 <das:equal-function id="d">

   <das:in-param id="10" src="b"/>

   <das:in-param id="f" src="20"/>

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

 </das:equal-function>

 

 <das:table-data-source id="9" name="Emp" connection="3">

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

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

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

 </das:table-data-source>

<das:join-function id="11" condition="e" parent-data-source="9" child-data-source="1f"/>

 <das:table-data-source id="1f" name="Hist" connection="3">

   <das:field id="20" name="EMP_ID"/>

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

   <das:field id="22" name="HOURS_WORKED"/>

   <das:field id="23" name="DEPARTMENT"/>

   <das:field id="24" name="DATE_MODIFIED"/>

 </das:table-data-source>

 

 <das:database-connections>

   <das:database-connection id="3" connection-string="#connectionString" data-driver-type="DotNet" provider-name="System.Data.OleDb" description="MSACCESS:CONNECTION1"/>

 </das:database-connections>

</das:job>

 

 

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

 

Attributes:

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

parent-data-source - The data source on which an iteration will be started by the join-function.

child-data-source - The data source that will be synchronized with the parent-data-source according to a condition.

condition - a boolean value which represents the join condition that keeps the two data sources synchronized.