Topic
  • 8 replies
  • Latest Post - ‏2016-02-26T14:11:01Z by FreddoNJ
SystemAdmin
SystemAdmin
5842 Posts

Pinned topic Automation Scripts: explicit variables

‏2012-08-30T14:17:54Z |
I've recently started playing with Automation Scripts in Maximo 7.5.0.1 with the help of this IBM document:
http://www.ibm.com/developerworks/wikis/display/maximo/Customizing+Maximo+components+with+scripts

It lists a number of explicit variables like app, user, mbo, scriptName...
When trying these, a few are not recognised. For example, the line:
"print scriptName"
causes error message "name 'scriptName' is not defined in <script>"
while line:
"print user"
properly puts the username in the Maximo log.

The same error happens for variables scriptHome and mboname.

Does anyone have experience with using these variables ?

Thanks,
Jakob
Updated on 2012-12-14T06:44:02Z at 2012-12-14T06:44:02Z by Sujita
  • PJ3B_Venkata_Reddy
    PJ3B_Venkata_Reddy
    3 Posts

    Re: Automation Scripts: explicit variables

    ‏2012-09-04T08:34:57Z  
    Hi ,

    You need to write like below statements :
    print " script name = ", scriptName
    print " MBO Name = ",mboname

    Thanks
    Venkat
  • Bowser
    Bowser
    97 Posts

    Re: Automation Scripts: explicit variables

    ‏2012-09-04T14:36:41Z  
    These are "implicit" variables... they are always defined as documented when your script starts to execute. "Explicit" variables are the ones you define for your script and then bind when you configure Launch Points.

    Never use the implicit variables that have been included for backward compatibility. scriptHome was used in version 7.2.x of Tivoli Service Request Manager (TSRM), Tivoli Asset Management for IT (TAMIT) and the Tivoli Change and Configuration Management Database (CCMDB). The "scriptHome" implicit variable was replaced in Base Services 7.5 with "mbo".

    Hope that helps,
    Bowser.
  • SystemAdmin
    SystemAdmin
    5842 Posts

    Re: Automation Scripts: explicit variables

    ‏2012-09-04T15:21:12Z  
    • Bowser
    • ‏2012-09-04T14:36:41Z
    These are "implicit" variables... they are always defined as documented when your script starts to execute. "Explicit" variables are the ones you define for your script and then bind when you configure Launch Points.

    Never use the implicit variables that have been included for backward compatibility. scriptHome was used in version 7.2.x of Tivoli Service Request Manager (TSRM), Tivoli Asset Management for IT (TAMIT) and the Tivoli Change and Configuration Management Database (CCMDB). The "scriptHome" implicit variable was replaced in Base Services 7.5 with "mbo".

    Hope that helps,
    Bowser.
    OK, that's good to know.
    Thanks.
  • Sujita
    Sujita
    44 Posts

    Re: Automation Scripts: explicit variables

    ‏2012-12-14T06:44:02Z  
    Hi,

    If i give, print " MBO Name = ",mbo like this in the source code of the script in Maximo v7.5, when i am executing this i am getting error "NameError: name 'mbo' is not defined"
    Regards,
    Sujitha
  • anfield.leung
    anfield.leung
    9 Posts

    Re: Automation Scripts: explicit variables

    ‏2016-02-24T08:21:45Z  

    Hi, 

     

    I got similar issue, the  explicit variables like mbo failed to be recognized with error like "NameError: name 'mbo' is not defined". Where and how should I initiate it? 

  • SASHULL
    SASHULL
    398 Posts

    Re: Automation Scripts: explicit variables

    ‏2016-02-24T14:16:12Z  

    Hi, 

     

    I got similar issue, the  explicit variables like mbo failed to be recognized with error like "NameError: name 'mbo' is not defined". Where and how should I initiate it? 

    What version of Maximo are you using and what is your launch point on? There are additional launch points in 7.6 where mbo will not actually be defined but outside of those situations, that variable has always worked for us. As an example, there are now launch points for integration where you interact with a context and there are launch points like "Allow Object Creation" where you use the mboset variable instead (since you're trying to determine if new records can be added to the set, not working with an existing mbo).

  • anfield.leung
    anfield.leung
    9 Posts

    Re: Automation Scripts: explicit variables

    ‏2016-02-25T01:30:10Z  
    • SASHULL
    • ‏2016-02-24T14:16:12Z

    What version of Maximo are you using and what is your launch point on? There are additional launch points in 7.6 where mbo will not actually be defined but outside of those situations, that variable has always worked for us. As an example, there are now launch points for integration where you interact with a context and there are launch points like "Allow Object Creation" where you use the mboset variable instead (since you're trying to determine if new records can be added to the set, not working with an existing mbo).

    I am using version 7.5.1.1 and object launch point for SR and CONTRACT. Others implicit variables like app and user didn't work for me too having same error message. 

  • FreddoNJ
    FreddoNJ
    4 Posts

    Re: Automation Scripts: explicit variables

    ‏2016-02-26T14:11:01Z  

    Hi, 

     

    I got similar issue, the  explicit variables like mbo failed to be recognized with error like "NameError: name 'mbo' is not defined". Where and how should I initiate it? 

    >>print " MBO Name = ",mbo

    This should be, print " MBO Name = ",mboname

    or print " MBO Name = ", mbo.getName()

    I found app doesn't work if you are in a child table like POLINES.  In this case you need mbo.getThisMboSet().getParentApp() or mbo.getOwner().getThisMboSet().getApp().

    Using: Maximo 7.5.0.8, IBM TPAE Integration Framework 7.5.1.3

    Updated on 2016-02-29T15:58:40Z at 2016-02-29T15:58:40Z by FreddoNJ