Browse Source

HUE-1321 [oozie] Shell or sqoop arguments missing in import workflow

Symlinks to archives and files are only added if not done yet
Romain Rigaux 12 years ago
parent
commit
900e6394b4
23 changed files with 155 additions and 31 deletions
  1. 1 1
      apps/oozie/src/oozie/templates/editor/gen/workflow-common.xml.mako
  2. 2 0
      apps/oozie/src/oozie/test_data/0.4/test-sqoop.0.2.xml
  3. 2 0
      apps/oozie/src/oozie/tests.py
  4. 2 2
      apps/oozie/src/oozie/xslt/0.1/extensions/shell.0.1.xslt
  5. 2 2
      apps/oozie/src/oozie/xslt/0.1/extensions/sqoop.0.1.xslt
  6. 2 2
      apps/oozie/src/oozie/xslt/0.1/extensions/sqoop.0.2.xslt
  7. 24 0
      apps/oozie/src/oozie/xslt/0.1/nodes/fields/arg_params.xslt
  8. 2 2
      apps/oozie/src/oozie/xslt/0.2.5/extensions/shell.0.1.xslt
  9. 2 2
      apps/oozie/src/oozie/xslt/0.2.5/extensions/sqoop.0.1.xslt
  10. 2 2
      apps/oozie/src/oozie/xslt/0.2.5/extensions/sqoop.0.2.xslt
  11. 24 0
      apps/oozie/src/oozie/xslt/0.2.5/nodes/fields/arg_params.xslt
  12. 2 2
      apps/oozie/src/oozie/xslt/0.2/extensions/shell.0.1.xslt
  13. 2 2
      apps/oozie/src/oozie/xslt/0.2/extensions/sqoop.0.1.xslt
  14. 2 2
      apps/oozie/src/oozie/xslt/0.2/extensions/sqoop.0.2.xslt
  15. 24 0
      apps/oozie/src/oozie/xslt/0.2/nodes/fields/arg_params.xslt
  16. 2 2
      apps/oozie/src/oozie/xslt/0.3/extensions/shell.0.1.xslt
  17. 2 2
      apps/oozie/src/oozie/xslt/0.3/extensions/sqoop.0.1.xslt
  18. 2 2
      apps/oozie/src/oozie/xslt/0.3/extensions/sqoop.0.2.xslt
  19. 24 0
      apps/oozie/src/oozie/xslt/0.3/nodes/fields/arg_params.xslt
  20. 2 2
      apps/oozie/src/oozie/xslt/0.4/extensions/shell.0.1.xslt
  21. 2 2
      apps/oozie/src/oozie/xslt/0.4/extensions/sqoop.0.1.xslt
  22. 2 2
      apps/oozie/src/oozie/xslt/0.4/extensions/sqoop.0.2.xslt
  23. 24 0
      apps/oozie/src/oozie/xslt/0.4/nodes/fields/arg_params.xslt

+ 1 - 1
apps/oozie/src/oozie/templates/editor/gen/workflow-common.xml.mako

@@ -21,7 +21,7 @@
 %>
 
 
-<%def name="filelink(path)">${ path + '#' + posixpath.basename(path) }</%def>
+<%def name="filelink(path)">${ '#' in path and path or path + '#' + posixpath.basename(path) }</%def>
 
 
 <%def name="prepares(prepares)">

+ 2 - 0
apps/oozie/src/oozie/test_data/0.4/test-sqoop.0.2.xml

@@ -8,6 +8,8 @@
                   <delete path="${nameNode}${output}"/>
             </prepare>
             <command>import --connect jdbc:hsqldb:file:db.hsqldb --table TT --target-dir ${output} -m 1</command>
+            <arg>My invalid arg</arg>
+            <arg>My invalid arg 2</arg>
             <file>db.hsqldb.properties#db.hsqldb.properties</file>
             <file>db.hsqldb.script#db.hsqldb.script</file>
         </sqoop>

+ 2 - 0
apps/oozie/src/oozie/tests.py

@@ -1707,6 +1707,7 @@ class TestImportWorkflow04(OozieMockBase):
     node = Node.objects.get(workflow=workflow, node_type='sqoop').get_full_node()
     assert_equal('["db.hsqldb.properties#db.hsqldb.properties","db.hsqldb.script#db.hsqldb.script"]', node.files)
     assert_equal('import --connect jdbc:hsqldb:file:db.hsqldb --table TT --target-dir ${output} -m 1', node.script_path)
