Automic Workload Automation

Expand all | Collapse all

Can Include script statement resolve variables dynamically

  • 1.  Can Include script statement resolve variables dynamically

    Posted Jun 27, 2018 01:42 PM

    Hello Team,

     

    We would like to include scripts dynamically in a job by using object variables. Is that possible. Please look at the following line of code present in process tab of a job.

     

    :INC &TEST#

     

    The value of &TEST# is defined in variables and prompts page to "JOBI.NEW.1". 

     

    So when I run the job, I got the following error.

    Include '&TEST#' not found in object 'JOBS.UNIX.NEW.2', line '00005'.

     

    Thanks,

    Srujan



  • 2.  Re: Can Include script statement resolve variables dynamically
    Best Answer

    Posted Jun 28, 2018 11:29 AM

    This capability does not exist in the current version of the Automation Engine. However, it has been requested. If you like the idea, please vote for it!

    Allow variables in :INCLUDE statements 



  • 3.  Re: Can Include script statement resolve variables dynamically

    Posted Jun 28, 2018 02:54 PM

    Oh, I wish this would have already been allowed as I found this is really helpful. Anyways, I have voted up your idea and I am eagerly waiting for its implementation in the coming releases.

     

    Thanks,

    Srujan.



  • 4.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 01, 2018 09:17 AM

    Understanding the processing of script in the Automation Engine, it's clear that this is not working. First includes have to get part of whole script and than script variables can be processed. I would say make sense and it's very similar to some programming languages as ABAP, ... where includes also can not be addressed dynamically.  



  • 5.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 01, 2018 10:11 AM

    It’s clear that adding this capability would significantly change the way AE scripts are evaluated. In particular, using this capability would probably require that the generate at runtime option be enabled.



  • 6.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 01, 2018 04:40 PM

    Hi Michael,

     

    I know and I see the big plus having this but I'm knowing too, that this might be a lot of effort for existing customers who use script and cant use generate at run time for each object might be effected. That's a big comparability topic I have concerns because of business critical workload could be effected. It's nothing against the idea, wish, input  
    It's fact we have customers with thousands of objects and a lot line of script used in these over a long time.

     

    Best,
    Franz 



  • 7.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 01, 2018 06:56 PM

    Backward compatibility won’t be a problem if it is implemented like this:

     

    If an :INCLUDE statement contains a variable: 

    • If Generate at run time is disabled, the execution fails with error U00010002, just as it does today in v12.x;
    • If Generate at run time is enabled, the variable is resolved during generation of the script.


  • 8.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 06, 2018 09:05 AM

    There is one possibilty: If you put an include with a variable in his name in an include you can achieve it.



  • 9.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 06, 2018 09:37 AM

    Hi ,

     

    I tried your solution but it still didn't resolve the string value dynamically.Please find the attached export files. Did you mean $string or &String in your script? I tried both but didn't work.Also could you please show the script inside JOBI.OUTER.

     

    Thanks,

    Srujan.

    Attachment(s)

    zip
    jobi.inner.xml.zip   436 B 1 version
    zip
    jobi.outer.xml.zip   430 B 1 version
    zip
    unix.job.xml.zip   1 KB 1 version


  • 10.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 06, 2018 09:56 AM

    Your example does not work if you replace "INNER" with "&STRING#" and set the value of this variable earlier in the script.



  • 11.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 06, 2018 12:12 PM

    Sorry, I do not know why it should not work. I tried it by myself and it worked (as you can see in the screenshot)...

    I will check it on monday.



  • 12.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 06, 2018 12:35 PM

    No problem, please try it on Monday.

     

    Thanks,

    Srujan.



  • 13.  Re: Can Include script statement resolve variables dynamically

    Posted Jul 06, 2018 01:00 PM

    Your example did not use a script variable.