Maximo

 View Only
  • 1.  Special Characters in Descriptions breaking Integrations?

    Posted Tue March 26, 2024 05:54 PM

    We are experiencing our outbound integrations breaking when they create the XML if they have special characters in the text. For example when word turns 3/4 into the ¾   .... Other situations as well. That small 3/4 breaks the XML creation.

    Does Maximo provide a java class file we can put on the attributes that may help it deal with these special characters to not error?

    Seen some old links like this:
    Email: Removing RichText From the CommLog Message Field (ibm.com)

    But was hoping maybe the Maximo class directly on the field was out there?

    Thanks,



    ------------------------------
    David Miller
    Managing Partner - Maximo Consultant
    Enterprise Integration Partners LLC
    ------------------------------


  • 2.  RE: Special Characters in Descriptions breaking Integrations?

    IBM Champion
    Posted Wed March 27, 2024 07:37 AM

    Hi David.

    The psdi.util.HTML class in the posting does reference a Java class that some interface specific code can call.

    I doubt that there will be a specific attribute level class that you can use because the problem could hit multiple bits of Maximo so they won't each have a specialist function to clean up the text. Having a special attribute class would also prevent other customisations being executed when the value is modified.

    It sounds like a problem where the value was converted into a symbol - possibly using one of the Microsoft Word smart typing conversions. Those conversions take strings like (c) and translate them into the Copyright symbol.



    ------------------------------
    Mark Robbins
    Support Lead/Technical Design Authority / IBM Champion 2017 - 2023
    Cohesive (previously Vetasi Limited)
    https://www.linkedin.com/pulse/maximo-support-advice-from-non-ibm-engineer-article-mark-robbins/
    ------------------------------



  • 3.  RE: Special Characters in Descriptions breaking Integrations?

    Posted Wed March 27, 2024 05:20 PM

    Problem is all this stuff on that class appears to be Deprecated. What do they want us to use when they deprecated what use to work?

    Maximo 7.6 API - RichText (bportaluri.com)



    ------------------------------
    David Miller
    Managing Partner - Maximo Consultant
    Enterprise Integration Partners LLC
    ------------------------------



  • 4.  RE: Special Characters in Descriptions breaking Integrations?

    Posted Fri March 29, 2024 07:21 AM
    Edited by Suhas Joshi Fri March 29, 2024 07:32 AM

    Hi David,

    What exactly is your requirement? Do you want to convert 3/4 into some other value such as 3slash4? You can write an automation script on the object structure for outbound operation. you can try to overwrite the xml value with something else like below using overrideValues function:

    def overrideValues(ctx):
    if ctx.getMboName()=='WO':
    mbo = ctx.getMbo()
    desc = mbo.getString("Description")
    desc = desc.replace('/', 'slash')
    ctx.overrideCol("DESCRIPTION",desc)

    #IBMMaximo


    ------------------------------
    Suhas Joshi
    Pune
    ------------------------------



  • 5.  RE: Special Characters in Descriptions breaking Integrations?

    IBM Champion
    Posted Sun March 31, 2024 09:41 AM

    Hi David, 

    The deprecated method for converting html text into plain text still works in higher version. 

    outbound-object-structure-integration.html

    Option A: You can refer above link and create an outbound object structure processing script.

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

    from psdi.util import HTML

     def overrideValues (ctx):

         if ctx.getMboName() == "PO" :

              ctx.overrideCol("DESCRIPTION_LONGDESCRIPTION", HTML.toPlainText(ctx.getMbo().getString("DESCRIPTION_LONGDESCRIPTION")))

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

    or Option B: Use python functions to remove the special characters

    ----------------------------------------------------------------------------------------------------------------------------
    import re
    def removeHtmltags(text): 
        clean = re.compile('<.*?>') 
        return re.sub(clean,'', text) 
     
    def overrideValues (ctx):
    if ctx.getMboName() == "PO" :
              ctx.overrideCol("DESCRIPTION_LONGDESCRIPTION", removeHtmltags(ctx.getMbo().getString("DESCRIPTION_LONGDESCRIPTION")))
    -------------------------------------------------------------------------------------------------------------------------------

    Thanks,

    Suren



    ------------------------------
    Surendar Balasundaram
    ------------------------------