Automate workflow with variable parameters

Last post 08-09-2016, 3:17 AM by Noosrep. 8 replies.
Sort Posts: Previous Next
  • Automate workflow with variable parameters
    Posted: 08-05-2016, 9:50 AM

    First time user of workflows so it could be that I'm understanding some things wrong.

    The current situation:

    I've installed the software (Filesystem, filesystem core and Oracle) on a Unix client without any problems. I have created a new Oracle Instance and saved my settings as an xml. In my workflows, I have created a new activity with my generated xml and can execute the workflow so that it creates a new Oracle instance.

    The problem:

    Workflows are good for automating but there are still some settings I want to choose, for instance the SID name because it's possible that a database has a different name. However, my current workflow only works with the predefined settings because the SID name is hardcoded in the xml file.

    Is there a way I can import an xml with the correct settings and upload these to the workflow? I have looked in the qoperation command but I'm having troubles with that. To be clear I want as little as possible interaction from a user so an input screen where I need to fill in the SID for instance is not the way I want to go.

  • Re: Automate workflow with variable parameters
    Posted: 08-05-2016, 10:19 AM

    So your XML should be in the "inputXml" input.  Under "commandArgs" you would put the XML Tag and variable (pulled from a popup earlier possibly?) like such:


    I don't have your specific XML handy, so I'll give a general sample:

    XML Sample:






    commandArgs sample to specify "clientName" & "hostName":

    (Assuming you are setting the Inputs in the root of the workflow)

    -clientName xpath:{/workflow/inputs/ClientName} -hostName xpath:{/workflow/inputs/hostName}


    Note that if you have a value in the XML Sample tags, by specifying that tag in the commandArgs, the value in the commandArgs will overwrite the value in the XML.

  • Re: Automate workflow with variable parameters
    Posted: 08-05-2016, 10:29 AM

    This is my xml file (with the personal info added out ofcourse)

    When I open the properties of my newOracleInstance Activity, I see indeed the below xml in the tab XML Input. However I'm not completely following with the second part. Where do I need to put this commandArgs sample?

    I have noticed btw that there is a InstanceOracle Activity defined already and that has a lot of more info in the Inputs tab so maybe I can use that?

    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>

    <storagePolicyName>Default Plan Lib_1_Ret_30</storagePolicyName>
    <storagePolicyName>Default Plan Lib_1_Ret_30</storagePolicyName>
    <storagePolicyName>Default Plan Lib_1_Ret_30</storagePolicyName>
  • Re: Automate workflow with variable parameters
    Posted: 08-05-2016, 10:31 AM

    Noosrep, where do you want the values for the varaibles like SID to come from? you can either ask the user to enter it or perhaps its coming from some file? whichever way you want to go you can replace the names in the xml at run time using variables or inputs. you can look at some of the demo workflows for examples.

  • Re: Automate workflow with variable parameters
    Posted: 08-05-2016, 10:34 AM

    ameykarandikar, I don't want the user to enter it. I would like it to come from some file (generating the file is no problem) but I'm not sure how to import it or where to put it so the workflow can use it? It's a Unix system btw 

  • Re: Automate workflow with variable parameters
    Posted: 08-05-2016, 10:52 AM

    Create a workflow variable called SID of type string, Then use the Script activity under Utilities to write a small java piece of code to read the file and set the values to workflow variables. The pseudo code would be something like f = new"c:\input.txt")

    String SID = f.readline();


    Then in the Execute activity under Qcommands->Operation you paste your create oracle instance xml in the inputXML and for SID you can replace the value using the "Insert Variable" button and select the workflow variable SID. After this the xml snippet will look something like this:


  • Re: Automate workflow with variable parameters
    Posted: 08-08-2016, 9:43 AM


    I was trying something simpler and that was to install the oracle software on a client that was selected through a dropdown list. However, after I select the correct client, the job hangs with the message that not the right credentials are given. 

    The workflow works as follows: you get a drop down box (GetClient) where you can select any of the defined clients. The workflow then goes a self created activity called (OracleSoftware) which contains an xml file that is generated by running the install software manual and save it as a script.

    I added following code to the OracleSoftware activity which has as value xpath:{/workflow/PopupInput_1/Clients/clientName} where PopupInput_1 is the name of the dropdown menu. If I'm right, then this code should overwrite the default clientname in the saved XML no? 

    The workflow is attached as installOracleSoftware.txt

    The XML (that was saved as script) is attached as installOracleSoftwareXML.txt


  • Re: Automate workflow with variable parameters
    Posted: 08-08-2016, 11:41 AM

    Hi Noosrep, can you also attach the OracleSoftware activity and also paste a snippet of the error from the workflowEngine.log that shows this credential error?


  • Re: Automate workflow with variable parameters
    Posted: 08-09-2016, 3:17 AM

    Hi Chris,

    I don't see any credential error in the logfile but when I run the job, I still get the same error. I have tinkered some more with the code yesterday, so I'm going to attach the files again. TPRS_InstallOracleSoftware_v4 is the workflow, OracleSoftware is the activity and workFlowEngine is the log file.

    To be clear, right now the clientName in OracleSoftware activity is changed to pfffora but the clientName should be pfffora2 because that is selected through the dropdown list. I did this to be sure that the workflow functions correctly with the selected dropdown value.

The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Copyright © 2020 Commvault | All Rights Reserved. | Legal | Privacy Policy