Automic Workload Automation

  • 1.  How do I get the file name from a resource name when using :attach_:res ?

    Posted Dec 20, 2016 07:43 AM
    Hi all

    I am trying to use :attach_res in one of my jobs (AE V11.2.3) but I am not able to get the filename out of the resource name.

    according to docu:
    https://docs.automic.com/documentation/webhelp/english/ALL/components/AE/11/All%20Guides/help.htm#ucsaca.htm%3FTocPath%3DAutomation%2520Engine%2520Script%2520Guide%7COrdered%2520by%2520Function%7CScript%2520Structure%2520and%2520Processing%7C_____1

    In this example the above mentioned System variables for :ATTACH_RES are used to attach a .jar-file which then is started with Java:

    :ATTACH_RES "PCK.AUTOMIC_SIEBEL.PRV.STORE", "SIEBELTOOL.JAR", C
    JAVA -JAR "&$AGENT_RESOURCES_CLIENT#SIEBELTOOL.JAR" SIEBEL IMPORTBUSINESSOBJECT


    so I created a Storage object with 3 testfiles in it - 2 textfiles and a 7Zip commandline tool.

    le3xk5pylmv0.jpghttps://us.v-cdn.net/5019921/uploads/editor/xg/le3xk5pylmv0.jpg" width="687">

    trying to call the textfile text.txt i modified the docu example accordingly:

    :ATTACH_RES "STORE.7ZIP_TEST", "TEXT",C
    dir "&$AGENT_RESOURCES_CLIENT#TEXT"

    Unfortunately the resource "TEXT" is not resolved to text.txt and my job ends up with an err mesage that the file TEXT was not found.
    c:\>dir "C:\uc4\V112\agents\V112_WIN01\Resources\0001\TEXT"
    ....
    Datei nicht gefunden

    Any Idea what I am doung wrong ?

    The only difference I observe is the fact that my Resource name ist not equal to my file name....



  • 2.  How do I get the file name from a resource name when using :attach_:res ?

    Posted Dec 20, 2016 09:29 AM
    Hi FrankMuffke,

    I think only the :ATTACH_RES directive is able to understand the "NAME" of the stored item.You still need to use the actual name of your binary in the OS command (the 'dir' command in your case).

    Here is a clearer example (the one in the documentation is a bit confusing):

    xebeziu6elrr.jpghttps://us.v-cdn.net/5019921/uploads/editor/kl/xebeziu6elrr.jpg" width="754">

    with the storage object being defined as:

    l22zy1rmaest.jpghttps://us.v-cdn.net/5019921/uploads/editor/5s/l22zy1rmaest.jpg" width="1364">

    The "NAME" of the resource item ("UPDATE_BIN") is only used in the ATTACH_RES directive. The directive itself basically instructs the agent to download the corresponding binary in a local agent folder, at which point, said binary becomes locally available in the &$AGENT_RESOURCES_CLIENT# Folder.

    it then can be used with an OS command (a java command in my example).

    Now, a valid question would be "why need a NAME and also the File Name ("File upload")?

    I could be wrong but i think it is meant to allow the use of multiple versions of the same binary in a storage object without having to rely on other storage objects (see above: ANOTHER_ITEM and SOME_OTHER_ITEM both point to a binary of the same name but with different versions).

    i hope this makes more sense?






  • 3.  How do I get the file name from a resource name when using :attach_:res ?
    Best Answer

    Posted Dec 21, 2016 04:24 AM
    Hi FrankMuffke

    ATTACH_RES "STORE.7ZIP_TEST", "TEXT",C
    dir "&$AGENT_RESOURCES_CLIENT#text.txt"

    The above example works, the one in the documentation is not ideal because:

    The only difference I observe is the fact that my Resource name ist not equal to my file name....

    That way you need to guess if we are referring to the name of the resource or the name of the file...

    Cheers, Daniel


  • 4.  How do I get the file name from a resource name when using :attach_:res ?

    Posted Dec 21, 2016 04:48 AM
    Daniel_Trimmel_2011

    Thanks for clearification Daniel, I was afraid this (resolving Resource name) won´t work as exspected, a classical "Automic Solution" :-)