Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

mxevent definition and usage

  • 1.  mxevent definition and usage

    Posted 02/28/22 09:42 AM
      |   view attached
    I pulled the unique mxevent names from our library.xml (7.6.0.8) and found some to be interesting. Is there a document from IBM (or anyone) that details what these do, how one could use them with custom apps/custom dialogs (in app or library).
    I've attached that file, just in case others may be interested in that list.
    [I used powershell to pull those].

    thanks in advance,
    John

    ------------------------------
    John Dyer
    ------------------------------

    #Maximo
    #AssetandFacilitiesManagement

    Attachment(s)



  • 2.  RE: mxevent definition and usage

    Posted 03/01/22 08:48 AM
    mxevent can tie to a lot of things in Maximo. For example, you can launch a dialog by utilizing a mxevent of the same name as the dialog. This dialog can exist inside the app or some of the system libraries like the library.xml.  It can also refer to a java method in the underlying bean class. This is what most of the actions are calling. It can also be tied to an automation script & sigoption and invoke the automation script based on it, though we don't ship any of those out of the box.

    If there's a specific one you want to learn more about I'd be happy to elaborate on its purpose. In general, aside from the standard actions that you'll use throughout (dialogok for example), the rest are specific to its purpose and most likely can't be re-used outside of that specific situation.

    ------------------------------
    Steven Shull
    ------------------------------



  • 3.  RE: mxevent definition and usage

    Posted 03/01/22 11:06 AM
    Steven,
    Thanks for the explanation, esp. as to usage, in that some are more of a general use.
    My interest is trying to get a list of records from one child table. With a multi-select option, the user would select and then click the button to insert (selected fields) into another a child table.
     
    I'm also having a mental fog about specifying the correct relationship, data sources etc. I've been working maximo for a while, but I have a new custom app and thus several dialog boxes I have to use.
     
    So, is dialogok appropriate to use to push select fields from other records into another table? I do have the tools to wright custom actions using JavaScript, and maybe that's the route.
     
    Thanks,
    John K Dyer
    SAMMS Program Manager / Administrator
    National Wildlife Refuge Headquarters
    US Fish and Wildlife Service
    MS: NWRS
    5275 Leesburg Pike
    Falls Church, VA 22041-3803
     
    Telephone: 703-358-2083 Fax: 703-358-2518
    Cell (FWS): 571-334-7116 Cell (Pers): 703-973-5708
     
    Infrastructure Management Division SharePoint
     
    You may be a prisoner of your own fears, but you should not ever become a prisoner of another's fears. Nor seek to make another a prisoner of your fears.
     
     
     





  • 4.  RE: mxevent definition and usage

    Posted 03/01/22 11:36 AM
    This is doable but you'll need to do some more configuration. Think of dialogok as a basic save and close of the dialog. You'll need an action, either Java or Automation script, to take the data from your child object and load it into the other child object. I'd suggest an action launch point automation script. You'll also want to make sure that in your dialog you associate the bean class psdi.webclient.system.beans.MultiselectDataBean. This is needed to properly support the multiselect.

    In your script you can then get the selected MBO records a couple of different ways to iterate over and add to your other child set. I talked about one approach here: https://community.ibm.com/community/user/iot/communities/community-home/digestviewer/viewthread?GroupId=727&MessageKey=0fc8bf88-03da-415a-922b-fdc9eebf0f50&CommunityKey=3d7261ae-48f7-481d-b675-a40eb407e0fd&tab=digestviewer

    I can't do an end to end example at the moment but if you hit issues let me know and I'll try to put something together.

    ------------------------------
    Steven Shull
    ------------------------------



  • 5.  RE: mxevent definition and usage

    Posted 03/01/22 01:09 PM
    Super good information – I'm going to go whack it a little bit more before throwing in the towel; it's good to learn, if it mostly from mistakes – not smart or best practice, but I'm dealing with the hand ... at hand.
     
    Thanks,
    John K Dyer
    SAMMS Program Manager / Administrator
    National Wildlife Refuge Headquarters
    US Fish and Wildlife Service
    MS: NWRS
    5275 Leesburg Pike
    Falls Church, VA 22041-3803
     
    Telephone: 703-358-2083 Fax: 703-358-2518
    Cell (FWS): 571-334-7116 Cell (Pers): 703-973-5708
     
    Infrastructure Management Division SharePoint
     
    You may be a prisoner of your own fears, but you should not ever become a prisoner of another's fears. Nor seek to make another a prisoner of your fears.
     
     
     





  • 6.  RE: mxevent definition and usage

    Posted 03/01/22 11:04 AM
    Hi John,

    The events you are referencing are either select action menu item names or method names on the hierarchy of data bean classes that are defined within each table section and ending with the top level app bean.  

    For example the SAVE event (case sensitive) is actually the:
    public int SAVE() throws MXException, RemoteException
    method signature of the 
    psdi.webclient.system.beans.AppBean
    class, from which all the other AppBean classes extend.

    For a further example on the 

    psdi.webclient.beans.asset.AssetAppBean
    class there is a method called MOVEASSET, which is then the method that is called when the MOVEASSET event is fired.
    public int MOVEASSET() throws RemoteException, IOException, ServletException
    Hopefully that makes sense, but if you have further questions feel free to reach out.





    ------------------------------
    Jason VenHuizen
    https://sharptree.io
    https://opqo.io
    ------------------------------



  • 7.  RE: mxevent definition and usage

    Posted 03/01/22 11:13 AM

    Jason,

    Thanks for the bit of information. It looks like the pages here, Maximo 7.6 API - A-Index (bportaluri.com) is the resource, or a resource about a LOT of information. That looks a little more advanced that I have the brains for at this time.

     

    Thanks,

    John K Dyer

    SAMMS Program Manager / Administrator

    National Wildlife Refuge Headquarters

    Maximo 7.6 API - A-Index (bportaluri.com)

    Telephone: 703-358-2083 Fax: 703-358-2518

    Cell (FWS): 571-334-7116 Cell (Pers): 703-973-5708

     

    Infrastructure Management Division SharePoint

    Documents on SharePoint

     

    You may be a prisoner of your own fears, but you should not ever become a prisoner of another's fears. Nor seek to make another a prisoner of your fears.

     






  • 8.  RE: mxevent definition and usage

    Posted 05/25/26 12:42 PM

    @Jason VenHuizen  I have requirement in Asset List tab. In my list Tab, location column is available. when user click on link assocaited with Location column, it should open location record. Is it possible via appbean.asset script ?

    Thank you.



    ------------------------------
    Pavan Uppalanchu
    ------------------------------



  • 9.  RE: mxevent definition and usage

    Posted 05/26/26 03:20 PM

    Hello Pavan,

    If you simply want a quick way for the user to get to the Locations app for the Location on a row of the Assets app's List tab, you can do that very easily using the "Go To Locations" feature.  The out-of-the-box Assets applications already has the Location column configured to "Go To Locations" but the chevron to select it only appears on the Filter Row because the List tab is a Read Only table and the chevron doesn't appear on table columns in a Read Only table.  However, if you add a textbox control inside the tablecol tag for the Location column, the chevron will appear and the user can select the "Go To Locations" option.

    For example, you would change:

    <tablecol applink="location,ipc" dataattribute="location" id="results_showlist_tablebody_4" lookup="locations" menutype="locations"/>

    to something like this:

    <tablecol applink="location,ipc" dataattribute="location" id="results_showlist_tablebody_4" lookup="locations" menutype="locations">
       <textbox id="1779822542585"/>
    </tablecol>



    ------------------------------
    Julio Hernandez
    Ergonare, Inc.
    Phoenix AZ
    480-759-9870
    ------------------------------



  • 10.  RE: mxevent definition and usage

    Posted 05/27/26 02:46 PM

    Hi Pavan,

    I received a response from you through the IBM Community, which I don't see here, and I couldn't find a way to respond to you except through here.  The email I received is below:

    _____________________________________________________________

    From: Pavan Uppalanchu via IBM Community <Mail@ConnectedCommunity.org>
    Sent: Tuesday, May 26, 2026 11:14 PM
    To: JulioH@Ergonare.com
    Subject: RE: mxevent definition and usage

    The following message has been sent to you in response to your discussion message.

    View inbox and reply to the message online

    Message From: Pavan Uppalanchu

    Hello, 

    Thank you for reply. I tried and it's working!!!!   

    Can we enable hyperlink like we had on asset column? 

    ------------------------------
    Pavan Uppalanchu
    ------------------------------
    _____________________________________________________________

    My response is below:

    While it is possible to show the underline under the Location field just as it appears under the Asset field, clicking it would just take you to the main Asset tab for the Asset on that row.

    Allowing an underline to work as a real link to take you to the Locations app may be possible, but would be more involved and would be inconsistent with the rest of Maximo.

    Thanks.



    ------------------------------
    Julio Hernandez
    Ergonare, Inc.
    Phoenix AZ
    (602) 321-2431
    ------------------------------



  • 11.  RE: mxevent definition and usage

    Posted 05/28/26 09:47 AM

    hello Julio,

    Thank you again for your response. I tried with databean auto script and it's working. I thought that might have been possible through configuration change. Below is my solution and it's working but loading for about 2-3 seconds.  The event locationrecord should be mentioned on location column in list tab in application designer.

    def locationrecord(ctx):
        mbo = ctx.getEvent().getSourceControlInstance().getDataBean().getMbo()
        location = mbo.getString("LOCATION")
        siteID = mbo.getString("siteid")
        wcs = ctx.webclientsession()
        # -------------------------------------------------
        # . Build Location  WHERE clause
        # -------------------------------------------------
        whereClause = "location = '{}' AND siteid='{}'".format(location,siteID)
        
        encodedWhere = URLEncoder.encode(whereClause, "UTF-8")
        
        # -------------------------------------------------
        # . Navigate to Location 
        # -------------------------------------------------
        finalUrl = (
            "/maximo/oslc/graphite/manage-shell/index.html"
            "?event=loadapp"
            "&value=location"
            "&additionalevent=sqlwhere"
            "&additionaleventvalue=" + encodedWhere +
            "&changetab=main"
        )
        
        wcs.gotoApplink(finalUrl)





    ------------------------------
    Pavan Uppalanchu
    ------------------------------



  • 12.  RE: mxevent definition and usage

    Posted 05/29/26 08:34 AM

    Hi all,

    I'm wondering what the opinions of the folks here about bean scripting is. So far, I tend to avoid enabling it as you can directly write things whatever you want in the html of the website.

    However, the approach of using the gotoAppLink() will also work with an Action launch point on the line level. At least I did some Actions on table rows recently. This python example duplicates a line in a custom object:

    from java.lang import System
    from psdi.mbo import MboRemote, MboSetRemote

    thisset = mbo.getThisMboSet();
    currentpos = thisset.getCurrentPosition();

    newline = thisset.addAtIndex(currentpos);
    newline.setValue("sequence",mbo.getInt("sequence"));
    newline.setValue("intobjectname",mbo.getString("intobjectname"));
    newline.setValue("objectname",mbo.getString("objectname"));
    newline.setValue("parentobjname",mbo.getString("parentobjname"));
    newline.setValue("level",mbo.getInt("level"));
    newline.setValue("label",mbo.getString("label"));
    newline.setValue("isdatasource",mbo.getBoolean("isdatasource"));
    newline.setValue("isonetoone",mbo.getBoolean("isonetoone"));
    newline.setValue("isxpath",mbo.getBoolean("isxpath"));
    newline.setValue("includeinparent",mbo.getBoolean("includeinparent"));
    newline.setValue("afterattribute",mbo.getString("afterattribute"));
    newline.setValue("xpath",mbo.getString("xpath"));


    # Neu sortieren
    for i in range(0, thisset.count()):
        objrow = thisset.getMbo(i);
        if i >= currentpos:
            objrow.setValue("sequence",i);

    # table refresh
    wcs=service.webclientsession();

    databean = wcs.getDataBean("eamerobjects_table");
    if databean is not None:
        databean.refreshTable();
        databean.setCurrentRow(currentpos);

    databean1 = wcs.getDataBean("eamattribute_table");
    if databean1 is not None:
        databean1.refreshTable();
        databean1.setCurrentRow(currentpos);

    Just as an alternative option. In the end I'm curious if I'm over-cautious by disabling bean scripting on purpose....



    ------------------------------
    Johann Rumpl
    Managing Director Naviam DACH
    Naviam
    Steinmaur
    Austria
    ------------------------------