Topic
5 replies Latest Post - ‏2013-10-11T07:42:25Z by naga1990
naga1990
naga1990
21 Posts
ACCEPTED ANSWER

Pinned topic Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

‏2013-10-09T15:41:33Z |

Hi,

 

I am unable to use MXApplicationYesNoCancelException with scripting in maximo.

I am pasting my below code in Jython

==================================================================

from java.rmi import RemoteException
from psdi.util  import MXException
from psdi.mbo  import MboValue
from psdi.mbo  import MboValueAdapter
from psdi.server  import MXServer
from psdi.util  import MXMath
from psdi.util  import MXApplicationException
from psdi.util.logging  import MXLogger
from psdi.server  import MXServer
from psdi.security  import UserInfo
from java.util  import Date
from psdi.util  import MXApplicationYesNoCancelException


optionsTable = MXApplicationYesNoCancelException.getUserInput("5235", MXServer.getMXServer(), mbo.getUserInfo())

 

if optionsTable == -1:
 raise MXApplicationYesNoCancelException("5235", "PORECEIPT", "PORECEIPT")
 
elif optionsTable == 8:
 errorkey='TEST1'
 errorgroup='TEST1'

else:
 errorkey='TEST2'
 errorgroup='TEST2'

 

==================================================================

 

The above code throws the error "BMXAA7837E - An error occured that prevented the script to run"

 

I wrote the code in javascript also. It too throws me error. i am pasting the code below

 

==============================================================

 

importClass(Packages.java.rmi.RemoteException);
importClass(Packages.psdi.util.MXException);
importClass(Packages.psdi.mbo.MboValue);
importClass(Packages.psdi.mbo.MboValueAdapter);
importClass(Packages.psdi.server.MXServer);
importClass(Packages.psdi.util.MXMath);
importClass(Packages.psdi.util.MXApplicationException);
importClass(Packages.psdi.util.logging.MXLogger);
importClass(Packages.psdi.server.MXServer);
importClass(Packages.psdi.security.UserInfo);
importClass(Packages.psdi.util.MXApplicationYesNoCancelException);


var userInput= MXApplicationYesNoCancelException.getUserInput("5235", MXServer.getMXServer(), mbo.getUserInfo());
switch(userInput)
{
case -1:
throw new MXApplicationYesNoCancelException("5235", "PORECEIPT", "PORECEIPT");
 

case 8:
errorkey='TEST1';
errorgroup='TEST1';

case 16:
 

errorkey='TEST2';
errorgroup='TEST2';
}

 

==========================================================

 

Please help me to solve this issue. Is it possible to raise a "yesnocancelexception" with scripts

  • bgbaird
    bgbaird
    212 Posts
    ACCEPTED ANSWER

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2013-10-09T16:07:15Z  in response to naga1990

    Hi, This is an ongoing issue, and there is an RFE submitted already.  Here is a link to one of the threads already up:

     

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014916084

     

    Brian

    • naga1990
      naga1990
      21 Posts
      ACCEPTED ANSWER

      Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

      ‏2013-10-09T16:16:28Z  in response to bgbaird

      Hi ,

       

      http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=18101 , tells that, the enhancement wont be released in any near time. Its status shows as REJECTED. Wont there be any fix pack provided for this problem in any near time ?

       

      Awaiting your answer

       

      Thanks

      • SASHULL
        SASHULL
        249 Posts
        ACCEPTED ANSWER

        Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

        ‏2013-10-09T17:42:32Z  in response to naga1990

        Naga,

        Neither Brian nor I work for IBM (though even if we did we wouldn't be able to publicly say when it is expected to be available) but I would be shocked to find this in a traditional fix pack (IE 7506). The reason is that this is a limitation of the current design of Automation Scripts and major changes to functionality are often found in major releases (IE Maximo "8").

        I have spoken with the Automation Script Development team in the past and I know this is something that has been requested frequently and they were looking into it the last time I checked (though this was in May so it may have been determined to be too difficult to implement since the RFE was rejected in July). If you have anything time sensitive I would not hold my breath and wait for this functionality but I do strongly expect at some point this will be enabled in a release down the road (hopefully the next major release).

      • naga1990
        naga1990
        21 Posts
        ACCEPTED ANSWER

        Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

        ‏2013-10-11T07:42:01Z  in response to naga1990

        Thanks sashull

    • naga1990
      naga1990
      21 Posts
      ACCEPTED ANSWER

      Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

      ‏2013-10-11T07:42:25Z  in response to bgbaird

      Thanks Brian