AutoSys Workload Automation

  • 1.  How do you debug Javascript with WA DE?

    Posted Dec 19, 2018 06:29 PM

    I have a really simple question about Javascript in WA DE. Namely, how do I debug it? Is there a console function I can write to? Is there a real debugger available?

     

    I'm trying to write something that would emulate the SCHID processing of WA SE. I have most of it working, but am having an issue with a stupid string comparison and I can't see the results.



  • 2.  Re: How do you debug Javascript with WA DE?

    Broadcom Employee
    Posted Dec 21, 2018 05:13 AM

    Hi,

     

    You can use the 'print' as shown below in the javascript. 

    In windows , if you start server from console , you will see the messages printed there. For unix , you should see in stdout.txt file in the logs folder.

     

     

     

     

    print([expr ...])

    Evaluate and print expressions. Evaluates each expression, converts the result to a string, and prints it.

    Please refer the doc -

    Rhino shell | MDN 

     

    Hope it helps!

    Ravi Kiran



  • 3.  Re: How do you debug Javascript with WA DE?

    Posted Jan 02, 2019 12:49 PM

    This is useful to know.  Better than not having an option at all.  I have often wished the desktop client had the ability to debug JS or had a JS sandbox that with access to the DE specific functions.



  • 4.  Re: How do you debug Javascript with WA DE?

    Broadcom Employee
    Posted Jan 03, 2019 11:20 PM

    Thank you! Happy to know this information helped!



  • 5.  Re: How do you debug Javascript with WA DE?

    Posted Jan 29, 2019 05:30 PM

    As I just had cause to try this, I thought I'd follow up.  If you want to get a cleaner output to your console, it helps to print  a new line between variables with the \n escape character. For example:

    print(" \n \n");
    print("APPL._SDAY="+APPL._SDAY);
    print(" \n");
    print("I_THI01001="+APPL.I_THI01001);

     

    will output the following:

    APPL._SDAY=Tuesday
    I_TH101001=2


  • 6.  Re: How do you debug Javascript with WA DE?

    Posted Jan 30, 2019 12:01 PM

    This was useful to troubleshoot but not without hassle.  In order to start the server from a console and not a windows service it meant shutting down a High Availability environment (2 servers), starting one up through the console, troubleshoot the javascript, shut it down, then start up both servers using services to bring the the environment back again.

     

    Is there no easier way to see this output on Windows?