Maximo

Maximo

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

 View Only
  • 1.  Integrating attachment from MAS to external system

    Posted 18 hours ago
      |   view attached

    There is a requirement to interface PR attachments from MAS Manage 9 to external system.

    I have used the below method in publish channel user exit script to retrieve the content. 

    attachments=Base64.getEncoder().encodeToString(XMLUtils.readXMLFileToBytes(mbo.getString("DOCINFO.URLNAME"))))

    But it throws exception 

    java.lang.NullPointerException: null
    at java.util.Base64$Encoder.encode(Base64.java:267) ~[?:?]
    at java.util.Base64$Encoder.encodeToString(Base64.java:321) ~[?:?]
    This code was well working with Maximo 7.6 .
    Please find the user exit script attached.
    DOCINFO.URLNAME is store as cos:doclinks/myfile.pdf
    Has anyone come across this issue?
    Kindly provide your input
    Thanks
    Ratheesh


    ------------------------------
    Ratheesh Pullaikodi
    ------------------------------

    Attachment(s)



  • 2.  RE: Integrating attachment from MAS to external system

    Posted 4 hours ago
    Edited by Liliana Malaescu 4 hours ago

    Hi Ratheesh,

    When he had to interface the attached documents to another external system, we only sent the DOCLINKS and DOCINFO information to the other system, not the actual file itself. So we only sent the path to the file to the external system. 

    Please check: mxe.cosnestedfile system property and the following thread: https://community.ibm.com/community/user/discussion/mas-migrate-attachments-with-same-folder-structure-using-mxecosnestedfile-1

    Hope this helps.

    ------------------------------

    Kind Regards,

    Liliana Malaescu

    Senior Maximo Technical Consultant

    ZNAPZ, part of Naviam

    ------------------------------



  • 3.  RE: Integrating attachment from MAS to external system

    Posted 3 hours ago

    Hi Ratheesh,

    could you please elaborate what do you exactly mean by saying "There is a requirement to interface PR attachments from MAS Manage 9 to external system."?
    Does it mean that you're integrating attachment references (URLs pointing back to Manage) or the actual attachment content?

    If it's the latter then you may use built-in feature of adding and activating in your object structure non-persistent DOCLINKS.DOCUMENTDATA attribute (ref. screenshot below). This way you may easily expose all PR attachments as Base64 strings. Of course this may dramatically increase the size of the outbound integration message which you should account for in your integration pipeline design.



    ------------------------------
    If this post helps, please consider accepting it as a solution to help other members find it more quickly.

    Andrzej Więcław
    Maximo Technical SME
    ZNAPZ B.V.
    Wrocław, Poland
    ------------------------------



  • 4.  RE: Integrating attachment from MAS to external system

    Posted an hour ago

    Hi Andrzej 

    It is the latter. Integrate actual attachment content.

    I have tried with the non-persistent DOCLINKS.DOCUMENTDATA  but it always comes blank.



    ------------------------------
    Ratheesh Pullaikodi
    ------------------------------



  • 5.  RE: Integrating attachment from MAS to external system

    Posted 32 minutes ago

    Hi Ratheesh,

    I think the reason for this behavior could that you're using JSON as an output message type. Could you quickly test your scenario with XML output and see whether DOCLINKS.DOCUMENTDATA gets populated?



    ------------------------------
    If this post helps, please consider accepting it as a solution to help other members find it more quickly.

    Andrzej Więcław
    Maximo Technical SME
    ZNAPZ B.V.
    Wrocław, Poland
    ------------------------------