Automic Workload Automation

  • 1.  Searching for AE objects

    Posted Feb 24, 2017 05:44 AM
    My request is about how can I search for AE objects like, Jobs, Logins,  Users, Groups, Workflows, etc. with the AE Script language, like in the  UI. I what to use search patterns like:
    - RM.*
    - type=User
    - type=Folder AND DOTNET_*

    As return value it would be great to have the object itself otherwise it would be ok to have the name of the object.

    There is a JavaAPI Class "SearchObject" that should perform this task, but I don't think there is a script command / function that would allow you to do this.

    You may also use a VARA.SQLI and couple it with a SCRI to define the search parameters.

    Here is a short example:

    SCRI.SEARCH.PARAM

    :BEGINREAD
    :READ &NAME#,,"Name"
    :READ &TYPE#,"'CALE','CALL','CITC','CLNT','CODE','CONN','CPIT','DASH','DOCU','EVNT','FILTER','FOLD','HOST','HOSTG','HSTA','JOBF','JOBG','JOBI','JOBP','JOBQ','JOBS','JSCH','LOCA','LOGIN','LSYNC','PERIOD','PRPT','QUEUE','RCON','RESX','RSYS','SCRI','SERV','STORE','SYNC','TZ','USER','USRG','VARA','XREQ','XSL'","Type"
    :ENDREAD

    :SET &HND# = PREP_PROCESS_VAR(VARA.SQLI.SEARCH)
    :PROCESS &HND#
    :  SET &RESULT# = GET_PROCESS_LINE(&HND#,1)
    :  P &RESULT#
    :ENDPROCESS


    VARA.SQLI.SEARCH

    SELECT OH_NAME
    FROM OH
    WHERE OH_Otype='&TYPE#'
    AND OH_Name LIKE '%&NAME#%'
    AND OH_Deleteflag='0'


    Of course it can be enhanced - it does not allow you to specify the client or select all object types - but it was just to give you guidelines on how this could be achieved.

    Best regards,
    Antoine



  • 2.  Searching for AE objects

    Posted Feb 24, 2017 11:55 AM
    Do I understand that correctly, that I have to define a VARA with type SQL. There I define a CONNECTION object which points to the AE database. And then I run a query against the database tables of AE, right?

    The Automation Engine has an object type called 'VARA.SQLI' - SQL Internal. This allows you to query directly the AE database without creating a connection object.

    To be able to create a VARA.SQLI, you will have to:

    * set the key SQLVAR_INTERNAL to 'YES' in UC_SYSTEM_SETTINGS
    * ensure that the AE user has the "Create and modify SQL-Internal variables" privilege.

    Kind regards,
    Antoine