Remapping input values using "On Startup" scripts

Last post 11-19-2015, 8:50 PM by default. 2 replies.
Sort Posts: Previous Next
  • Remapping input values using "On Startup" scripts
    Posted: 11-17-2015, 7:49 PM


    Been bashing my head against this for a while and hoped someone might have an answer for what I'm missing.

    I'd like to be able to use the "on Startup" script feature to remap values in an activity.

    For example, the dataAgent and backupType fields being passed from the Alert side are in plain english, rather than in a form that can be used by the "Start Backup" activity.



    Windows File System => Q_FILESYSTEM

    Full => Q_FULL


    It seems this subsitution should be easily achieved with a switch statement;


    switch (xpath:{/workflow/inputs/dataAgent){

      case "Windows File System":

        xpath:{/workflow/inputs/dataAgent = "Q_FILESYSTEM";



    But I can't for the life of me get this working.

    Has anyone had any luck with this kind of remapping of values?


  • Re: Remapping input values using "On Startup" scripts
    Posted: 11-18-2015, 7:46 AM

    You'll need to use workflow.setInput(inputName, value) in Script to do this:

    switch (xpath:{/workflow/inputs/dataAgent}) {
    case "Windows File System":
    workflow.setInput("dataAgent", "Q_FILESYSTEM");
    Also you can use the AssignVariables activity here and use the java:{}:java script tags to dynamically return a value:
    So with this example, you can enter the following script in the dataAgent value in the Workflow Inputs tab of the AssignValues activity:
    switch (xpath:{/workflow/inputs/dataAgent}) {
    case "Windows File System":
    return "Q_FILESYSTEM";

  • Re: Remapping input values using "On Startup" scripts
    Posted: 11-19-2015, 8:50 PM

    Exactly what I was chasing.

    Thanks so much for this!

    Do you happen to know of a Java lanaguage reference for Commvault workflows?

    I couldn't find any API information anywhere in the documentation.

    It'd be great to have a shared refernce of this kind of code for future efforts.


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