Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
8 replies Latest Post - ‏2014-03-31T15:55:34Z by ohmsrulz
SystemAdmin
SystemAdmin
5842 Posts
ACCEPTED ANSWER

Pinned topic Use of the "app" implicit" variable Automation Scripts

‏2013-02-23T16:40:48Z |
I have been using Automation Scripts for some time now in Maximo 7.5 but I am having problems using the "app" implicit variable within a script. What I am trying to do within an Object Launch Point script is identify the application that is calling the script. For instance I would like to be able to tell if the application is "WOTRACK" or if the application is another workorder object such as a clone of wotrack called "MOBILEWO".

When I use the "app" varible directly within the Automation Script the value is always equal to "None" (jython terminology for NULL). Has anyone successfully used the "app" implicit variable within an Automation Script to accomplish the specific application identification. If you have could you share the code syntax that you used. Also, if you have accomplished the specific application identification within a script some other way, other then using the implicit variable, I would be thrilled to hear that solution as well. Thank you in advance for any help you can provide in answering this question.
Updated on 2013-02-25T15:59:57Z at 2013-02-25T15:59:57Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    5842 Posts
    ACCEPTED ANSWER

    Re: Use of the "app" implicit" variable Automation Scripts

    ‏2013-02-25T01:07:52Z  in response to SystemAdmin
    Here is an update to my issue. Apparently the "app" implicit variable works in other Automation Scripts but not in my paticular instance. If I create an Object Launch Point that is set to fire on updates to existing records the "app" implicit variable will contain the correct Maximo Application where the update occurs. However in my case I have an Object Launch Point that fires on adding new records and in this case the "app" implicit variable is null. I am hoping that there is a way within the Automation Script to determine the Maximo application that called the script.
    • agrippa
      agrippa
      25 Posts
      ACCEPTED ANSWER

      Re: Use of the "app" implicit" variable Automation Scripts

      ‏2013-02-25T15:28:02Z  in response to SystemAdmin
      What base services fix pack are you running?

      When you say its an object launch point executing against "insert", can you confirm you have checked the Add check box in the launch point windows?

      If you also set up launch point for an "update" and check the app variable does it still remain null?

      I am wondering if the value for "app" can't be initialized until later in the MBO initialization / usage sequence.
      • SystemAdmin
        SystemAdmin
        5842 Posts
        ACCEPTED ANSWER

        Re: Use of the "app" implicit" variable Automation Scripts

        ‏2013-02-25T15:59:57Z  in response to agrippa
        We are using:

        IBM Maximo Asset Management 7.5.0.3 Build 20120713-1120 DB Build V7503-01
        Tivoli's process automation engine 7.5.0.3-IFIX20121008-0739 Build 20120713-1120 DB Build V7503-157

        Yes I can confirm that the Add check box is selected for this Object Launch Point Automation script and that this is the only selection (Initialize, Update, and Delete are unchecked).

        When I tested using an Object Launch Point with only the Update check box selected the "app" implicit variable did contain the application name.

        I have tried obtaining the value within the "app" implicit variable at different lines in the code (such as after a mbo.setValue() operation) and the value remains null.

        Jim
  • scottsd
    scottsd
    121 Posts
    ACCEPTED ANSWER

    Re: Use of the "app" implicit" variable Automation Scripts

    ‏2013-02-25T15:18:45Z  in response to SystemAdmin
    Interesting, I'd open a PMR on this it sounds like a bug.

    Try mbo.getThisMboSet().getApp() as a workaround.

    Thanks,
    Scott
    • SystemAdmin
      SystemAdmin
      5842 Posts
      ACCEPTED ANSWER

      Re: Use of the "app" implicit" variable Automation Scripts

      ‏2013-02-25T15:49:24Z  in response to scottsd
      Hi Scott,

      Thank you for the reply. Yes, I tried the "mbo.getThisMboSet().getApp()" workaround and unfortunately this is also returning an empty string. A PMR may be necessary since this capability within an Automation Scripts is extremely important.

      Jim
      • Sammy Cabrera
        Sammy Cabrera
        9 Posts
        ACCEPTED ANSWER

        Re: Use of the "app" implicit" variable Automation Scripts

        ‏2013-05-24T20:16:31Z  in response to SystemAdmin

        I have the same problem with implicit variable interactive, these variables are very useful. The workaround mbo.getThisMboSet().getApp() don´t work.

        • FSayeedi
          FSayeedi
          1 Post
          ACCEPTED ANSWER

          Re: Use of the "app" implicit" variable Automation Scripts

          ‏2013-05-25T04:21:26Z  in response to Sammy Cabrera

          As I have experienced, app works with main object only (on which App is defined). If you are dealing with any Child object then try using 

          mbo.getOwner().getThisMboSet().getApp().

          For getting app name you would have to reach main Parent object on which application is defined in case of hierarchy of more than one level.

          • ohmsrulz
            ohmsrulz
            1 Post
            ACCEPTED ANSWER

            Re: Use of the "app" implicit" variable Automation Scripts

            ‏2014-03-31T15:55:34Z  in response to FSayeedi

            This is an old thread, but I found that using mbo.getThisMboSet().getParentApp() worked for me to get the application the script was running on. Hope this helps someone else.