<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed Materials - Property of IBM* and/or HCL**
- UrbanCode Deploy
- UrbanCode Build
- UrbanCode Release
- AnthillPro
- (c) Copyright IBM Corporation 2011, 2017. All Rights Reserved.
- (c) Copyright HCL Technologies Ltd. 2022. All Rights Reserved.
-
- U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by
- GSA ADP Schedule Contract with IBM Corp.
-
- * Trademark of International Business Machines
- ** Trademark of HCL Technologies Limited
-->
<plugin xmlns="http://www.urbancode.com/PluginXMLSchema_v1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <header>
         <identifier id="com.ibm.ucd.plugin.zos" name="zOS Utility" version="68"/>
        <description>The zOS Utility plug-in includes steps related to deployment activities for zOS.
        </description>
        <tag>Utilities/zOS Utility</tag>
    </header>

    <!-- ==================================== -->
    <!-- STEPS -->
    <!-- ==================================== -->

    <!-- ==================================== -->
    <!-- Copy Package -->
    <!-- ==================================== -->
    <step-type name="Copy Artifacts">
        <description>Load artifacts from a local repository.
        </description>
        <properties>
            <property name="directoryOffset" required="true">
                <property-ui default-value="." description="The working directory to use when running the command. This directory is relative to the current working directory." label="Directory Offset" type="textBox"/>
            </property>
            <property name="basePath" required="true">
                <property-ui default-value="${p:ucd.repository.location}" description="The location of the repository where the z/OS deploy toolkit stores artifacts." hidden="true" label="Repository" type="textBox"/>
            </property>
            <property name="versionName" required="true">
                <property-ui default-value="${p:version.name}" hidden="true" label="Version Name" type="textBox"/>
            </property>
            <property name="componentName" required="true">
                <property-ui default-value="${p:component.name}" hidden="true" label="Component Name" type="textBox"/>
            </property>
            <property name="resourceId" required="true">
                <property-ui default-value="${p:resource.id}" hidden="true" label="Resource Id" type="textBox"/>
            </property>
            <property name="repositoryType" required="true">
                <property-ui default-value="${p?:version/ucd.repository.type}" hidden="true" label="Repository Type" type="textBox"/>
              </property>
        </properties>
        <post-processing>
          <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
             ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar:${ANT_HOME}/lib/ant.jar"/>
            <arg value="com.urbancode.air.plugin.Main"/>
            <arg value="CopyArtifacts"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <!-- ==================================== -->
    <!-- FTP Package -->
    <!-- ==================================== -->
    <step-type name="FTP Artifacts">
        <description>Load artifacts from a remote repository using FTP.
        </description>
        <properties>
            <property name="directoryOffset" required="true">
                <property-ui default-value="." description="The working directory to use when running the command. This directory is relative to the current working directory." label="Directory Offset" type="textBox"/>
            </property>
            <property name="protocol" required="false">
                <property-ui default-value="FTP" description="" hidden="true" label="Protocol" type="selectBox"/>
                <value label="FTP">FTP</value>
                <value label="SFTP">SFTP</value>
            </property>
            <property name="hostName" required="true">
                <property-ui default-value="${p:ucd.repository.host}" hidden="true" label="Host Name" type="textBox"/>
            </property>
            <property name="port">
                <property-ui default-value="" hidden="true" label="Port" type="textBox"/>
            </property>
            <property name="userid" required="true">
                <property-ui default-value="${p:ucd.repository.user}" hidden="true" label="User Name" type="textBox"/>
            </property>
            <property name="password">
                <property-ui default-value="${p?:ucd.repository.password}" hidden="true" label="Password" type="textBox"/>
            </property>
            <property name="basePath" required="true">
                <property-ui default-value="${p:ucd.repository.location}" description="The location of the repository where the z/OS deploy toolkit stores artifacts." hidden="true" label="Repository" type="textBox"/>
            </property>
            <property name="versionName" required="true">
                <property-ui default-value="${p:version.name}" hidden="true" label="Version Name" type="textBox"/>
            </property>
            <property name="componentName" required="true">
                <property-ui default-value="${p:component.name}" hidden="true" label="Component Name" type="textBox"/>
            </property>
            <property name="resourceId" required="true">
                <property-ui default-value="${p:resource.id}" hidden="true" label="Resource Id" type="textBox"/>
            </property>
            <property name="repositoryType" required="true">
                <property-ui default-value="${p?:version/ucd.repository.type}" hidden="true" label="Repository Type" type="textBox"/>
              </property>

            <property name="usePassticket">
                <property-ui default-value="true" hidden="true" label="Use Passticket" type="checkBox"
                description="Use PassTicket authentication if a password is not provided. See the z/OS Utility plug-in documentation for the required configuration to allow PassTickets." />
            </property>
            <property name="applID" required="true">
                <property-ui type="textBox" label="FTP Application Name" hidden="true"
                    default-value="FTPAPPL"
                    description="The FTP server application name. Specify the APPLNAME parameter from the FTP.DATA data set." />
            </property>
            <property name="irrracfJarFile" required="true">
                <property-ui type="textBox" label="IRRRacf.jar File" hidden="true"
                    default-value="/usr/include/java_classes/IRRRacf.jar"
                    description="Specify the full path to the System Access Facility (SAF) JAR file, which is IRRRacf.jar. The default value is /usr/include/java_classes/IRRRacf.jar." />
            </property>
            <property name="irrracfLibraryPath" required="true">
                <property-ui type="textBox" label="IRRRacf Native Library Path" hidden="true"
                    default-value="/usr/lib" description="Specify the path to the System Access Facility (SAF) native library, which is libIRRRacf.so. There is one library for 31-bit Java and one for 64-bit Java. You must specify the path of the appropriate library based on the version of Java that you are running. The default value is /usr/lib." />
            </property>
            <property name="useKeybaseAuth">
                <property-ui default-value="false" hidden="true" label="Use key based authentication" type="checkBox"
                description="Use key based authentication for SFTP protocol." />
            </property>
            <property name="keyfile" required="false">
                <property-ui default-value="${p?:ucd.repository.keyfile}" hidden="true" label="Location of keyfile" type="textBox"/>
            </property>
            <property name="passphrase" required="false">
                <property-ui default-value="${p?:ucd.repository.passphrase}" hidden="true" label="Passphrase for private key" type="textBox"/>
            </property>
        </properties>
        <post-processing>
        <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="classes:${ANT_HOME}/lib/ant.jar:${ANT_HOME}/lib/ant-launcher.jar:lib/ant-commons-net.jar:lib/commons-net-3.0.1.jar:lib/zos-deploy-common.jar:${irrracfJarFile}:lib/securedata.jar:lib/jettison-1.1.jar:lib/commons-codec.jar:lib/CommonsUtil.jar:${GROOVY_HOME}/lib/*"/>
            <arg value="ftp_package"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <!-- ==================================== -->
    <!-- Deploy Package -->
    <!-- ==================================== -->
    <step-type name="Deploy Data Sets">
        <description>Deploy data sets and HFS files
        </description>
        <properties>
            <property name="pdsMapping">
                <property-ui description="Specify a list of mapping rules for the data set packages, separated by newline characters. Use the following format: Source_Data_Set,Target_Data_Set. Use the asterisk (*) in the Source_Data_Set value to match any characters. If multiple rules specify the same Source_Data_Set value, only the first one is used. Use Source_Data_Set,DUMMY mapping to skip backup/deployment for a particular dataset. It will show as deployed at the environment level, but in actuality, the backup/deployment is skipped."
                default-value="${p?:deploy.env.pds.mapping}" label="Data Set Mapping" type="textAreaBox"/>
            </property>
            <property name="incrementalMode" required="true">
                 <property-ui type="selectBox"
                            default-value="FULL"
                            description="Specify INVENTORY to compare with the inventory metadata and deploy only these artifacts which are not identical to the ones already deployed. Comparison is based on identity attributes including lastModifiedTimestamp and customer properties starting with SYS.id."
                    label="Delta Deploy"/>
                      <value label="FULL">FULL</value>
                      <value label="INVENTORY">INVENTORY</value>
                      <value label="RUNTIME">RUNTIME</value>
                      <value label="${p?:delta.deploy.value}">${p?:delta.deploy.value}</value>
            </property>
            <property name="containerFilter">
                <property-ui description="The filter to limit Source datasets to be deployed. Java regular expression matching is used if the filter starts and ends with a forward slash (/). For example, specify /.*LOAD/ to match any data set containers ending with LOAD. If the filter is not a regular expression, exact matching is used. Separate each filter with a newline character"
                             label="Container Filter" type="textAreaBox"/>
            </property>

            <property name="deleteCurrentContents">
                <property-ui default-value="false" description="Select to delete all contents in the target folder and then deploy the artifacts from the selected version. Backup of the target directory will not be taken if this is set. Either the checkbox 'Delete the Target Directory contents' should be selected or the checkbox 'Backup for Rollback' checkbox should be selected. " label="Delete the Target Directory contents" type="checkBox"/>
            </property>
            <property name="printLogs">
                <property-ui default-value="false" description="Select to print debug logs for analysis" label="Print Debug Logs" hidden="true" type="checkBox"/>
            </property>
            <property name="checkAccess">
                <property-ui default-value="true" description="Select to check permission to update the data sets to deploy." label="Check Access" type="checkBox"/>
            </property>
            <property name="doBackup">
                <property-ui default-value="true" description="Select to create a backup of the data sets and files which are going to be replaced. A backup must exist to do a rollback." label="Backup for Rollback" type="checkBox"/>
            </property>
            <property name="allowCreateDataset">
                <property-ui default-value="TRUE" description="Specify TRUE to create a data set if the specified target data set does not exist." label="Allow Creating Data Set" type="textBox"/>
            </property>

            <property name="hfsTargetDir">
                <property-ui description="Specify target directory mappings to deploy HFS files. It can be either be a single target directory or mapping similar to PDS mapping with source and target directories."
                default-value="${p?:deploy.env.hfs.targetdir}" label="HFS Directory mappings" type="textAreaBox"/>
            </property>
            <property name="allowCreateDirectory">
                <property-ui default-value="TRUE" description="Specify TRUE to create the directory if the specified HFS target directory does not exist." label="Allow Creating Directory" type="textBox"/>
            </property>
            <property name="binderPath" required="true">
                <property-ui default-value="/usr/lib" description="Path to include binder shared libraries(iewbndd6.so/iewbnddx.so) for RUNTIME delta deployment" hidden="true" label="Binder API Path" type="textBox"/>
            </property>
            <property name="deployBasePath" required="true">
                <property-ui default-value="${BUZ_DEPLOY_BASE}" description="The base location to store deployment results and backups for rollback. The default value is the BUZ_DEPLOY_BASE environment variable, which is set to the deployment base path that was specified during installation. Typically, you do not change this value." hidden="true" label="Deployment Base Path" type="textBox"/>
            </property>
            <property name="tempDsnPrefix" required="true">
                <property-ui default-value="${p?:BUZ_TMP_DSN_PREFIX}" description="Specify a DSN prefix to be used to create temporary data sets. The default value is the BUZ_TMP_DSN_PREFIX environment variable. If a value is not provided, the prefix in the agent user's profile or the agent user's ID is used." hidden="true" label="Temporary DSN Prefix" type="textBox"/>
            </property>
            <property name="versionMerge" required="false">
                <property-ui default-value="${p?:version/ucd.version.ismerged}" description="Specify true if this is a merged version." hidden="true" label="Is Merged Version" type="textBox"/>
            </property>
            <property name="versionName" required="true">
                <property-ui default-value="${p:version.name}" hidden="true" label="Version Name" type="textBox"/>
            </property>
            <property name="versionId" required="true">
                <property-ui default-value="${p:version.id}" hidden="true" label="Version Id" type="textBox"/>
            </property>
            <property name="versionType" required="true">
                <property-ui default-value="${p:version.type}" hidden="true" label="Version Type" type="textBox"/>
            </property>
            <property name="componentName" required="true">
                <property-ui default-value="${p:component.name}" hidden="true" label="Component Name" type="textBox"/>
            </property>
            <property name="resourceId" required="true">
                <property-ui default-value="${p:resource.id}" hidden="true" label="Resource Id" type="textBox"/>
            </property>
            <property name="componentId" required="true">
                <property-ui default-value="${p:component.id}" hidden="true" label="Component Id" type="textBox"/>
            </property>
        </properties>
        <post-processing>
        <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>
        <!-- IMPORTANT: Any change in number of arguments below, need changes in /src/main/zip/runjava_deploy.sh -->
        <command program="${PLUGIN_HOME}/runjava_deploy.sh">
            <arg value="${AGENT_BIN_HOME}/lib/zos:${binderPath}"/>
            <arg value="-cp"/>
            <arg path="${ANT_HOME}/lib/ant.jar:${ANT_HOME}/lib/ant-launcher.jar:lib/ant-contrib.jar:lib/zos-deploy-common.jar:lib/uDeployRestClient.jar:classes:lib/securedata.jar:lib/jettison-1.1.jar:lib/commons-codec.jar:lib/zos-deploy-native.jar:lib/CommonsUtil.jar:${GROOVY_HOME}/lib/*"/>
            <arg value="deploy_package"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <!-- ==================================== -->
    <!-- Rollback Package -->
    <!-- ==================================== -->
    <step-type name="Rollback Data Sets">
        <description>Rollback data sets and HFS files to a backup created in the previous deployment.
        </description>
        <properties>
            <property name="checkAccess">
                <property-ui default-value="true" description="Select to check permission to update the data sets to deploy." label="Check Access" type="checkBox"/>
            </property>
            <property name="delBackUpFiles">
                <property-ui default-value="false" description="Select to remove the backup data that was created during deployment for this version." label="Delete Backup Data" type="checkBox"/>
            </property>
            <property name="preventRiskyRollback" required="true">
                <property-ui type="selectBox"
                           default-value="true"
                           description="Set to TRUE to prevent risky rollback. A risky rollback tries to rollback modules that have been replaced by a subsequent version."
                   label="Prevent Risky Rollback"/>
                     <value label="true">true</value>
                     <value label="false">false</value>
                     <value label="${p?:prevent.risky.rollback}">${p?:prevent.risky.rollback}</value>
            </property>
            <property name="dryRunForRisky">
                <property-ui default-value="false" description="Select to do a dry run which only checks for risky rollback. No actual rollback is done when doing a dry run. The step will fail when risk is detected, otherwise, the step will pass." label="Run to Check Risk Only" type="checkBox"/>
            </property>
            <property name="printLogs">
                <property-ui default-value="false" description="Select to print debug logs for analysis" label="Print Debug Logs" hidden="true" type="checkBox"/>
            </property>
            <property name="hfsTargetDir">
                <property-ui description="Specify a target directory to deploy HFS files. Use this only if the agent version is less than 7.0.3.0"
                             default-value="${p?:deploy.env.hfs.targetdir}" label="HFS Target Directory" type="textBox"/>
            </property>

            <property name="deployBasePath" required="true">
                <property-ui default-value="${BUZ_DEPLOY_BASE}" description="The base location to store deployment results and backups for rollback. " hidden="true" label="Deployment Base Path" type="textBox"/>
            </property>
            <property name="tempDsnPrefix" required="true">
                <property-ui default-value="${p?:BUZ_TMP_DSN_PREFIX}" description="Specify a DSN prefix to be used to create temporary data sets. The default value is the BUZ_TMP_DSN_PREFIX environment variable. If a value is not provided, the prefix in the agent user's profile or the agent user's ID is used." hidden="true" label="Temporary DSN Prefix" type="textBox"/>
            </property>
            <property name="environmentId" required="true">
                <property-ui default-value="${p:environment.id}" hidden="true" label="Environment Id" type="textBox"/>
            </property>
            <property name="versionId" required="true">
                <property-ui default-value="${p:version.id}" hidden="true" label="Version Id" type="textBox"/>
            </property>
            <property name="componentId" required="true">
                <property-ui default-value="${p:component.id}" hidden="true" label="Component Id" type="textBox"/>
            </property>
            <property name="versionName" required="true">
                <property-ui default-value="${p:version.name}" hidden="true" label="Version Name" type="textBox"/>
            </property>
            <property name="versionType" required="true">
                <property-ui default-value="${p:version.type}" hidden="true" label="Version Type" type="textBox"/>
            </property>
            <property name="componentName" required="true">
                <property-ui default-value="${p:component.name}" hidden="true" label="Component Name" type="textBox"/>
            </property>
            <property name="resourceId" required="true">
                <property-ui default-value="${p:resource.id}" hidden="true" label="Resource Id" type="textBox"/>
            </property>
        </properties>
        <post-processing>
        <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${ANT_HOME}/lib/ant.jar:${ANT_HOME}/lib/ant-launcher.jar:lib/ant-contrib.jar:lib/zos-deploy-common.jar:lib/uDeployRestClient.jar:classes:lib/securedata.jar:lib/jettison-1.1.jar:lib/commons-codec.jar:lib/CommonsUtil.jar:${GROOVY_HOME}/lib/*"/>
            <arg value="rollback_package"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <!-- ==================================== -->
    <!-- Remove Redundant Versions -->
    <!-- ==================================== -->
    <step-type name="Remove Redundant Versions">
        <description>Remove redundant versions in an environment. Redundant versions are versions that are completely replaced by subsequent versions.
        </description>
        <properties>
            <property name="isDryRun">
                <property-ui default-value="false" description="Select to specify a dry run, which does not delete versions. Instead, the versions to be deleted are written to the output log for verification." label="Dry Run" type="checkBox"/>
            </property>
            <property name="applicationName" required="true">
                <property-ui default-value="${p:application.name}" hidden="true" label="Application Name" type="textBox"/>
            </property>
            <property name="environmentName" required="true">
                <property-ui default-value="${p:environment.name}" hidden="true" label="Environment Name" type="textBox"/>
            </property>
            <property name="resourceId" required="false">
                <property-ui default-value="${p:resource.id}" hidden="true" label="Resource Id" type="textBox"/>
            </property>
            <property name="componentName" required="true">
                <property-ui default-value="${p:component.name}" hidden="true" label="Component Name" type="textBox"/>
            </property>
            <property name="deployBasePath" required="true">
                <property-ui default-value="${BUZ_DEPLOY_BASE}" hidden="true" label="Deployment Base Path" type="textBox"/>
            </property>
        </properties>
        <post-processing>
          <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
             ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar"/>
            <arg value="com.urbancode.air.plugin.command.RemoveRedundantVersions"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <!-- ==================================== -->
    <!-- Remove All Versions -->
    <!-- ==================================== -->
    <step-type name="Remove All Versions">
        <description>Remove all versions in an environment.
        </description>
        <properties>
            <property name="isDryRun">
                <property-ui default-value="false" description="Select to specify a dry run, which does not delete versions. Instead, the versions to be deleted are written to the output log for verification." label="Dry Run" type="checkBox"/>
            </property>
            <property name="applicationName" required="true">
                <property-ui default-value="${p:application.name}" hidden="true" label="Application Name" type="textBox"/>
            </property>
            <property name="environmentName" required="true">
                <property-ui default-value="${p:environment.name}" hidden="true" label="Environment Name" type="textBox"/>
            </property>
            <property name="resourceId" required="false">
                <property-ui default-value="${p:resource.id}" hidden="true" label="Resource Id" type="textBox"/>
            </property>
            <property name="componentName" required="true">
                <property-ui default-value="${p:component.name}" hidden="true" label="Component Name" type="textBox"/>
            </property>
            <property name="deployBasePath" required="true">
                <property-ui default-value="${BUZ_DEPLOY_BASE}" hidden="true" label="Deployment Base Path" type="textBox"/>
            </property>
        </properties>
        <post-processing>
          <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
             ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar"/>
            <arg value="com.urbancode.air.plugin.command.RemoveAllVersions"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <!-- ==================================== -->
    <!-- Run TSO or ISPF Command              -->
    <!-- ==================================== -->
    <step-type name="Run TSO or ISPF Command">
        <description>Run TSO and ISPF commands using the ISPF gateway.
        </description>
        <properties>
            <property name="serviceType" required="true">
                 <property-ui type="selectBox"
                    default-value="TSO"
                            description="Only ISPF supports return code."
                    label="TSO Or ISPF"/>
              <value label="TSO">TSO</value>
              <value label="ISPF">ISPF</value>
            </property>
            <property name="tsoCommand" required="true">
                <property-ui type="textAreaBox"
                    description="Specify the TSO and ISPF commands to run. Separate multiple commands with newline characters. Interactive TSO commands are not supported."
                    label="Command To Run From ISPF" default-value="" />
            </property>
            <property name="stopOnFail" >
                <property-ui type="checkBox" label="Stop On Fail"
                    default-value="true" description="Select to stop running commands after a command fails with a non-zero return code." />
            </property>
            <property name="reuseSession" >
                <property-ui type="checkBox" label="Run In A 'Reusable' ISPF Session"
                    default-value="false" description="Select to run commands in a reusable ISPF session that stays active between calls." />
            </property>
            <property name="showLog">
                <property-ui type="checkBox" label="Show Operation Log"
                    default-value="false" />
            </property>
            <property name="ispProf">
                <property-ui type="textBox" label="ISPF TSO Profile"
                    default-value="" description="Specify an existing ISPF profile to use in the call."/>
            </property>
            <property name="ispfGatewayPath" required="true">
                <property-ui type="textBox" label="ISPF Gateway Path" hidden="true"
                    default-value="/usr/lpp/ispf/bin" description="Specify the path the ISPF gateway binary files." />
            </property>
        </properties>
        <!-- This is the standard post processing script. It sets the step to Success
            if the exit code of the process was 0. Otherwise, the step fails. In order
            for a step to run correctly, it must have a post processing script and that
            post processing script must set the status property based off of the exit
            code. -->
        <post-processing>
            <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp" />
            <arg path="classes:lib/zos-deploy-common.jar:lib/securedata.jar:lib/jettison-1.1.jar:lib/commons-codec.jar:lib/CommonsUtil.jar:${GROOVY_HOME}/lib/*"/>
            <arg value="tso" />
            <arg file="${PLUGIN_INPUT_PROPS}" />
            <arg file="${PLUGIN_OUTPUT_PROPS}" />
        </command>
    </step-type>
    <!-- ==================================== -->
    <!-- Allocate data set -->
    <!-- ==================================== -->

    <step-type name="Allocate Data Set">
        <description>Allocate a non-SMS-managed data set.</description>
        <properties>
            <property name="dataSetName" required="true">
                <property-ui default-value=""  label="Data Set Name " type="textBox"
                description="Data set name. If the single quotation marks are omitted, the user's data set prefix from the TSO profile is automatically appended to the front of the data set name. "
                />
            </property>
            <property name="deleteDataset">
                <property-ui default-value="false" description="Select to delete dataset if already exist before allocation." label="Delete Existing Data Set" type="checkBox"/>
            </property>
            <property name="volumeSerial" required="false">
                <property-ui default-value="" description="Leave blank to use the system default volume."
                             label="Volume Serial" type="textBox"/>
            </property>
            <property name="spaceUnit" required="true">
                <property-ui default-value="TRACKS" description="BLKS, TRKS, CYLS"
                             label="Space Units" type="selectBox"/>
                <value label="BLKS">BLKS</value>

                <value label="TRKS">TRACKS</value>

                <value label="CYLS">CYL</value>

            </property>
            <property name="averRecUnit" required="false">
                <property-ui default-value="---"
                             description="Select the unit to use when allocating average record length. U specifies single-record units (bytes). K specifies thousand-record units (kilobytes). M specifies million-record units (megabytes). (---) specifies the system default value."
                              label="Average Record Unit" type="selectBox"/>
                <value label="---">---</value>

                <value label="K">K</value>

                <value label="M">M</value>

                <value label="U">U</value>
            </property>
            <property name="primaryQuantity" required="true">
                <property-ui default-value="200" description="Specify the primary quantity in average record units."  label="Primary Quantity"
                             type="textBox"/>
            </property>
            <property name="secondaryQuantity" required="true">
                <property-ui default-value="100" description="Specify the secondary quantity in average record units."  label="Secondary Quantity"
                             type="textBox"/>
            </property>
            <property name="directoryBlocks" required="false">
                <property-ui default-value="20"
                             description="The number of directory blocks to allocate. Specify zero for a sequential data set. Specifying LIBRARY in the data set name might override a setting of zero directory blocks."
                             label="Directory Blocks" type="textBox"/>
            </property>
            <property name="recordFormat" required="false">
                <property-ui default-value="F,B" description="" label="Record Format" type="selectBox"/>
                <value label="FB">F,B</value>

                <value label="F">F</value>

                <value label="VB">V,B</value>

                <value label="V">V</value>

                <value label="U">U</value>

                <value label="FBA">F,B,A</value>

                <value label="VBA">V,B,A</value>

                <value label="FBM">F,B,M</value>

                <value label="FM">F,M</value>

                <value label="VBM">V,B,M</value>

                <value label="VM">V,M</value>

            </property>
            <property name="recordLength" required="true">
                <property-ui default-value="80"  label="Record Length" type="textBox"/>
            </property>
            <property name="blockSize" required="true">
                <property-ui default-value="0"
                             description="Specify the number of bytes of data to place in each block, based on the record length."
                              label="Block Size" type="textBox"/>
            </property>
            <property name="dataSetNameType" required="false">
                <property-ui default-value="---"
                             description="LIBRARY, PDS, or Default(---)"
                             label="Data Set Name Type" type="selectBox"/>
                <value label="---">---</value>

                <value label="LIBRARY">LIBRARY</value>

                <value label="PDS">PDS</value>
            </property>
        </properties>
        <!-- This is the standard post processing script. It sets the step to Success
            if the exit code of the process was 0. Otherwise, the step fails. In order
            for a step to run correctly, it must have a post processing script and that
            post processing script must set the status property based off of the exit
            code. -->
        <post-processing>
           <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar"/>
            <arg value="com.urbancode.air.plugin.command.AllocateDataset"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <step-type name="Allocate SMS Managed Data Set">
        <description>Allocate an SMS-managed data set.</description>
        <properties>
            <property name="datasetName" required="true">
                <property-ui label="Data Set Name" type="textBox"
                description="Data set name. If the single quotation marks are omitted, the user's data set prefix from the TSO profile is automatically appended to the front of the data set name. "/>
            </property>
            <property name="deleteDataset">
                <property-ui default-value="false" description="Select to delete dataset if already exist before allocation." label="Delete Existing Data Set" type="checkBox"/>
            </property>
            <property name="managementClass" required="false">
                <property-ui description="Leave blank to use the default management class." label="Management Class"
                             type="textBox"/>
            </property>
            <property name="storageClass" required="false">
                <property-ui description="Leave blank to use the default storage class." label="Storage Class" type="textBox"/>
            </property>
            <property name="dataClass">
                <property-ui description="Leave blank to use the default data class." label="Data Class" type="textBox"/>
            </property>
        </properties>
        <!-- This is the standard post processing script. It sets the step to Success
            if the exit code of the process was 0. Otherwise, the step fails. In order
            for a step to run correctly, it must have a post processing script and that
            post processing script must set the status property based off of the exit
            code. -->
        <post-processing>
          <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar"/>
            <arg value="com.urbancode.air.plugin.command.AllocateDatasetSms"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>
    <step-type name="Copy Data Set">
        <description>Copy a data set.</description>
        <properties>
            <property name="sourcePDS" required="true">
                <property-ui label="From PDS" type="textAreaBox"
                             description="Specify the names of the source PDS, separated by newline characters. Use the following format: PDS-NAME (or) PDS-NAME,R. R specifies that all members of the source PDS replace any members with the same name in the target PDS."/>
            </property>
            <property name="toPDS" required="true">
                <property-ui label="To PDS" type="textBox"
                description="Specify the name of the target PDS."/>
            </property>
            <property name="includeMembers" required="false">
                <property-ui label="Include Members" type="textAreaBox"
                             description="Specify the members in the source PDS to copy, separated by newline characters. Use the following format: MEMBER-NAME (or) MEMBER-NAME, NEW-MEMBER-NAME[, R] (or) MEMBER-NAME,,R. To rename a member, specify the current name of the member, followed by the new name and optionally the R (replace) parameter. To replace a member, specify the name of the member and the R parameter, separated by two commas."/>
            </property>
            <property name="excludeMembers" required="false">
                <property-ui label="Exclude Members" type="textAreaBox"
                             description="Specify a list of members in the source PDS to skip when copying. Separate member names with newline characters."/>
            </property>
            <property name="isLoadModule" required="false">
                <property-ui type="checkBox" label="Load Module Dataset" default-value="false"
                             description="Select to use the IEBCOPY COPYMOD control statement when copying load modules."/>
            </property>
        </properties>
          <post-processing>
          <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
             ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar"/>
            <arg value="com.urbancode.air.plugin.Main"/>
            <arg value="CopyDataset"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <step-type name="Allocate Data Set From Existing">
        <description>Create a data set with the attributes of an existing model data set.</description>
        <properties>
            <property name="datasetName" required="true">
                <property-ui default-value="" label="Data Set Name" type="textBox"
                description="Data set name. If the single quotation marks are omitted, the user's data set prefix from the TSO profile is automatically appended to the front of the data set name. "
                />
            </property>
            <property name="likeDatasetName" required="true">
                <property-ui
                        description="Specify the name of an existing data set to use as a model. The attributes of this data set are used as the attributes for the data set being allocated. If the single quotation marks are omitted, the user's data set prefix from the TSO profile is automatically appended to the front of the data set name."
                        label="Like" type="textBox"/>
            </property>
            <property name="deleteDataset">
                <property-ui default-value="false" description="Select to delete dataset if already exist before allocation." label="Delete Existing Data Set" type="checkBox"/>
            </property>
            <property name="volumeSerial" required="false">
                <property-ui default-value="" description="Leave blank to use the system default volume."
                             label="Volume Serial" type="textBox"/>
            </property>
            <property name="spaceUnit" required="false">
                <property-ui default-value="---" description="BLKS, TRKS, CYLS, or default(---)" label="Space Units"
                             type="selectBox"/>
                <value label="---">---</value>
                <value label="BLKS">BLKS</value>
                <value label="TRKS">TRACKS</value>
                <value label="CYLS">CYL</value>

            </property>
            <property name="primaryQuantity" required="false">
                <property-ui default-value="0" description="Specify the primary quantity in space units." label="Primary Quantity"
                             type="textBox"/>
            </property>
            <property name="secondaryQuantity" required="false">
                <property-ui default-value="0" description="Specify the secondary quantity in space units." label="Secondary Quantity"
                             type="textBox"/>
            </property>
        </properties>
        <!-- This is the standard post processing script. It sets the step to Success
    if the exit code of the process was 0. Otherwise, the step fails. In order
    for a step to run correctly, it must have a post processing script and that
    post processing script must set the status property based off of the exit
    code. -->
        <post-processing>
         <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>
        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar"/>
            <arg value="com.urbancode.air.plugin.command.AllocateLike"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <!-- ==================================== -->
    <!-- Submit Job                           -->
    <!-- ==================================== -->
    <step-type name="Submit Job">
        <description>Submit job.</description>
        <properties>
            <property name="mvsFilename">
                <property-ui description="Submits JCL from a partitioned data set (PDS) member. Input can be a PDS member name: A.B.C(MEM). Or a PDS member pattern: A.B.C(D*X). Or a PDS name: A.B.C. When the input is a member pattern, all matching members are submitted. When the input is a PDS name, all members are submitted. Multiple JCL statements are submitted in sequence using the same settings. Multiple input JCL statements cannot be used together with Replace Token sets for Each Job field." label="JCL Dataset" type="textBox"/>
            </property>
            <property name="ussFilename">
                <property-ui description="Submits JCL in a file in the UNIX file system. For example, /u/userid/jobname.jcl" label="JCL File" type="textBox"/>
            </property>
            <property name="jclString">
                <property-ui description="Enter the JCL to submit." label="JCL" type="textAreaBox"/>
            </property>
            <property name="jobCard">
              <property-ui description="Default job statement to use if no job statement is found in the JCL. The job statement is not validated. Ensure that the job statement contains valid values for your system. Token replacement rules are not applied to the default job statement."
                  label="Default Job Statement" default-value="${p?:deploy.env.jobstatement}"  type="textAreaBox"/>
            </property>
            <property name="explicitTokens">
              <property-ui description="Specify replacement rules to apply to the JCL before submission. Rules are represented by a list of explicit tokens to replace in the following format: token-&gt;value. Separate rules with newline characters. For example, mytoken-&gt;new_value will replace the mytoken string with new_value in all files. To replace @token@ with new_value, specify @token@-&gt;new_value. Regular expressions are not supported."
                  label="Replace Tokens" type="textAreaBox"/>
            </property>
            <property name="explicitTokensForeachJob">
              <property-ui description="One job is submitted for each set of token replacement rules. Each set must be separated by a line containing only two forward slashes (//) characters. Within a set, each rule must be on a separate line."
                  label="Replace Token sets for Each Job" type="textAreaBox"/>
            </property>
            <property name="waitForJob">
                <property-ui default-value="true" description="Select to wait for the job to complete. If cleared, the Timeout, Show Output, Max Lines, and Max Return Code fields are not used." label="Wait For Job" type="checkBox"/>
            </property>
            <property name="stopOnFail" >
                <property-ui type="checkBox" label="Stop On Fail"
                    default-value="true" description="Select to stop submitting jobs after a job fails. Failure is determined by the Max Return Code and Timeout fields. A JCL error is always considered a failure." />
            </property>
            <property name="timeout">
                <property-ui default-value="120" description="Specify the timeout in seconds." label="Timeout" type="textBox"/>
            </property>
            <property name="showOutput">
                <property-ui default-value="ALL" description="Specify the output data set to be displayed in the log. Separate multiple data sets with commas. Specify ALL for all data sets." label="Show Output" type="textBox"/>
            </property>
            <property name="cutOff">
                <property-ui default-value="10000" description="Specify the maximum number of lines to display in the log. Set it to -1 to display all the lines." label="Max Lines" type="textBox"/>
            </property>
            <property name="maxRC" required="true">
                <property-ui default-value="4" description="Specify the maximum return code for the step. The step fails if the JCL return code is greater than the specified value." label="Max Return Code" type="textBox"/>
            </property>
            <!-- hidden properties -->
            <property name="useRunId" required="true">
                <property-ui type="selectBox"
                     default-value="FALSE"
                     hidden="true"
                     description="Set it to TRUE to submit the job using the Agent Id (or) impersonation Id used to run this step. Set it to FALSE to submit the job with a specific UserId and password/passticket."
                     label="Use Agent/Impersonation Id to submit Job"/>
                <value label="TRUE">TRUE</value>
                <value label="FALSE">FALSE</value>
                <value label="${p:jes.use.run.id}">${p:jes.use.run.id}</value>
            </property>
            <property name="hostname" required="true">
                <property-ui default-value="${p:jes.host}" hidden="true" label="Host Name" type="textBox"/>
            </property>
            <property name="port" required="true">
                <property-ui default-value="${p:jes.monitor.port}" description="JES job monitor port (1-65535). Default is 6715." hidden="true" label="Job Monitor Port" type="textBox"/>
            </property>
            <property name="userid">
                <property-ui default-value="${p:jes.user}" hidden="true" label="User Name" type="textBox"/>
            </property>
            <property name="password">
                <property-ui default-value="${p?:jes.password}" hidden="true" label="Password" type="textBox"/>
            </property>
            <property name="usePassticket">
                <property-ui default-value="true" hidden="true" label="Use Passticket" type="checkBox"
                description="Use PassTicket authentication if a password is not provided. See the z/OS Utility plug-in documentation for the required configuration to allow PassTickets. This option cannot be used in a non-zOS agent." />
            </property>
            <property name="irrracfJarFile" required="true">
                <property-ui type="textBox" label="IRRRacf.jar File" hidden="true"
                    default-value="/usr/include/java_classes/IRRRacf.jar"
                    description="Specify the full path to the System Access Facility (SAF) JAR file, which is IRRRacf.jar. The default value is /usr/include/java_classes/IRRRacf.jar." />
            </property>
            <property name="irrracfLibraryPath" required="true">
                <property-ui type="textBox" label="IRRRacf Native Library Path" hidden="true"
                    default-value="/usr/lib" description="Specify the path to the System Access Facility (SAF) native library, which is libIRRRacf.so. There is one library for 31-bit Java and one for 64-bit Java. You must specify the path of the appropriate library based on the version of Java that you are running. The default value is /usr/lib." />
            </property>
            <property name="outputPagination">
                <property-ui default-value="false" hidden="true" label="Print job output of each job in separate page" type="checkBox"
                description="When multiple jobs are submitted in a single plugin step, check this box to get each output on a separate page. The first page will be blank and output will start from the second page" />
            </property>
        </properties>
        <post-processing>
        <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar:${PLUGIN_HOME}/lib/*:${irrracfJarFile}"/>
            <arg value="com.urbancode.air.plugin.Main"/>
            <arg value="SubmitJob"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

    <!-- ==================================== -->
    <!-- Wait For Job                           -->
    <!-- ==================================== -->
    <step-type name="Wait For Job">
        <description>Wait for a submitted job to complete. </description>
        <properties>
            <property name="jobId">
                <property-ui default-value="${p:submitStepName/JobId}"
                    description="Specify the job ID. For example, JOB06663. Use the ${p:submitStepName/jobId} property to refer to the job ID from an earlier Submit Job step." label="Job ID" type="textBox"></property-ui>
            </property>
            <property name="timeout">
                <property-ui default-value="120" description="Specify the timeout in seconds." label="Timeout" type="textBox"/>
            </property>
            <property name="showOutput">
                <property-ui default-value="ALL" description="Specify the output data sets to display in the log. Separate multiple data sets with commas. Specify ALL to display all data sets." label="Show Output" type="textBox"/>
            </property>
            <property name="cutOff">
                <property-ui default-value="10000" description="Specify the maximum number of lines to display in the log. Set it to -1 to display all the lines." label="Max Lines" type="textBox"/>
            </property>
            <property name="maxRC" required="true">
                <property-ui default-value="4" description="Specify the maximum return code for the step. The step fails if the JCL return code is greater than the specified value." label="Max Return Code" type="textBox"/>
            </property>
            <!-- hidden properties -->
            <property name="useRunId" required="true">
                <property-ui type="selectBox"
                     default-value="FALSE"
                     hidden="true"
                     description="Set it to TRUE for using the Agent Id (or) impersonation Id used to run this step. Set it to FALSE to run this step with a specific UserId and password/passticket."
                     label="Use Agent/Impersonation Id to wait For Job"/>
                <value label="TRUE">TRUE</value>
                <value label="FALSE">FALSE</value>
                <value label="${p:jes.use.run.id}">${p:jes.use.run.id}</value>
            </property>
            <property name="hostname" required="true">
                <property-ui default-value="${p:jes.host}" hidden="true" label="Host Name" type="textBox"/>
            </property>
            <property name="port" required="true">
                <property-ui default-value="${p:jes.monitor.port}" description="JES job monitor port (1-65535). Default is 6715." hidden="true" label="Job Monitor Port" type="textBox"/>
            </property>
            <property name="userid">
                <property-ui default-value="${p:jes.user}" hidden="true" label="User Name" type="textBox"/>
            </property>
            <property name="password">
                <property-ui default-value="${p?:jes.password}" hidden="true" label="Password" type="textBox"/>
            </property>
            <property name="usePassticket">
                <property-ui default-value="true" hidden="true" label="Use Passticket" type="checkBox"
                description="Use PassTicket authentication if a password is not provided. See the z/OS Utility plug-in documentation for the required configuration to allow PassTickets.This option cannot be used in a non-zOS agent." />
            </property>
            <property name="irrracfJarFile" required="true">
                <property-ui type="textBox" label="IRRRacf.jar File" hidden="true"
                    default-value="/usr/include/java_classes/IRRRacf.jar"
                    description="Specify the full path to the System Access Facility (SAF) JAR file, which is IRRRacf.jar. The default value is /usr/include/java_classes/IRRRacf.jar." />
            </property>
            <property name="irrracfLibraryPath" required="true">
                <property-ui type="textBox" label="IRRRacf Native Library Path" hidden="true"
                    default-value="/usr/lib" description="Specify the path to the System Access Facility (SAF) native library, which is libIRRRacf.so. There is one library for 31-bit Java and one for 64-bit Java. You must specify the path of the appropriate library based on the version of Java that you are running. The default value is /usr/lib." />
            </property>
        </properties>
        <post-processing>
        <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="classes:lib/zos-deploy-common.jar:${irrracfJarFile}:lib/securedata.jar:lib/jettison-1.1.jar:lib/commons-codec.jar:lib/CommonsUtil.jar:${GROOVY_HOME}/lib/*"/>
            <arg value="wait_for_job"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>
    </step-type>

      <step-type name="Replace Tokens MVS">
            <description>Replace tokens in MVS data set using properties.</description>
            <properties>
            <property name="includes" required="true">
                  <property-ui default-value="" description="Specify a list of patterns that describe data sets to process. Separate patterns with commas or newline characters. For example, specify USERID.JCL(ABC) for a partitioned data set, or USERID.DATA for a sequential data set." label="Include Data Sets" type="textAreaBox"/>
                </property>
                <property name="isWildCardAllowed" required="true">
                  <property-ui default-value="false" description="Select to use an asterisk (*) as a wildcard character in the Include Data Sets field. The asterisk matches any characters. Using wildcard characters can result in updates to a large number of data set members or unexpected updates." label="Allow Wildcard" type="checkBox"/>
                </property>
                <property name="excludes" required="false">
                  <property-ui description="Specify a list of data set patterns to exclude from processing. Separate patterns with commas or newline characters. Use an asterisk (*) to match any characters. For example, USERID.JCL(ABC*). Sequential data sets are not supported." label="Exclude Data Sets" type="textAreaBox"/>
                </property>
                <property name="startDelimiter">
                  <property-ui default-value="@" description="The start delimiter character to use for identifying tokens." label="Start Token Delimiter" type="textBox"/>
                </property>
                <property name="endDelimiter">
                  <property-ui default-value="@" description="The end delimiter character to use for identifying tokens." label="End Token Delimiter" type="textBox"/>
                </property>
                <property name="propertyPrefix" required="false">
                  <property-ui description="Specify a prefix to use to determine which properties are included in token replacement. Leave blank to use all properties." label="Property Prefix" type="textBox"/>
                </property>
                <property name="envPropValues">
                  <property-ui default-value="${p:environment/allProperties}" description="Specify a value here to use existing property names as tokens to replace in the target files. For example, specify ${p:environment/allProperties} use the names of all component environment properties tokens and the property values as the replacements. Similarly, specify ${p:component/allProperties},${p:environment/allProperties} to use all component and component environment properties for token replacement. The delimiter and prefix settings above apply. For example, if the start and end token delimiters are the at sign (@) and property is called token1, then the step searches for @token1@ to replace." label="Property List" type="textBox"/>
                </property>
                <property name="explicitTokens">
                  <property-ui description="Specify a list of explicit tokens to replace, separated by newline characters. Use the following format: token-&gt;value.  For example, mytoken-&gt;new_value will replace the mytoken string with new_value in all files. This field is not affected by the delimiter or prefix fields. To replace @token@ with new_value, specify @token@-&gt;new_value. If you specify a value in the Property List field, the explicit tokens are added as additional values to replace and override any properties that have the same name. Regular expressions are not supported." label="Explicit Tokens" type="textAreaBox"/>
                </property>
                <property name="failOnTruncate" >
                    <property-ui type="checkBox" label="Fail On Truncate"
                        default-value="false" description="Select to set the step to fail if the line exceeds the record length after replacement. If cleared, the line is truncated to fit the record length." />
                </property>
            </properties>
        <post-processing><![CDATA[
            if (properties.get("exitCode") != 0) {
                properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
            }
            else {
                properties.put("Status", "Success");
            }
         ]]></post-processing>
          <command program="${PLUGIN_HOME}/runjava.sh">
              <arg value="-cp"/>
              <arg path="${PLUGIN_HOME}/zos-deploy.jar:${PLUGIN_HOME}/lib/*"/>
              <arg value="com.urbancode.air.plugin.Main"/>
              <arg value="ReplaceTokensMVS"/>
              <arg file="${PLUGIN_INPUT_PROPS}"/>
              <arg file="${PLUGIN_OUTPUT_PROPS}"/>
          </command>
  </step-type>

    <!-- ==================================== -->
    <!-- Generate Version Artifact Information -->
    <!-- ==================================== -->
    <step-type name="Generate Artifact Information">
      <description>Generate text information for selected version artifacts. The information is sent to the text output property for use by later steps.</description>
      <properties>
            <property name="loopType" required="true">
                 <property-ui type="selectBox"
                    default-value="Member"
                            description="Generate information for each artifact of the selected type."
                    label="For Each"/>
              <value label="PDS Member">Member</value>
              <value label="PDS">PDS</value>
              <value label="Sequential Data Set">Sequential</value>
              <value label="Deleted PDS Member">DeletedMember</value>
              <value label="Deleted PDS">DeletedPDS</value>
              <value label="Deleted Sequential Data Set">DeletedSequential</value>
              <value label="Directory">Directory</value>
              <value label="File">File</value>
              <value label="Deleted File">DeletedFile</value>
              <value label="Generic Artifact Group">GenericArtifactGroup</value>
              <value label="Generic Artifact">GenericArtifact</value>
            </property>
            <property name="orderBy" required="true">
                 <property-ui type="selectBox"
                    default-value="ASC" label="Order By"/>
              <value label="ASC Order">ASC</value>
              <value label="DESC Order">DESC</value>
              <value label="Shiplist Order">SHIPLIST</value>
            </property>
            <property name="srcDatasetName" required="false">
                <property-ui type="textBox" label="Container Name Filter"
                    default-value="" description="Specify a filter to use on the container name. The container can be data set, directory, or generic artifact group. Java regular expression matching is used if the filter starts and ends with a forward slash (/). For example, specify /.*LOAD/ to match any text that ends with LOAD. If the filter is not a regular expression, exact matching is used." />
            </property>
            <property name="datasetName" required="false">
                <property-ui type="textBox" label="Target Data Set Name Filter"
                    default-value="" description="Specify a filter to use on the target data set name. Java regular expression matching is used if the filter starts and ends with a forward slash (/). For example, specify /.*LOAD/ to match any text that ends with LOAD. If the filter is not a regular expression, exact matching is used." />
            </property>
            <property name="memberName" required="false">
                <property-ui type="textBox" label="Resource Name Filter"
                    default-value="" description="Specify a filter to use on the resource name. The resource can be data set member, file, or generic artifact. Java regular expression matching is used if the filter starts and ends with a forward slash (/). For example, specify /.*LOAD/ to match any text that ends with LOAD. If the filter is not a regular expression, exact matching is used." />
            </property>
            <property name="deployTypeName" required="false">
                <property-ui type="textBox" label="Deploy Type Filter"
                    default-value="" description="Specify a filter to use on the deploy type. Java regular expression matching is used if the filter starts and ends with a forward slash (/). For example, specify /.*LOAD/ to match any text that ends with LOAD. If the filter is not a regular expression, exact matching is used." />
            </property>
            <property name="custProperties" required="false">
                <property-ui type="textAreaBox" label="Custom Properties Filter"
                    default-value="" description="Specify a list of custom properties filters, separated by newline characters. Use the following format: propertyName=valueFilter. A property without valueFilter selects all artifacts that have that property. Java regular expression matching is used if the filter starts and ends with a forward slash (/). For example, specify developer=/M.*/ to match artifacts with a developer property where the value of the property starts with M.
