Posts

A different way to restart SAP CPI content

It is pretty difficult to restart SAP CPI messages from any external applications. There is just two ways that include either the Enterprise Messaging/JMS or the Datastore. Some times this can create some complex scenarios for the user to develop.

We wanted to make some of the development a little easier. It requires just one groovy script and two script steps in your iflow. We will show a different way that allows you to restart messages in an external application and setup rules for how often it can be reprocessed. We leverage that the Figaf IRT application is able to download messages that have a specific filter like Receiver is LOG. Then the message will be downloaded and you can apply some rules to it like it should be reprocessed 3 times. There is also the option to send notifications to emails or systems like Jira.

Check out the video where you can see how simple it is to restart a SAP CPI message.

We currently do not know how this will affect count of connections on your SAP CPI system, so use with caution.

You can try out Figaf IRT on your own system. We have both a cloud and an on-prem version to deploy the application.

You can see the code below, it will be updated so you can find a more uptodate version in the IRT application.

package com.figaf.irt
import com.sap.gateway.ip.core.customdev.util.Message
import org.apache.camel.converter.stream.InputStreamCache
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def Message initalSave(Message message) {
    try {
        //Body
        def body = message.getBody(java.lang.String)
        def base64 = body.bytes.encodeBase64().toString()
        Map map = message.getHeaders()
        map.put("body", base64)
        message.getHeaders()
        def json = JsonOutput.toJson(map)
        def cache = new InputStreamCache(json.bytes)
        // we save the json as a property, so we can restore it in the pipeline
        message.setProperty("IRTSAVE", cache)
    } catch (Exception ex) {
        try {
            def messageLog = messageLogFactory.getMessageLog(message)
            messageLog.setStringProperty("CustomLog", ex.getClass().getName() + ":" + ex.getMessage())
        } catch (Exception ignored) {}
    }
    return message
}
/**
 * An error have occurred then save the payload as an attachement
 * @param message
 * @return
 */
def Message savePayload(Message message) {
    try {
        def messageProperties = message.getProperties()
        def ex = messageProperties.get("CamelExceptionCaught")
        if (ex == null) {
            return message
        }
        def irtpayload = message.getProperty("IRTSAVE")
        JsonSlurper jsonSlurper = new JsonSlurper()
        def map = jsonSlurper.parseText(irtpayload.getText())
        map.put("Cause", ex.getClass().getName() + ":" + ex.getMessage())
        irtpayload = new InputStreamCache(JsonOutput.toJson(map).bytes)
        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream()
        irtpayload.writeTo(bytesOut)
        def messageLog = messageLogFactory.getMessageLog(message)
        messageLog.addAttachmentAsString("IRTSAVE", new String(bytesOut.toByteArray()), "application/json")
        message.setHeader("SAP_Receiver", "LOG")
    } catch (Exception ex) {
        try {
            def messageLog = messageLogFactory.getMessageLog(message)
            messageLog.setStringProperty("CustomLog", ex.getClass().getName() + ":" + ex.getMessage())
        } catch (Exception ignored) {}
    }
    return message
}

IRT feature: Monitor SAP Cloud Platform Integration Content (CPI)

A few weeks ago we added an option to monitor your SAP PI/PO repository content, so you could see what was changed in any objects. And based on the changes you registered you could test the scenarios.

We have also enabled users to test SAP Cloud Integration so it made a lot of sense also to monitor the content so we could support full cycle development. So we can now monitor all changes to the content. So you can see what was changed in a script and what areas were changed in an iflow. The output may be a little technical but it will allow you to see that something was changed.

We also have the ticket content that allows you to register the changes that you are doing and ensuring that you are testing all of the changes that you are making. It is a way to ensure that enables you to document the changes in a better way than using Word documents for the information. You can then link your existing ticket/helpdesk system to the IRT tickets as an extra data source.

You can see a short demo here.

 

There is some features that we will improve in the comparison, so you can see the message mappings content and see the part that was changed. And also improve the comparison of scripts. It will come in a future release.

If you have other wishes to future development do let us know.

