Maximo Open Forum

 View Only
  • 1.  Maximo Email Listener

    Posted 04-04-2025 14:20

    I have successfully configured email listener in Maximo 7.6.1.3 to allow email approval or cancellation of Purchase Orders.
    The customer would like it if I could attach a PDF copy of the PO Details birt report to the workflow notification of the assignment.

    Here is how I had it working.
    I wrote a script to run the report and save it as an attachment on the purchase order, and then added a communication template to the workflow assignment telling the user that they "will" be receiving an email to approve or cancel the attached purchase order...

    Then a few minutes later a second email is sent by the email escalation cron task which contains the email listener information, including the options to 1 - approve or 2 - cancel the PO.

    That is all working... the thing is the customer would like it if just a single email gets sent instead of two... and that the one email has the options needed to do the automatic processing as well has having the PO Attached.

    Here is what I have tried instead... since the two communication templates were for different objects (one for PO the other for WFASSIGNMENT), I deduced that the WFASSIGNMENT object would need to have doclinks available, and the PO detail report stored in a document type that the email listener comm template could attach.

    I created a custom application just to display WFASSIGNMENT Records and allow doclinks for wfassignments.  I then created an automation script called WFASSIGNMENT.NEW which ran the PO Details report and attached it to the WFASSIGNMENT record.

    However, when the email is sent out for the workflow assignment is still contains only the options for the user to approve or cancel, but does not include any attached files.

    I have checked and the WFASSIGNMENT record does have the PO detail pdf attached in doclinks, and the comm template was modified to include attachments found in the folder... yet is it not attaching anything when the email is getting set.

    I must be missing a step somewhere or maybe what I am trying to do is just not possible.

    Any ideas are welcome at this point.

    regards,
    Steve Hume


    #EverythingMaximo

    ------------------------------
    Stephen Hume
    Sheffield Scientific LLC
    ------------------------------


  • 2.  RE: Maximo Email Listener

    Posted 04-05-2025 16:39

    Stephen,

    You should be able to use the ReportQueueService class to queue the PO Details report for the given purchase order. You should be able to use a Communication Template as part of the outbound message, which would then serve as a reply vehicle for the Email Listener. Something like this could be used as an Automation Script / Action that gets called either by an Escalation or the workflow itself.

    from com.ibm.tivoli.maximo.report.birt.queue import ReportQueueService
    from com.ibm.tivoli.maximo.report.birt.runtime import ReportParameterData
    from psdi.mbo import SqlFormat
    
    locale = userInfo.getLocale()
    
    # TODO: replace this with WF assignment information, based on the given mbo
    emailto = userInfo.getEmail()
    
    # Build the Subject and Body of the email from the Communication Template
    # TODO: get the comm template subject line, based on the given mbo or hard-coded
    sqlf = SqlFormat(mbo, mbo.getString("COMMTMPLT.SUBJECT"))
    sqlf.setIgnoreUnresolved(true)
    emailSubject = sqlf.resolveContent()
    
    # TODO: get the comm template message body, based on the given mbo or hard-coded
    sqlf = SqlFormat(mbo, mbo.getString("COMMTMPLT.MESSAGE"))
    sql.setIgnoreUnresolved(true)
    emailComments = sql.resolveContent()
    	
    # Build the Report Parameters
    parameterData = ReportParameterData()
    parameterData.addParameter("appname", "PO")
    parameterData.addParameter("paramdelimiter", "")
    parameterData.addParameter("paramstring", "")
    parameterData.addParameter("where", "(po.poid = " + str(mbo.getLong("POID")) + ")")
    
    # Queue the Report to Run
    queueManager = ReportQueueService.getQueueService()
    queueManager.queueReport("poprint.rptdesign", "PO", userInfo.getUserName(), emailto, emailSubject, emailComments, parameterData, locale.getCountry(), locale.getLanguage(), locale.getVariant(), userInfo.getTimeZone().getID(), userInfo.getLangCode(), long(0), userInfo)

    Alternatively, you can check out the MxApprove mobile app from A3J Group. Users can view their workflow inbox assignments on their phone, look at the details of the underlying record (including attachments), and approve or reject the assignment.

    Hope this helps,



    ------------------------------
    Alex Walter
    A3J Group LLC
    ------------------------------