ValidationQueryTask
Description
A task that can execute a query and evaluate special fields. The query needs to have a column named 'VALID' in the result set, that has the values 'VALID', 'INVALID' or 'WARNING'. These values will influence the return code of the task. Also, all columns will be available as template variables in the name and the error message texts.
Input parameters
| Parameter | Description |
|---|---|
validationCommand |
|
An object that defines what kind of select the task should execute and against which database. |
Description ValidationCommand
Describes a single query that needs to be executed and get a verification result.
Input parameters
| Parameter | Description |
|---|---|
name |
The name of the task. |
url |
The url of the database. |
user |
The user of the database. |
password |
The user’s password. |
errorMessage |
In case the command can’t get executed an error message. |
Example:
<project name="Hook" default="run">
<import file="${inst.dir}/config/taskdef.xml"/>
<target name="Validation">
<validation-query>
<validationCommand
name="test"
url="${r"${s0_url}"}"
user="${r"${sdb0_user}"}"
password="${r"${sdb0_password}"}"
query="SELECT 'VALID' AS VALID FROM XDM.X00TASK"
errorMessage="No one says valid"/>
<validationCommand
name="Task filled for ${r"${V1}"}"
url="${r"${s0_url}"}"
user="${r"${sdb0_user}"}"
password="${r"${sdb0_password}"}"
errorMessage="Task table is not filled for ${r"${V1}"} : count ${r"${V2}"}">
${r"
<![CDATA[
<#list custId?split(',') as c>
SELECT
CASE COUNT(*) WHEN 20 THEN 'VALID' ELSE 'WARNING' END AS VALID,
COUNT(*) AS V2,
${c} AS V1
FROM XDM.X00TASK WHERE ID = ${c};
</#list>
]]>
"}
</validationCommand>
</validation-query>
<move file="reports/Validation.rpd" tofile="reports/Stage1_0_Validation report.rpd"/>
</target>
</project>