første xml update
[virt-orchestrator.git] / vFLOWER / content / Workflows / Library / SQL / Execute a custom query on 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="028080808080808080808080808080809F808080013264596926189e8150e1493" version="0.0.1" api-version="3.1.0" allowed-operations="fv" restartMode="1" resumeFromFailedMode="0">
3     <display-name>Execute a custom query on a database</display-name>
4
5     <description>Executes a custom query on a specified database and returns the number of affected rows. You can run the workflow to update, delete, and insert 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="rowsAffected" type="number">
21             <description>The number of rows affected by 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 rowsAffected = database.executeCustomQuery(query);
35 System.log("Rows affected: "+ rowsAffected);
36         </script>
37
38         <in-binding>
39             <bind name="database" type="SQL:Database" export-name="database"/>
40             <bind name="query" type="string" export-name="query"/>
41         </in-binding>
42
43         <out-binding>
44             <bind name="errorCode" type="string" export-name="errorCode"/>
45             <bind name="rowsAffected" type="number" export-name="rowsAffected"/>
46         </out-binding>
47
48         <position x="140.0" y="100.0"/>
49     </workflow-item>
50
51     <workflow-item name="item1" type="end" end-mode="0">
52         <position x="180.0" y="170.0"/>
53     </workflow-item>
54
55     <workflow-item name="item2" throw-bind-name="errorCode" type="end" end-mode="1">
56         <position x="320.0" y="90.0"/>
57     </workflow-item>
58
59     <presentation>
60         <p-step>
61             <title>Execute a custom query on a database</title>
62             <p-group>
63                 <title>Database</title>
64                 <desc>Select a database and specify a query.</desc>
65                 <p-param name="database">
66                     <desc>Database</desc>
67                     <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
68                     <p-qual name="contextualParameter" type="void">__NULL__</p-qual>
69                 </p-param>
70                 <p-param name="query">
71                     <desc>Query</desc>
72                     <p-qual kind="static" name="mandatory" type="boolean">true</p-qual>
73                 </p-param>
74             </p-group>
75         </p-step>
76     </presentation>
77 </workflow>