første xml update
[virt-orchestrator.git] / vFLOWER / content / Workflows / Library / SQL / Read a custom query from a database.workflow.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <workflow xmlns="http://vmware.com/vco/workflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://vmware.com/vco/workflow http://vmware.com/vco/workflow/Workflow-v4.xsd" root-name="item0" object-name="workflow:name=generic" id="048080808080808080808080808080808F808080013264596926189e8150e1493" version="0.0.1" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
3     <display-name>Read a custom query from a database</display-name>
4
5     <description>Executes a custom query on a specified database and returns the result in an array of ActiveRecord objects. You can run the workflow to select queries.</description>
6     <ref-types>(SQL:Database)</ref-types>
7
8     <position x="180.0" y="20.0"/>
9
10     <input>
11         <param name="database" type="SQL:Database">
12             <description>The database to use for the query</description>
13         </param>
14         <param name="query" type="string">
15             <description>The query to execute</description>
16         </param>
17     </input>
18
19     <output>
20         <param name="resultRecords" type="Array/SQL:ActiveRecord">
21             <description>An array of ActiveRecord objects corresponding to the query.</description>
22         </param>
23     </output>
24
25     <attrib name="errorCode" type="string" read-only="false">
26         <value encoded="n"/>
27     </attrib>
28
29     <workflow-item name="item0" out-name="item1" catch-name="item2" throw-bind-name="errorCode" type="task">
30         <display-name>Execute query</display-name>
31
32         <script encoded="false">
33 System.log("Executing query " + query + " on database " + database.name );
34 resultRecords = database.readCustomQuery(query);
35         </script>
36
37         <in-binding>
38             <bind name="database" type="SQL:Database" export-name="database"/>
39             <bind name="query" type="string" export-name="query"/>
40         </in-binding>
41
42         <out-binding>
43             <bind name="resultRecords" type="Array/SQL:ActiveRecord" export-name="resultRecords"/>
44         </out-binding>
45
46         <position x="140.0" y="100.0"/>
47     </workflow-item>
48
49     <workflow-item name="item1" type="end" end-mode="0">
50         <position x="180.0" y="170.0"/>
51     </workflow-item>
52
53     <workflow-item name="item2" throw-bind-name="errorCode" type="end" end-mode="1">
54         <position x="320.0" y="90.0"/>
55     </workflow-item>
56
57     <presentation>
58         <p-step>
59             <title>Read a custom query from a database</title>
60             <p-group>
61                 <title>Database</title>
62                 <desc>Select a database and specify a query.</desc>
63                 <p-param name="database">
64                     <desc>Database</desc>
65                     <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
66                     <p-qual name="contextualParameter" type="void">__NULL__</p-qual>
67                 </p-param>
68                 <p-param name="query">
69                     <desc>Query</desc>
70                     <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
71                 </p-param>
72             </p-group>
73         </p-step>
74     </presentation>
75 </workflow>