+    assert_equal('[{"type":"arg","value":"My invalid arg"},{"type":"arg","value":"My invalid arg 2"}]', node.params)
     workflow.delete(skip_trash=True)
 
 
@@ -1748,6 +1749,7 @@ class TestImportWorkflow04(OozieMockBase):
     assert_equal('shell-2', nodes[1].name)
     assert_equal('my-job.xml', nodes[0].job_xml)
     assert_equal('hello.py', nodes[0].command)
+    assert_equal('[{"type":"argument","value":"World!"}]', nodes[0].params)
     assert_true(nodes[0].capture_output)
     assert_false(nodes[1].capture_output)
     workflow.delete(skip_trash=True)

+ 2 - 2
apps/oozie/src/oozie/xslt/0.1/extensions/shell.0.1.xslt

@@ -8,7 +8,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arguments.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="shell:shell">
@@ -21,7 +21,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arguments"/>
     <xsl:call-template name="prepares"/>
 
   </object>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.1/extensions/sqoop.0.1.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 <xsl:import href="../nodes/fields/script_path.xslt"/>
 
@@ -18,7 +18,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <xsl:call-template name="script_path"/>
 

+ 2 - 2
apps/oozie/src/oozie/xslt/0.1/extensions/sqoop.0.2.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="sqoop:sqoop">
@@ -17,7 +17,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <field name="script_path" type="CharField">
       <xsl:value-of select="*[local-name()='command']"/>

+ 24 - 0
apps/oozie/src/oozie/xslt/0.1/nodes/fields/arg_params.xslt

@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:workflow="uri:oozie:workflow:0.4" exclude-result-prefixes="workflow">
+
+<xsl:template name="arg_params">
+
+  <field name="params" type="TextField">
+    <xsl:text>[</xsl:text>
+    <xsl:for-each select="*[local-name()='arg']">
+      <xsl:choose>
+        <xsl:when test="position() &lt; last()">
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["},]]></xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["}]]></xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:text>]</xsl:text>
+  </field>
+
+</xsl:template>
+
+</xsl:stylesheet>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.2.5/extensions/shell.0.1.xslt

@@ -8,7 +8,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arguments.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="shell:shell">
@@ -21,7 +21,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arguments"/>
     <xsl:call-template name="prepares"/>
 
   </object>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.2.5/extensions/sqoop.0.1.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 <xsl:import href="../nodes/fields/script_path.xslt"/>
 
@@ -18,7 +18,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <xsl:call-template name="script_path"/>
 

+ 2 - 2
apps/oozie/src/oozie/xslt/0.2.5/extensions/sqoop.0.2.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="sqoop:sqoop">
@@ -17,7 +17,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <field name="script_path" type="CharField">
       <xsl:value-of select="*[local-name()='command']"/>

+ 24 - 0
apps/oozie/src/oozie/xslt/0.2.5/nodes/fields/arg_params.xslt

@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:workflow="uri:oozie:workflow:0.4" exclude-result-prefixes="workflow">
+
+<xsl:template name="arg_params">
+
+  <field name="params" type="TextField">
+    <xsl:text>[</xsl:text>
+    <xsl:for-each select="*[local-name()='arg']">
+      <xsl:choose>
+        <xsl:when test="position() &lt; last()">
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["},]]></xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["}]]></xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:text>]</xsl:text>
+  </field>
+
+</xsl:template>
+
+</xsl:stylesheet>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.2/extensions/shell.0.1.xslt

@@ -8,7 +8,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arguments.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="shell:shell">
@@ -21,7 +21,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arguments"/>
     <xsl:call-template name="prepares"/>
 
   </object>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.2/extensions/sqoop.0.1.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 <xsl:import href="../nodes/fields/script_path.xslt"/>
 
@@ -18,7 +18,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <xsl:call-template name="script_path"/>
 

+ 2 - 2
apps/oozie/src/oozie/xslt/0.2/extensions/sqoop.0.2.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="sqoop:sqoop">
@@ -17,7 +17,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <field name="script_path" type="CharField">
       <xsl:value-of select="*[local-name()='command']"/>