If valueFilter is not a regular expression, exact matching is used. For example, developer=Martin matches artifacts where the value of the developer property is Martin." />
            </property>

            <property name="templateText" required="true">
                <property-ui type="textAreaBox"
                    description="Specify the template to use to generate text.
                    The text output property contains the generated text from this step.
                    Subsequent steps can access this text with the${p:stepName/text} property.
                    Add separators, including line breaks, in the template as needed.
                    Use ${propname} to access custom properties.
                    The following built-in properties are available:
                    ${sourceDataset} for the source dataset name.
                    ${dataset} for the target dataset name.
                    ${member} for the member name.
                    ${deployType} for the deployment type.
                    ${artifactGroup} for the generic artifact group name.
                    ${artifact} for the generic artifact name.
                    ${directory} for the directory name.
                    ${file} for the file name.
                    ${inputsUrl} for the url of the inputs.
                    All property names are case-sensitive. Do not use the built-in names for custom properties."
                    label="Template" default-value="${dataset}(${member})," />
            </property>
            <property name="failOnEmpty" >
                <property-ui type="checkBox" label="Fail On Empty"
                    default-value="false" description="Select to set the step to fail if no text is generated." />
            </property>
            <property name="ignoreUnresolved">
                <property-ui default-value="false" description="Check this box to ignore unresolved properties in the template. On Default(unchecked) this step will fail if any unresolved properties are found." label="Ignore unresolved properties" type="checkBox"/>
            </property>

            <property name="deployBasePath">
                <property-ui default-value="${BUZ_DEPLOY_BASE}" description="The base location to store deployment results and backups for rollback. " hidden="true" label="Deployment Base Path" type="textBox"/>
            </property>
            <property name="versionName">
                <property-ui default-value="${p:version.name}" hidden="true" label="Version Name" type="textBox"/>
            </property>
            <property name="componentName">
                <property-ui default-value="${p:component.name}" hidden="true" label="Component Name" type="textBox"/>
            </property>
            <property name="resourceId" required="true">
                <property-ui default-value="${p:resource.id}" hidden="true" label="Resource Id" type="textBox"/>
            </property>
      </properties>

      <post-processing>
        <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
      </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp"/>
            <arg path="${PLUGIN_HOME}/zos-deploy.jar:${PLUGIN_HOME}/lib/*"/>
            <arg value="com.urbancode.air.plugin.Main"/>
            <arg value="GenerateVersionArtifactInfo"/>
            <arg file="${PLUGIN_INPUT_PROPS}"/>
            <arg file="${PLUGIN_OUTPUT_PROPS}"/>
        </command>

    </step-type>

    <!-- ==================================== -->
    <!-- Run MVS Commands                        -->
    <!-- ==================================== -->
    <step-type name="Run MVS Command">
        <description>Run MVS system commands.</description>
        <properties>
            <property name="mvsCommand" required="true">
                <property-ui type="textAreaBox"
                    description="Specify a list, separated by newline characters, of MVS system commands to run."
                    label="MVS Commands" default-value="" />
            </property>
            <property name="stopOnFail" >
                <property-ui type="checkBox" label="Stop On Fail"
                    default-value="true" description="Select to stop running commands after a command fails." />
            </property>
            <property name="failMessage" >
                <property-ui type="textAreaBox" label="Fail Message"
                    default-value="IEE298I&#10;IEE305I&#10;IEE306I&#10;IEE307I&#10;IEE309I&#10;IEE310I&#10;IEE311I&#10;IEE312I&#10;ISF032I"
                    description="Specify messages that indicate command failure. The step fails if any of these messages are in the system responses. Separate multiple messages with newline characters." />
            </property>
            <property name="sdsfJarFile" required="true">
                <property-ui type="textBox" label="SDSF Jar File" hidden="true"
                    default-value="/usr/include/java_classes/isfjcall.jar" description="Specify the full path to the SDSF JAR file." />
            </property>
            <property name="sdsfLibraryPath" required="true">
                <property-ui type="textBox" label="SDSF Native Library Path" hidden="true"
                    default-value="/usr/lib/java_runtime64" description="Specify the path to the SDSF native library.
There is one library for 31-bit Java and one for 64-bit Java. You must specify the path of the appropriate
library based on the version of Java that you are running." />
            </property>
        </properties>
        <post-processing>
        <![CDATA[
          if (properties.get("exitCode") != 0) {
              properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
          }
          else {
              properties.put("Status", "Success");
          }
       ]]>
        </post-processing>

        <command program="${PLUGIN_HOME}/runjava.sh">
            <arg value="-cp" />
            <arg path="classes:${sdsfJarFile}:lib/securedata.jar:lib/jettison-1.1.jar:lib/commons-codec.jar:lib/CommonsUtil.jar:${GROOVY_HOME}/lib/*" />
            <arg value="mvs" />
            <arg file="${PLUGIN_INPUT_PROPS}" />
            <arg file="${PLUGIN_OUTPUT_PROPS}" />
        </command>
    </step-type>
</plugin>
