Comparison Operator

Last post 05-28-2015, 10:40 AM by PJValdez. 2 replies.
Sort Posts: Previous Next
  • Comparison Operator
    Posted: 05-19-2015, 11:01 AM



    Seeing if anyone might have some input on this.  I'm writing an audit script to go through a list of servers and see if a specific Path is specified in its filters.

    here are my following steps

    -Query The Commserve

    -Run a foreach loop

    -Run a qoperation -af getsubclientproperty.xml (i.e. App_GetSubClientPropertiesRequest),

    -Pass it through Xpath Query to filter out for /App_GetSubClientPropertiesResponse/subClientProperties/content[1]/@path

    -**Where I get hung UP** Pass the Xpath Results to a Decision

      IF Xpath query contains Weekly, THEN add it to a list, and at the end of the foreach loop, email me the list of client names that do not contain the key word Weekly.



    Cool Trick: From what I was told Via Commvault, instead of using comparrison operators, you can use the .contains() method in java so it should look like this



    But whats funky, I'm not getting an actual object, more like a random string character

    12380 53952 05/19 06:58:35 7827259 WorkflowStep            : completing activity [XPathQuery (XPathQuery_1)] with status [COMPLETED], outputs [<XPathQuery_1><system><startTime>1432047515</startTime><status>RUNNING</status><timedOut>false</timedOut></system><result>X:\MSSQL\Backup\DB\*Weekly*</result></XPathQuery_1>]
    12380 53972 05/19 06:58:35 7827259 SetActivityInputs : starting activity [Decision (Decision_2)] with inputs [<inputs><expression>xpath:{/workflow/XPathQuery_1/result}.contains(Weekly)</expression></inputs>]
    12380 53972 05/19 06:58:35 7827259 JavaEvaluator : SEVERE: error executing beanshell script [v_7ae4557d_c535_424d_8935_09eca2045c85.contains(Weekly)]
    Sourced file: inline evaluation of: ``v_7ae4557d_c535_424d_8935_09eca2045c85.contains(Weekly);'' : Undefined argument: Weekly : at Line: 1 : in file: inline evaluation of: ``v_7ae4557d_c535_424d_8935_09eca2045c85.contains(Weekly);'' : ( Weekly )


    From the above output, the XPATH query is returning the Result with what I'm looking for, however moving on to the next step, the object changes to a random string character vs  the result set, has anyone ran into anything like this?

  • Re: Comparison Operator
    Posted: 05-27-2015, 7:31 AM

    This is not a random character. Its an instance of a string object, named by the WF engine.

    What you seem to have forgotten is to put quotes around the call to contains().

  • Re: Comparison Operator
    Posted: 05-28-2015, 10:40 AM

    Thanks Dannie, 


    that helped, but also I was setting the input to the foreach to the wrong array, so instead of reading the list as an array, it was also reading it as a complete string.  Switched that up and then re-added the "".  Works.

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