+ 24 - 0
apps/oozie/src/oozie/xslt/0.2/nodes/fields/arg_params.xslt

@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:workflow="uri:oozie:workflow:0.4" exclude-result-prefixes="workflow">
+
+<xsl:template name="arg_params">
+
+  <field name="params" type="TextField">
+    <xsl:text>[</xsl:text>
+    <xsl:for-each select="*[local-name()='arg']">
+      <xsl:choose>
+        <xsl:when test="position() &lt; last()">
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["},]]></xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["}]]></xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:text>]</xsl:text>
+  </field>
+
+</xsl:template>
+
+</xsl:stylesheet>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.3/extensions/shell.0.1.xslt

@@ -8,7 +8,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arguments.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="shell:shell">
@@ -21,7 +21,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arguments"/>
     <xsl:call-template name="prepares"/>
 
   </object>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.3/extensions/sqoop.0.1.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 <xsl:import href="../nodes/fields/script_path.xslt"/>
 
@@ -18,7 +18,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <xsl:call-template name="script_path"/>
 

+ 2 - 2
apps/oozie/src/oozie/xslt/0.3/extensions/sqoop.0.2.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="sqoop:sqoop">
@@ -17,7 +17,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <field name="script_path" type="CharField">
       <xsl:value-of select="*[local-name()='command']"/>

+ 24 - 0
apps/oozie/src/oozie/xslt/0.3/nodes/fields/arg_params.xslt

@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:workflow="uri:oozie:workflow:0.4" exclude-result-prefixes="workflow">
+
+<xsl:template name="arg_params">
+
+  <field name="params" type="TextField">
+    <xsl:text>[</xsl:text>
+    <xsl:for-each select="*[local-name()='arg']">
+      <xsl:choose>
+        <xsl:when test="position() &lt; last()">
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["},]]></xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["}]]></xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:text>]</xsl:text>
+  </field>
+
+</xsl:template>
+
+</xsl:stylesheet>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.4/extensions/shell.0.1.xslt

@@ -8,7 +8,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arguments.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="shell:shell">
@@ -21,7 +21,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arguments"/>
     <xsl:call-template name="prepares"/>
 
   </object>

+ 2 - 2
apps/oozie/src/oozie/xslt/0.4/extensions/sqoop.0.1.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 <xsl:import href="../nodes/fields/script_path.xslt"/>
 
@@ -18,7 +18,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <xsl:call-template name="script_path"/>
 

+ 2 - 2
apps/oozie/src/oozie/xslt/0.4/extensions/sqoop.0.2.xslt

@@ -6,7 +6,7 @@
 <xsl:import href="../nodes/fields/files.xslt"/>
 <xsl:import href="../nodes/fields/job_properties.xslt"/>
 <xsl:import href="../nodes/fields/job_xml.xslt"/>
-<xsl:import href="../nodes/fields/params.xslt"/>
+<xsl:import href="../nodes/fields/arg_params.xslt"/>
 <xsl:import href="../nodes/fields/prepares.xslt"/>
 
 <xsl:template match="sqoop:sqoop">
@@ -17,7 +17,7 @@
     <xsl:call-template name="files"/>
     <xsl:call-template name="job_properties"/>
     <xsl:call-template name="job_xml"/>
-    <xsl:call-template name="params"/>
+    <xsl:call-template name="arg_params"/>
     <xsl:call-template name="prepares"/>
     <field name="script_path" type="CharField">
       <xsl:value-of select="*[local-name()='command']"/>

+ 24 - 0
apps/oozie/src/oozie/xslt/0.4/nodes/fields/arg_params.xslt

@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:workflow="uri:oozie:workflow:0.4" exclude-result-prefixes="workflow">
+
+<xsl:template name="arg_params">
+
+  <field name="params" type="TextField">
+    <xsl:text>[</xsl:text>
+    <xsl:for-each select="*[local-name()='arg']">
+      <xsl:choose>
+        <xsl:when test="position() &lt; last()">
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["},]]></xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text><![CDATA[{"type":"arg","value":"]]></xsl:text><xsl:value-of select="." /><xsl:text><![CDATA["}]]></xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:text>]</xsl:text>
+  </field>
+
+</xsl:template>
+
+</xsl:stylesheet>