Automic Workload Automation

Expand all | Collapse all

Rename the Include object

Anon Anon

Anon AnonMay 07, 2014 10:03 AM

  • 1.  Rename the Include object

    Posted May 05, 2014 03:57 PM
    I renamed one of the include object that was being referenced in some of the unix jobs post process tab.All of them reside in the same folder.But the jobs don't show the renamed object name ,instead the old name is still seen and no longer available.

    Error message is below:
    UC4 Version 9.00A402-991
    =============================
    Error: U4006508 Could not find the object. It may have been deleted or renamed.


    OK 

    How can I make sure to reflect the global objects changes in all the objects that refer them.

     



  • 2.  Rename the Include object

    Posted May 05, 2014 05:42 PM

    Assuming that you renamed it using the Explorer, how did you respond to this pop-up message?

    qav6uu6usoq4.pnghttps://us.v-cdn.net/5019921/uploads/editor/61/qav6uu6usoq4.png" width="560">



  • 3.  Rename the Include object

    Posted May 06, 2014 08:36 AM

    Hi Pratima,


    >But the jobs don't show the renamed object name ,instead the old name is still seen and no longer available.


    Unfortunately that's the build-in behaviour  :\

    Before you start to rename INC objekts you should search for the usage and adopt the corresponding matches manually.


    Peter




  • 4.  Rename the Include object

    Posted May 06, 2014 09:37 AM
    Ok thank you. Unfortunately I never received a prompt to overwrite the name for all the objects that use the include object.

     



  • 5.  Rename the Include object

    Posted May 06, 2014 10:51 AM

    I'm on V8, I have never, to my recollection, not received that pop-up when renaming an object that is used in other objects.

    Peter, are you saying that this is no longer the case?

    The example in my first reply is a rename of an Include object.



  • 6.  Rename the Include object

    Posted May 06, 2014 11:59 AM

     

    I'm on V9 and I always receive that pop-up when renaming an include.  And as the pop-up states; "The object name is not automatically replaced...".   You have to fix them manually.  So it would also be easy for someone to get these pop-ups and to wrongly assume that it auto-corrects when it doesn't.



  • 7.  Rename the Include object

    Posted May 06, 2014 12:21 PM

    :INC objects are normally defined within a Script Tab. The 'Replace' functionality applies to where Objects are defined in a Parameter. Since the scripts are essentially stored as a giant String, the Replace functionality can't do a easy 'find and replace'. 

    Whereas, if it's say a Login Object, it's able to find where the Login Object is defined as a parameter and replace that value.



  • 8.  Rename the Include object

    Posted May 06, 2014 03:09 PM

    The  purpose of Object oriented approach is also to be able to reflect the changes done.I won't be able to use the :INC object as a template for new jobs creation  if I have to manually update each one of them if we rename the INC object.



  • 9.  Rename the Include object

    Posted May 06, 2014 03:49 PM

    We resist renaming objects for many reasons and this issue is one of them.  Choose wisely!!  ;)

    We have in excess of 150,000 objects and use Includes in virtually all of them and haven't found this restriction to be much of an impediment, just an annoyance.

    When we are faced with a mass rename, our approach is to perform a "Search for use" with "Include Script" checked.   We then Export the needed objects, use the appropriate utility or text editor to change the name and then Import the modified objects.  For us this has been relatively painless and takes little effort.




  • 10.  Rename the Include object

    Posted May 07, 2014 10:03 AM

    Thank you Mark.



  • 11.  Rename the Include object

    Posted May 13, 2014 10:56 AM

    One option is to put the name of the JOBI object in an object variable in the job or script’s Variables & Prompts tab, and include the JOBI by referencing the name of the variable that contains the JOBI name. E.g.,

     :INC &MY_JOBI# 

    You will then be able to change the reference to the JOBI automatically when you change the JOBI’s name. This approach makes the script a bit harder to read, but it might be worth it.

    Update 2017.04.26: Variables arenotresolved in :INCLUDE statements. I opened an enhancement request for this:

    Allow variables in :INCLUDE statements 

     

    If you like the idea, please vote for it.



  • 12.  Rename the Include object

    Posted May 13, 2014 11:30 AM

    Michael:

    On V8, the documentation states:  

    Enter the complete name of the Include object. Script variables are not allowed. 
     
    While it allows the object to be saved, execution results in:

    Error: U0010003 Object: 'THE_OBJECT': Include '&THE_INC' not found in object
    'THE_OBJECT(1)'.

    Are you (hopefully) saying that this actually works in later versions?  Please say that it is true since I have always had a desire to do this.



  • 13.  Rename the Include object

    Posted May 14, 2014 01:31 AM

     

    Mark Hadler said:

    Michael:

    On V8, the documentation states:  

    Enter the complete name of the Include object. Script variables are not allowed. 
     
    While it allows the object to be saved, execution results in:

    Error: U0010003 Object: 'THE_OBJECT': Include '&THE_INC' not found in object
    'THE_OBJECT(1)'.

    Are you (hopefully) saying that this actually works in later versions?  Please say that it is true since I have always had a desire to do this.

    Hi Mark,


    this is still not possible (v10 SP2). The AE takes the characters after the :INC statements as a "real" object name. Replacing a script variable by its content is not implemented here.

    To make this possible I guess the script interpreter has to be changed ...



  • 14.  Rename the Include object

    Posted May 14, 2014 10:27 AM

    Thanks Peter.  

    Too bad, I'd really like to be able to selectively chose the INC at generation.   As it sits now, I am forced to do something like the following. It's not terrible, but not too elegant either.

    :IF &something EQ "whatever"
    : INC this
    :ELSE
    : INC that
    : ENDIF




  • 15.  Rename the Include object

    Posted May 15, 2014 07:43 AM

    since v9 you can also use SWITCH to avoid nested IFs:

    :set &INCNAME# = 'something'

    :switch &INCNAME#
    :case 'test'
    : inc JOBI.TEST

    :case 'prod'
    : inc JOBI.PROD
    :other
    : print 'Invalid INC name specified'
    :endswitch