Automic Workload Automation

Expand all | Collapse all

Adding process line into multiple objects

  • 1.  Adding process line into multiple objects

    Posted 11-07-2018 09:44 AM

    Hello everyone! We are building own reporting system in Automic, which works in a way, that every executable object has a line in process tab (:INC REPORT_ME).

     

    REPORT_ME object records job's name and other info into variable object.

     

    Reporting system works OK, however now we need to implement that process line into every single job. Is there any easy way, to mass update hundreds of jobs, to add this one line into process tab? It would be very time consuming to do it one by one.

     

    Thank you for any suggestions!

     

    PS. I know we can achieve that by exporting > editing > importing xml file, but xml file will not follow folder structure we are using.

     

    Thank you in advance for your help!



  • 2.  Re: Adding process line into multiple objects

    Posted 11-22-2018 05:00 PM

    You can use the HEADER includes to set this for all Job Objects. There is already some pre-defined includes in the HEADER include (look into client 0000 for details).

     

    You can set an include at different points in the pre-processing and processing of a job to do what you want.

     

    This is not available for toher objects even if this could be very helpful sometimes like in File Transfer or Workflow objects ....



  • 3.  Re: Adding process line into multiple objects

    Posted 11-26-2018 02:44 PM

    Thank you, but it does not solve our problem. There is HEADER include only for some job types. However, thanks anyway!



  • 4.  Re: Adding process line into multiple objects

    Posted 11-27-2018 05:01 AM

    My suggestion was based on your message :

     

    "Is there any easy way, to mass update hundreds of jobs"

     

    For me it was JOBS Objects that you wanted to update with your function.



  • 5.  Re: Adding process line into multiple objects

    Posted 11-26-2018 05:21 PM

    I am curious what the problem is?  Why do you want to capture this information into a variable?    If it is for the purpose of reporting failures, there are already some built in features in the product for doing so....



  • 6.  Re: Adding process line into multiple objects

    Posted 11-27-2018 04:18 AM

    We are building simple reporting system, which saves an object name and run count into the variable for every production day. We are then further processing the data. There is no similar report type in reporting facility, so we had to build our own solution. Folowing INC is implemented into the process of every object's we would like to report:

     

    :INC YYYYMMDDHHMMSS

    :SET &NAME# = GET_STATISTIC_DETAIL(,NAME)
    :SET &CURDAY# = &YYYYMMDD#

     

    :SET &EXEC# = GET_VAR(&CURDAY#, &NAME#)
    :IF &EXEC# = ""
    : SET &EXEC# = "0"
    :ENDIF
    :PRINT &EXEC#
    :SET &EXEC# = &EXEC#+1
    :SET &EXEC# = FORMAT(&EXEC#)

    :PUT_VAR &CURDAY#, &NAME#, &EXEC#
    :PRINT &NAME#, &CURDAY#, &EXEC#

     

    We create variable with name ie 20181127 with following (example) content:

     

    KEY VALUE

    JOBS.TEST.A 10

    JOBS.TEST.B 23

    JOBS.TEST.C 7

    ....etc

     

    Data in these variables can be further processed/exported, etc.



  • 7.  Re: Adding process line into multiple objects

    Posted 11-27-2018 04:54 AM

    Putting the statement in the HEADER JOBIs will not work because there are no such JOBIs for objects other than JOBS objects. If you want to include an AE scripting statement in all executable object types, including workflows, AE script, events, etc, the best way to accomplish this would be to edit the template objects for each object type in client 0. New objects created will have the statement. The downside of this is that users can remove the statement from their objects, and there is no way to prevent this while still giving them write access. Also, this affects only new objects, not existing ones.

     

    Actually XML is probably the most straightforward approach for making mass-updates. If you're using v11 or later, the XML file includes folder structure (in the FolderStruct element).



  • 8.  Re: Adding process line into multiple objects

    Posted 11-27-2018 05:11 AM

    But has templates can be overriden in an update or patch you need to keep a separate set of templates, have an UC_OBJECT_TEMPLATE variable set to use those deifferent templates and it doesn't update old definitions and allow people to remove those includes as Michael pointed.

     

    My suggestion in that case would be to use either the Report facility (ucyrepg.jar) to build an output file that you can use to generate your summary variable. Either use a simple SQL request on the AH & OH table to get your numbers and names in plain text. It can be done as an SQL Job (with post-processing or reuse of the report if saved as a file) Or you can also use an SQLI Vara with the same request if you have less than 20000 max. definitions to collect.

     

    This will not require a modification of any object and will be easy to maintain if you keep it basic. Plus it can be run from any client, like a technical client, and collect data from any single client if needed.



  • 9.  Re: Adding process line into multiple objects

    Posted 11-27-2018 05:28 AM

    Thank you all for your suggestions! I will try to build an SQL job for that, as Alain suggested.



  • 10.  Re: Adding process line into multiple objects

    Posted 11-27-2018 01:35 PM

    Seems to me this is a lot of work to collect metadata that UC4 is already collecting for you, and can be retrieved with SQL.  Here is my SQLServer solution that pulls run counts by day;

     

     

    select oh_name
    , convert(varchar(10),dateadd(hour, datediff(hour, getutcdate(), getdate()), ah_timestamp2),20) as run_date
    , count(*) as Count
    from oh, ah
    where oh_idnr = ah_oh_idnr
    and oh_name like '%desired.set.of.object.names%'
    and dateadd(hour, datediff(hour, getutcdate(), getdate()), ah_timestamp2) between '2018-11-26 00:00:00.000' and '2018-11-27 00:00:00.000'
    group by oh_name, convert(varchar(10),dateadd(hour, datediff(hour, getutcdate(), getdate()), ah_timestamp2),20)

     

     

    EDIT: 

    I see AlainMoisy suggested the SQL approach too.  Need to give credit for that!