Integration

Get Involved. Join the Conversation.

Topic

    Pooja I
    Multiple line within a single mapping elementAnswered
    Topic posted October 11, 2019 by Pooja IBronze Medal: 1,250+ Points, tagged Integration, Mapping 
    119 Views, 13 Comments
    Title:
    Multiple line within a single mapping element
    Content:

    I have used the below wsdl to generate scheduled report from fusion;

    WSDL: http://<host>:<port>/xmlpserver/services/v2/ScheduleService?wsdl

    The request mapper for the above service provides me with E-mail options.

    The issue i am facing now is, in the e-mail body element i need to include the attached sample mail.

    So i formatted using the xsl-text element. but the result is not as formatted as what is expected. Is there any way to format text in an mapping element?

    I have attached the files

    ResultReceived.png - is the output I received

    emailBody.png - the mapping in oic

    sampleMail.png - the expected output.

     

    Do share your insights.

    TIA.

     

    Image:
    Document:
    Document:

    Best Comment

    Monish Munot

    Did you update the email id to yours in email notification? I got for mine, attached screenshot.

     

    Comment

     

    • Kanchankumar Khedkar

      Formatting put inside a XSLT may not be preserved. 

      You can try putting HTML inside body. Concat string etc. can be used to form HTML payload. Though I have not used it in OIC but it should work. 

       

    • Monish Munot

      HTML Construct can help you on this, we have used it in notification and it worked perfectly for us. You can create a body even in variable with assign activity and later use in mapping, this way it becomes easy to develop and maintain.

      • Pooja I

        is there any sample?

          • Pooja I

            Hi Monish,

                I tried to execute as directed. I get error while adding HTML tags in mapper. Please do let me know if html construct can be used within mapper ?

            • Monish Munot

              HTML constructs can be easily used in Assign activity and so the recommendation. Yes we can also use in mapper but we might need to play with &lt; and &gt; for < & > signs. If you can share the iar file can help you with some structure.

              • Pooja I

                Hi Monish,

                   I tried your suggestion. It didn't work. I have attached the .iar Can you please review it and let me know your inputs.

                • Monish Munot

                  Attached one is just the sample which should work as per your integration design. However if you need to add multiple table rows you can for each after variable creation and keep on adding rows like below.

                  emailbody = '<html><head></head><body><h2>Cellpadding</h2><p>This is auto gen mail. Please, do not Reply.</p><table style="width:100%">'
                  For each

                  concat = $emailbody + '<tr><td>John</td><td>Doe</td><td>80</td></tr>'

                  for loop ends

                  emailbody = $emailbody + </table></body></html>

                  Use this in email notification.

                  • Pooja I

                    Hi Monish,

                        on executing the IAR you shared, it failed with the below error:

                     

                    an error occurs while parsing XPath expression "<html><head></head><body><h2>Cellpadding</h2><p>This is auto gen mail. Please, do not Reply.</p><table style="width:100%"><tr><td>John</td><td>Doe</td><td>80</td></tr></table></body></html>" The XPath expression was invalid; the reason was: Unknown expression at EOF: "<html><head></head><body><h2>Cellpadding</h2><p>This is auto gen mail. Please, do not Reply.</p><table style="width:100%"><tr><td>John</td><td>Doe</td><td>80</td></tr></table></body></html>". Check the detailed root cause described in the exception message text and verify that the XPath expression named in the error message is correct. The XPath expression is defined in the BPEL process.

                     

                    This was the error i received everytime i executed the integration