Maximo

 View Only
Expand all | Collapse all

NameError: name 'mbo' is not defined in

  • 1.  NameError: name 'mbo' is not defined in

    Posted Sun August 15, 2021 04:31 AM

    Dear experts,

    I working on Maximo Asset Management 7.6.1.1, writing Automation scripts type integration to process incoming request message from external system with option: Enterprise service, Request, User exit, Before External exit, Jython script simple as below:

    from psdi.server import MXServer from psdi.mbo import Mbo selectedMBOs = mbo.getMboSet("SR") if selectedMBOs is not None: selectedMbo = selectedMBOs.moveFirst() if invuselinerefs is not None: mbo.setValue("DESCRIPTION", selectedMbo.getString("DESCRIPTION") + selectedMbo.getString("TICKETID") + selectedMbo.getString("ASSETNUM")) print("LONGND RUN")

    I always get the return error as:

    <faultcode>soapenv:Server</faultcode> <faultstring>BMXAA7837E - An error occured that prevented the SYNC.MXSRINTERFACE.USEREXIT.IN.BEFORE script for the null launch point from running. NameError: name 'mbo' is not defined in &lt;script> at line number 3</faultstring> </soapenv:Fault>

    It means that at runtime the "mbo" is not identified.

    If i remote all the code, and keep the simple Printout statement, I got the normal response without error and I can see the result of Printout statement in the Log file. It mean that the integration automation script is already executed successful without "mbo" usage.

    Please be noted that, this issue is not happened with other type of Automation scripts as with Launch Point. Just occurred with integration automation scripts.

    Can anyone meet the same issue, what is happening with our system and how to resolve this.

    Thank you so much!

    Long.






    #Maximo
    #Support
    #AssetandFacilitiesManagement
    #SupportMigration


  • 2.  RE: NameError: name 'mbo' is not defined in

    Posted Tue August 24, 2021 10:57 PM

    Your integration launchpoint needs to use different implicit variables to get at the underlying data: irData and erData. These are not MBOs but XML objects containing the internal or external data associated with the transaction. Because of that, you won't be able to use a getMboSet("relationshipname") from them to find related data but will have to build a query with the correct terms.

    Here are examples of how you can use irData and erData in scripts to review or modify the transaction date:

    https://www.ibm.com/support/pages/automation-script-maximo-integration-framework-mif-enterprise-service

    https://www.ibm.com/docs/en/mam/7.6.0?topic=ccsp-examples-using-automation-scripts-during-processing-by-channels-services






    #Support
    #AssetandFacilitiesManagement
    #Maximo
    #SupportMigration


  • 3.  RE: NameError: name 'mbo' is not defined in

    Posted Wed August 25, 2021 08:19 AM

    Dear bro,

    Thanks you so much for your replying. Actually what I have done is following exactly by the blog: https://www.ibm.com/support/pages/automation-script-maximo-integration-framework-mif-enterprise-service


    Initially, I wrote script by JavaScript, as below (same in the above blog):


    irData.breakData();

    var comm = irData.getCurrentData("TICKETID");


    irData.setCurrentData("DESCRIPTION","Desc - "+ comm + " - " + irData.getCurrentData("ASSETNUM"));


    I also getting error as:

       <soapenv:Fault>

         <faultcode>soapenv:Server</faultcode>

         <faultstring>BMXAA7837E - An error occured that prevented the SYNC.MXSRINTERFACE.USEREXIT.IN.BEFORE script for the null launch point from running.

    ReferenceError: "irData" is not defined in &lt;eval> at line number 1</faultstring>

       </soapenv:Fault>


    "irData" is not identified (JavaScript) as same as for "mbo" (JyThon) is also not identified. What is wrong bro?


    Thanks you so much!






    #Support
    #Maximo
    #AssetandFacilitiesManagement
    #SupportMigration