AppWorx, Dollar Universe and Sysload Community

 View Only
  • 1.  Read vara values from JAVA API?

    Posted Nov 05, 2019 09:53 AM
    Hi,

    I just want to know by using java API can we read an VARA in Automic Engine UC4 and print those values in a txt file or excel sheet..

    Thanks in advance :)

    Looking forward for the reply.


    Thanks & Regards,
    Abhi


  • 2.  RE: Read vara values from JAVA API?
    Best Answer

    Posted Nov 06, 2019 10:53 AM
    Hi,

    if you want to use the Java API to read a VARA and write its contents into a text file you can do this within a Java Programm - for this look at the API reference (https://docs.automic.com/documentation/webhelp/english/AWA/12.2/AE/12.2/API/index.html) you will need to use the following requests:
    • OpenObject to open the VARA Object 
      • Then cast the UC4Object you receive from the OpenObject Request (after the request call getUC4Object() on the request instance) to a Variable object
    • The Variable object provides getter for all the properties and you can write the data into a txt file
    • then call CloseObject - because otherwise the objects stays open and locked by the user used to read it

    If you want to write the contents of a VARA into a txt file using Automic itself - you could do this either by calling
    and use a Unix or Windows Job to write the data into a file

    I hope this answers your question.

    Regards
    Stephan