Automic Workload Automation

 View Only
  • 1.  XML VARA with PromptSet

    Posted Jul 05, 2018 10:36 AM

    Hi,

     

    I am trying to use VARA_XML in PromptSet. The XML is:

     

        <BOOK>
            <name>Learning_Java</name>
            <author>James_Clark</author>

            <author>Ken_Follett</author>
            <author>Steven_King</author>
        </BOOK>
        <BOOK>
            <name>7_Habits</name>
            <author>Steven_Covey</author>
        </BOOK>

    and I have a PRPT with two fields:

    1- ComboBox to list all books. so the XPath/XQuery for it is book/name and it lists all books and it assigns the result to &BOOK#

    2- Checkbox to show all authors of a book. the XPath/XQuery for it is book/author[name=&BOOK#] but this doesn't work even if I replace &BOOK# with static value like  "7_Habits". I also tried to use ' and " around &BOOK# but I got the same result, no data returned.

     

    Can any body help with that?

     

    Thanks

    Hesham



  • 2.  RE: XML VARA with PromptSet
    Best Answer

    Posted Jul 04, 2019 12:17 PM

    Dear Hesham,

    my Answer is a little late, I came across your question when I was having exact the same issue.

    Here is my solution:
    I needed a promptset for running a database script on various databases with various users. UserA1 and UserA2 can be used on Database DBA, UserB1, UserB2 and UserB3 can be used on Database DBB.
    This is my xml, stored in a XML Vara under Key DBKEY:
    <datenbanken>
      <datenbank name="DBA">
          <dbagent>UNIX.DBA_AGENT</dbagent>
          <username>UserA1</username>
          <username>UserA2</username>
      </datenbank>
      <datenbank name="DBB">
          <dbagent>UNIX.DBB_AGENT</dbagent>
          <username>UserB1</username>
          <username>UserB2</username>
          <username>UserB3</username>
      </datenbank>
    </datenbanken>

    In my prompt set the database is referenced in the first field with Key DBKEY and XPath:

    //datenbanken/datenbank/@name

    In the second field of my prompt set the login username is referenced with Key DBKEY and XPath:

    //datenbanken/datenbank[@name="&DATENBANK#"]/username

    &DATENBANK# is the variable filled y the first field in the prompt set.

    Then, you just need to adjust in the prompt set fields:
    select for the first field: On change reset for the second field.
    select for the second field: dynamic reload

    That's it. The difficulty is to find out the exact Xpath or Xquery for your xml.



    ------------------------------
    Regards, Nicole
    ------------------------------