First I recommed you to try to install IRT and try it out. You can get started within 30 minutes. Watch the Cloud Platform Integration installation and configuration guide video .

 

Update to testing on SAP Cloud Platform Integration (CPI)

We just released IRT 2.3. That had two big additions. One was our ability to monitor your full SAP PI/PO/CPI development process. In this post, I’ll share the other which is much better support for cloud integration.

In 2.2 we add the first option to run cloud integration tests. We were able to use the new trace functionality for cloud integration to get messages at all stages. This made our test easy to perform without any changes to the setup.

In this, we have added some more functionality

  • We can run regression test for both HTTP and now SOAP adapter. This means that it will use your existing iflow to process the test message in.
  • If you use other adapters or scheduled tasks IRT is able to create a new flow that looks like the original one, except it starts with an HTTP adapter. IRT can record the message from the existing flow.

We have an oss note with SAP that the latest release meant we were getting some problem when setting an iflow into Trace mode.

You can watch the demo video here.

It is pretty simple to setup. Just signup at http://figaf.com/irt then login with the password you will get. Here you can also find the manual. Download the jar file, start it. In the configuration enter your host url, Suser and password, then you can synchronize the list of iflows and start setting up test cases.

 

 

Latest Figaf IRT tool and Roadmap

Updated 2018-06-03

With the newest release of Figaf IRT tool, we have been adding a lot of new functionality.

In this presentation, you will see how to test SAP PI/PO and SAP Cloud Integration.

  • The testing of SAP PI/PO is stable for collecting and getting test messages. It is fast to record messages for testing and running them is also fast.
  • Testing SAP Cloud Platform Integration is possible
  • Development Supporting is now in the system that allows you to create tickets and assign any object version to it.
  • Change Tracking now have a deep comparison of Repository Objects so you can see what is changed with a message mapping and contains a link so you can see the affected ICO, that should be tested.
  • Support tool to monitor errors in the SAP PI CMBA and setup triggers for it.

In the current roadmap, we have the ability to fetch test data on SAP PI/PO without installing a module. And to perform object change and the support on Cloud Integration.

Everything has been build into one application that allows users to develop faster and have better tracking of what will happen.

You can start a free trial of the IRT tool by going to https://figaf.com/irt

If you have any questions please reach out to us.

 

 

IRT 2.2 Release notes Testing of SAP PI, Cloud Integration and Changemanagement

Yesterday we release the IRT 2.2 to make testing even easier. This release contains a lot of new functionality that makes it a lot easier to test your system.

One of our visions is to make an all round change management tool that allow you to find errors, fix them, document the changes, and test it. We have added the first part of this which is to support the change management, this will allow you to document what is going on in the landscape.  So now we have a link form ICO all the way to message mapping. This will allow us to ensure that you test the interfaces before you make any release.

You can see the video for a presentation here.

 

Cloud Integration. We have now added the option to start testing SAP Cloud Integration (CPI aka HCI) . It is made possible by the new option to trace information so we don’t need to make modifications to your iflows to test it. We can do a regression test with the HTTP adapter now, and hopefully will be able to add some more adapters in next release. For other messages, you need to use the baseline testing, where you will be sending the same message again. We will add more functionality to this testing to make it easier to do regression test for all adapters.

Baseline test cases. This is to make integration with Workflow tools like HPE UFT that already creates a set of number of messages to the SAP PI/PO system. So instead of IRT is sending test messages the sending system is creating the messages. The test would then compare that the same messages are sent and compare that they are processed in the same order. This is also a function we are using when testing with SAP Cloud Integration.

Change Tracking Tool. In the change tracking tool we have added the ability to see all repository objects and what is changed. So you can see where in an object it changed, we will add the option also to do a comparison in UDF and Message mapping in a future version. The cool thing is that you now can see where a message mapping is used and in which ICO/iFlows it is used. This will give users the option to run test report that covers the things that have been changed. We still have to add a few links.

 

If you are ready to start testing your SAP PI/PO/CPI solutions better then have a look at the Figaf IRT tool that allow you much better testing.