Generative AI-Based Script Optimization

Estimated read time 7 min read

Authors: Marc Eiro, Mitko Kolev, Markus Muenkel, Syed Muhammad Kumail Raza

Product version 6.54 witnessed the first Generative AI feature to SAP Integration Suite, as described in the blog SAP Integration Suite – Generative AI based Integration Flow Generation

In product version 6.59 we are adding another Generative AI feature, which is dedicated to optimization of Groovy scripts. This feature is available with SAP Integration Suite, Premium Edition, on specific regions/data centres eu10, eu10-002, eu10-003, eu10-005, us10, us10-002. Roll-out has been performed in calendar week 50.

The enablement of Generative AI features is documented in above blog and product documentation. 

 

Introduction

In our previous blog Inspecting and Understanding Resource Consumption of your Integration Content we explained how to inspect the resource consumption of the integration flows. The Inspect feature (see https://help.sap.com/docs/integration-suite/sap-integration-suite/inspect) enables understanding resource-related issues and helps in mitigation by proposing adjustments in the integration content. This effectively constitutes a feedback channel from the operation phase back into the design phase. An end-to-end flow, from problem detection to problem resolution, was showcased in Michael Ameling’s keynote at TechEd 2024. In this example, a memory problem was detected in the Inspect tool, and traced down to a Groovy script in one of the integration flows. The Script Optimization was used to improve memory consumption in that Groovy code, and after redeployment of the integration flow the Inspect feature confirmed that the memory bottleneck was resolved.

The Script Optimization feature is automating the proposals for improvements on resource consumption and compliance with best practices in Groovy scripts. This is achieved by using a LLM (large language model) that is grounded with best practices and design guidelines for integration content.

Following is a step-by-step description of how to use the feature.

 

Generative AI-Based Script Optimization

In order to use the feature, you have to display the integration flow in edit mode within Design view. When you open the Groovy code editor, the “Optimize” button is displayed:

The new “Optimize” button in the Groovy script editor

Clicking the “Optimize” button retrieves suggestions from Generative AI, which are based on best practices and design guidelines. The suggestions are shown in a “AI-Generated Review Report” after a short while:

The AI-Generated Review Report for the Groovy Script

This report consists of three parts:

General assessment
Either this assessment will confirm that the script adheres to guidelines and there would be no further suggestions for improvement. Otherwise it would summarise where the script might need improvement.

Recommended Changes
In this case the recommended changes are listed down, each coming with a title, explanation and a related code snippet.

Improved Script
Finally, a complete script is provided that showcases all of the above recommendations. Let’s reveal it by scrolling the report to the bottom:

The proposal for an improved script

The user can choose to adopt individual recommendations, or the complete improved script, by copying the respective sections in the report and pasting in the editor.

This feature is currently provided on the basis of free and fair usage option. Due to this, there will be a certain usage limit per tenant per calendar month for next 6 months. If you exhaust this limit, this will be notified via a message saying “The AI request could not be processed because you have reached your fair usage token quota.” when using the “Optimize” button. 

 

Conclusion

We introduced the Generative AI-based “Script Optimization” feature to help our customers optimizing their Groovy scripts for enterprise readiness by streamlining resource consumption and adhering to best practices. This feature facilitates the end-to-end action to insight cycle where issues at runtime are detected in the Inspect feature, traced to the root cause, are understood and fixed, and resolution can be ultimately validated in Inspect tool.

 

 

 

 

​ Authors: Marc Eiro, Mitko Kolev, Markus Muenkel, Syed Muhammad Kumail RazaProduct version 6.54 witnessed the first Generative AI feature to SAP Integration Suite, as described in the blog SAP Integration Suite – Generative AI based Integration Flow Generation. In product version 6.59 we are adding another Generative AI feature, which is dedicated to optimization of Groovy scripts. This feature is available with SAP Integration Suite, Premium Edition, on specific regions/data centres eu10, eu10-002, eu10-003, eu10-005, us10, us10-002. Roll-out has been performed in calendar week 50.The enablement of Generative AI features is documented in above blog and product documentation.  IntroductionIn our previous blog Inspecting and Understanding Resource Consumption of your Integration Content we explained how to inspect the resource consumption of the integration flows. The Inspect feature (see https://help.sap.com/docs/integration-suite/sap-integration-suite/inspect) enables understanding resource-related issues and helps in mitigation by proposing adjustments in the integration content. This effectively constitutes a feedback channel from the operation phase back into the design phase. An end-to-end flow, from problem detection to problem resolution, was showcased in Michael Ameling’s keynote at TechEd 2024. In this example, a memory problem was detected in the Inspect tool, and traced down to a Groovy script in one of the integration flows. The Script Optimization was used to improve memory consumption in that Groovy code, and after redeployment of the integration flow the Inspect feature confirmed that the memory bottleneck was resolved.The Script Optimization feature is automating the proposals for improvements on resource consumption and compliance with best practices in Groovy scripts. This is achieved by using a LLM (large language model) that is grounded with best practices and design guidelines for integration content.Following is a step-by-step description of how to use the feature. Generative AI-Based Script OptimizationIn order to use the feature, you have to display the integration flow in edit mode within Design view. When you open the Groovy code editor, the “Optimize” button is displayed:The new “Optimize” button in the Groovy script editorClicking the “Optimize” button retrieves suggestions from Generative AI, which are based on best practices and design guidelines. The suggestions are shown in a “AI-Generated Review Report” after a short while:The AI-Generated Review Report for the Groovy ScriptThis report consists of three parts:General assessmentEither this assessment will confirm that the script adheres to guidelines and there would be no further suggestions for improvement. Otherwise it would summarise where the script might need improvement.Recommended ChangesIn this case the recommended changes are listed down, each coming with a title, explanation and a related code snippet.Improved ScriptFinally, a complete script is provided that showcases all of the above recommendations. Let’s reveal it by scrolling the report to the bottom:The proposal for an improved scriptThe user can choose to adopt individual recommendations, or the complete improved script, by copying the respective sections in the report and pasting in the editor.This feature is currently provided on the basis of free and fair usage option. Due to this, there will be a certain usage limit per tenant per calendar month for next 6 months. If you exhaust this limit, this will be notified via a message saying “The AI request could not be processed because you have reached your fair usage token quota.” when using the “Optimize” button.  ConclusionWe introduced the Generative AI-based “Script Optimization” feature to help our customers optimizing their Groovy scripts for enterprise readiness by streamlining resource consumption and adhering to best practices. This feature facilitates the end-to-end action to insight cycle where issues at runtime are detected in the Inspect feature, traced to the root cause, are understood and fixed, and resolution can be ultimately validated in Inspect tool.      Read More Technology Blogs by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author