Here is an example of how to pass external parameters to queries.
You can do this using the command line or by using the Dara Aggregation Server .NET API.
Open Data Architect 2011 and create a new .dax document. Create a new data connection to the emp.mdb sample database located in C:\Users\Public\Documents\Ecrion\Data Aggregation Server 2011\Samples\Database Samples folder and name it Sample DB.
Go to Home tab and select Query from Database group. This will open the following dialog box:

Select Sample DB from the drop-down list then enter the query as shown in the example above.

See that a new input has been added to the function meaning that you can customize the value for the ID field. Add a Constant function which will store "1" as value for this parameter. The document will look like this:

This example will generate the following XML output:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns:root xmlns:ns="http://www.tempuri.org/XML">
<ns:emp id="1" first-name="John" last-name="Brown"/>
</ns:root>
You can see that the query selected the record where the ID is the value given in the Constant function.
Save the file as Test.dax in C:\ root.
Next we will try to pass another value to the ID field. In order to do that, we need to know the characteristics of the parameter to be passed in.
Go to Text View and see the description of the Constant function:
<das:const-function id="32">
<das:const-return-value id="33" value="1" type="int"/>
</das:const-function>
The "id" and "value" attributes of the <das:const-return-value> element will be used for customizing the JobProperty method.
1. Passing an external parameter from command line
We will use DASAggregate.NET application to process our .dax document into XML by passing external parameters to our query.
Open a new command window in C:\Program Files\Ecrion\Data Aggregation Server 2011\Bin folder.
Remember to first make sure that you have write access on C:\ !!!
Type the following line:
DASAggregate.NET C:\Test.dax C:\TestDA.xml -parameters:property=33/value/2

The property parameter has the following syntax:
property=objectID/name/value
Open C:\TestDA.xml file and you will see that it contains the record where ID="2".
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns:root xmlns:ns="http://www.tempuri.org/XML">
<ns:element-name id="2" first-name="Mary" last-name="Jane"/>
</ns:root>
2. Parsing an external parameter using DAS .NET API
Step 1: Create a New Microsoft Visual Studio 2005 Project
Open Visual Studio 2005 and go to File > New > Project... and select Visual C# > Console Application.
Step 2: Add the Ecrion DAS References

Go to Project > Add Reference... and select Ecrion.DAS.NET in the list as shown in the screenshot above, then click OK.
Step 3: Type In The Code
Then copy the code listed below into the Program.cs file and hit F5 or Debug > Run and a xml file TestDA.xml will be written on your C:\ drive.
Remember to first make sure that you have write access on C:\ !!!
using System;
using System.Collections.Generic;
using System.Text;
using Ecrion.DAS;
using System.IO;
namespace TestDAS
{
class Program
{
static void Main(string[] args)
{
try
{
Engine engine = new Engine();
//initialize parameters for the processing operation.
JobParameters param = new JobParameters();
//set the input file(make sure that the path to the database is valid!!!)
param.Diagram = new LocalDiagram(@"C:\Test.dax");
//parsing the JopProperty parameters
param.JobPropertyList.Add(new JobProperty("33", "value", "3"));
//set the xml output file
using (FileStream outputStream = new FileStream("C:\\TestDA.xml", FileMode.Create))
engine.Aggregate(jobStream, outputStream, param);
Console.WriteLine("Output XML is ready!\n");
}
catch (Exception e)
{ // Report any errors that may occur
Console.WriteLine(e);
}
}
}
}
Open C:\TestDA.xml file and you will see that it contains the record where ID="3".
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns:root xmlns:ns="http://www.tempuri.org/XML">
<ns:element-name id="3" first-name="Arthur" last-name="Clark"/>
</ns:root>