One Input Value to Three Variables

Last post 03-16-2020, 3:29 PM by Nick Laflamme. 6 replies.
Sort Posts: Previous Next
  • One Input Value to Three Variables
    Posted: 03-16-2020, 9:40 AM

    I'm writing a more complex workflow than I ever have before. Users will know which file server they're on from a pre-populated list. From that single choice, I need to populate at least three fields: client, subclient, and basepath to all files. 

    My instinctive method is to assocate each input value with a character string that has delimited values. Were I writing in, say, perl or REXX, breaking apart that delimited string is child's play. 

    Is there a canonical way in Workflows to parse a character string into values? 

    Is there a better way in Workflows to populate three or more variables based on one imput field?

    Is there a good language reference I should use for such questions? Someone said Java is similar, but looking at an 800 page O'Reilly manual on Learning Java, and scanning their four pages on OO methods to parse text, I'm hoping I misunderstood or misremembered that answer. 

    Help? Smile


  • Re: One Input Value to Three Variables
    Posted: 03-16-2020, 11:35 AM

    Maybe a long way, but a robust and working solution (using the row-id as an indirect index) :

    * I use a query in getBackupServers like :

    IF OBJECT_ID('dbo.ServerResults', 'U') IS NOT NULL
      DROP TABLE  dbo.ServerResults;
    select row_number() OVER (Order by type desc,server asc) AS rij
      , server+', gescand op '+lastscanned+' en is '+type+'-backupserver,' as label
    into dbo.ServerResults
    from dbo._Digi06_BackupServers

    * In the userinput 'ask_actie' , I use a string-field ask_server with

    possible labels  : xpath:{/workflow/getBackupServers/resultSets/row/col[@name="label"]}
    possible values: xpath:{/workflow/getBackupServers/resultSets/row/col[@name="rij"]}

    * I can use in a future query, with 1 parameter xpath:{/workflow/askActie/ask_server}

    select * from dbo.ServerResults where rij = ?


    Have fun and stay healthy!


  • Re: One Input Value to Three Variables
    Posted: 03-16-2020, 12:59 PM

    Are you saying you built a temporary table from the text inputs and then loaded variables with an SQL query? Am I reading that correctly? 

  • Re: One Input Value to Three Variables
    Posted: 03-16-2020, 1:04 PM

    not a temporary, but a permanent (because temporary tables don't survive over workflow-activities)

  • Re: One Input Value to Three Variables
    Posted: 03-16-2020, 1:10 PM

    I think the rest of my team would severely criticize me for creating unmaintainable code.

  • Re: One Input Value to Three Variables
    Posted: 03-16-2020, 1:26 PM
    But is works …
  • Re: One Input Value to Three Variables
    Posted: 03-16-2020, 3:29 PM

    Based on some ideas from Mark Gielen, I'm trying a combination of "text to results set" and "assign values" to accomplish what want. 

    I still have no idea if I found the canonical method or if i found Yet Another Reinvented Wheel. 

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