Skip to Content

In the previous installment HCI First Steps Part 4 – Configuring the Credentials we are built an integration process and configured receiving the data and forwarding the data. The actual step for performing the processing of the data now needs to be built.

/wp-content/uploads/2015/09/pic_798407.png

The first thing that needs to be done is getting rid of the error on the content modifier since this is preventing deployment and testing of the iFlow. To do this the content modifier needs to be configured to extract the relevant fields from the XML and then pass them onwards. To decide what data needs to be extracted, it is best to connect to the service and examine the resulting XML in an application that will easily allow REST services to be accessed.

 

In this case I used the Postman REST client in Chrome, though there are many other options that could have been equally as well suited.

/wp-content/uploads/2015/09/pic_798407.png

For this the “weather” element in the “current” root element needs to be extract and the “value” field will be used. This is formed by the XPath string “/current/weather/@value” The last update field will also need to be passed onto the next process in the integration and can be extracted in the same way.

/wp-content/uploads/2015/09/pic_798407.png

We create two header properties that are strings called “currentConditions” and “currentReport” and these point to the XPath attributes “/current/weather/@value” and “/current/lastupdate/@value”. In XPath the “@” refers to an attribute and not an element. Also remember to make these header values so they can be passed to the external service calls. If they are properties they will not be sent to the external processes.

It is now possible to complete configuration of the email channel by setting the subject, body and attachments.

Open the email channel and configure the subject to use the “currentConditions” value and the body to use the “currentReport” and “currentConditions” values. HCI uses the ${property/header/body} format to allow header, body and property values from content modifier steps to be inserted into succeeding operation steps in the iFlow.

 

/wp-content/uploads/2015/09/pic_798407.png

For extra credit, the message body from the content modifier step (that is the response from the weather service as XML) can be used  as an attachment to the email.

 

Update: The last step is to configure the sender to use Basic, rather than Certificate authentication. Select the “Sender” element in the iFlow. Then in the properties at the bottom, set the “Authentication Mode” to “Basic Authentication”

Screen Shot 2015-11-04 at 09.18.38 copy.png

Save the iFlow and first use the “Execute Checks” command to check the “Process Integration” is consistent.

Use the “Deploy Integration Content” command to deploy the iFlow to the HCI Tenant.

/wp-content/uploads/2015/09/pic_798407.png

Because iFlow i marked as run once, on deployment the iFlow will execte. It should now run successfully and a message should be received in your Gmail account.

/wp-content/uploads/2015/09/pic_798407.png

Note the header text, the body text and of course as expected there is also an attachment in the message.

The final configuration step in the iFlow is to have this iFlow integration process execute every day. To do this the start timer needs to be reconfigured to run daily at 08:00. Of course other execution options could be chosen to run the integration process at different times depending on the processing required.

Select the “Start Event 2” component and then from the properties tab, uncheck the “run once” checkbox and select the “daily” radio button and then select the “time” radio button, setting the time to “08:00”.

/wp-content/uploads/2015/09/pic_798407.png

Save the iFlow, execute the “Checks” command to ensure that the iFlow is consistant and then deploy the iFlow to the HCI tenant. Pat yourself on the back for designing, creating and deploying your first iFlow, have a sleep and wake up with the weather being delivered to your gmail inbox everyday.

In the final installment the tracing options will be discussed.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Bhargava krishna Talasila

    Hi Paul,

    Thank you very much for your blog 🙂

    i followed all your blogs and configured iflow and deployed successfully.

    When i execute the interface, it is failing with the below error

    Error   = org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: /current/weather/@value. Reason: javax.xml.xpath.XPathExpressionException:

    Failure converting a node of class javax.xml.transform.sax.SAXSource: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog., cause: javax.xml.xpath.XPathExpressionException: Failure converting a node of class javax.xml.transform.sax.SAXSource: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.

    Can you help me to fix the issue.

    Regards

    Bhargava Krishna

    (0) 
    1. Paul Todd Post author

      It looks like you are getting JSON back. Did you remember to setup the query correctly, you should have in the query: q=walldorf,de&mode=xml

      Look at part 6 and get a trace for the integration execution and see if the response from the weather service is XML.

      (0) 
  2. Jitendra Kansal

    Hey Todd,

    I followed this blog series on my HCI trial account.

    Deployed Artifacts status>DEPLOYED

    Message Monitoring>Failed

    In the logs i see below error message,

    Error  = javax.mail.MessagingException: Could not convert socket to TLS;

      nested exception is:

      javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, cause: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

    I have already posted my query here: Message monitoring status shows FAILED

    Regards,

    JK

    (0) 
    1. Paul Todd Post author

      Hi Jitendra,

      Thanks for the interest, it helped us track down a very subtle issue I was not aware of. Working with collegues on friday we identified the default HCI tenant does not include the certificates for Google. You can extract the certificates by going to your gmail account, saving all the certificates in the certificate path (There should be three, the root CA, the intermediate google CA and *.google.com) and then putting them into a keystore and uploading the keystore artifact to your tenant.

      If you cannot do the extraction and creation of the keystore, please email me and I will send you the file you can use, otherwise I plan to create another blog explaining more about how this happened, how we identified it and of course how we fixed.

      (0) 

Leave a Reply