Topic
  • 8 replies
  • Latest Post - ‏2015-08-17T12:31:40Z by maximo_TND
naga1990
naga1990
21 Posts

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
    281 Posts
    ACCEPTED ANSWER

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2013-10-09T16:07:15Z  

    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

  • SASHULL
    SASHULL
    398 Posts
    ACCEPTED ANSWER

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2013-10-09T17:42:32Z  
    • naga1990
    • ‏2013-10-09T16:16:28Z

    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

    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).

  • bgbaird
    bgbaird
    281 Posts

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2013-10-09T16:07:15Z  

    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

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2013-10-09T16:16:28Z  
    • bgbaird
    • ‏2013-10-09T16:07:15Z

    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

    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
    398 Posts

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2013-10-09T17:42:32Z  
    • naga1990
    • ‏2013-10-09T16:16:28Z

    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

    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

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2013-10-11T07:42:01Z  
    • naga1990
    • ‏2013-10-09T16:16:28Z

    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

    Thanks sashull

  • naga1990
    naga1990
    21 Posts

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2013-10-11T07:42:25Z  
    • bgbaird
    • ‏2013-10-09T16:07:15Z

    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

    Thanks Brian

  • maximo_TND
    maximo_TND
    79 Posts

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2015-08-15T03:02:35Z  

    Hello All,

     

    I am also getting the same error which Naga1990 is getting in Maximo 7.5. Any idea when a fix will be released? Does anyone know if the issue has been fixed in MX7.6?

    I am also facing an issue for addWarning(W). My requirement was display a message prompt on an action line coming out from Task Node in WF. And on accepting this message by OK(button on Prompt), proceed further. This works fine if the action line is not coming out from Task Node. But for some reason doesn't work for Task Node.

    I even tried adding INPUTNODE, Condition Node infront of Task Node and then before stop node called this action to display message box. But no gain.

     

    Please let me know if anybody has worked on this and found a solution.

    Updated on 2015-08-15T03:04:05Z at 2015-08-15T03:04:05Z by maximo_TND
  • SASHULL
    SASHULL
    398 Posts

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2015-08-16T22:12:17Z  

    Hello All,

     

    I am also getting the same error which Naga1990 is getting in Maximo 7.5. Any idea when a fix will be released? Does anyone know if the issue has been fixed in MX7.6?

    I am also facing an issue for addWarning(W). My requirement was display a message prompt on an action line coming out from Task Node in WF. And on accepting this message by OK(button on Prompt), proceed further. This works fine if the action line is not coming out from Task Node. But for some reason doesn't work for Task Node.

    I even tried adding INPUTNODE, Condition Node infront of Task Node and then before stop node called this action to display message box. But no gain.

     

    Please let me know if anybody has worked on this and found a solution.

    This functionality does not exist in Maximo 7.5 but does exist in Maximo 7.6. IBM will on occasion add new features and functionality to older versions, but for the most part, you'll have to upgrade. Sometimes these changes require significant changes to the underlying code and they don't risk porting it to older versions. Whether or not the exact example mentioned here will work I'm not sure (they created a new service implicit variable to invoke this, execute additional scripts, log messages, etc. and that's the only way I've done it to this point). An example how to configure this in Maximo 7.6 can be found here: https://www-304.ibm.com/support/knowledgecenter/SSLKT6_7.6.0/com.ibm.mbs.doc/autoscript/t_ex_choice_msg_script.html?cp=SSLKT6_7.6.0

  • maximo_TND
    maximo_TND
    79 Posts

    Re: Unable to raise MXApplicationYesNoCancelException with Scripts in Maximo 7.5

    ‏2015-08-17T12:31:40Z  

    Hello SASHULL,
    Many thanks for update.

    The example shared I did try at MX7.5 and system complained me for that Service. So I understand that this works only for MX7.6.
    I also tried to use raise in MX7.5 and for some this system didn't like it either.

     

    Any way once again thanks SASHULL.