Joule on Business Application Studio
2023-11-8 02:58:46 Author: blogs.sap.com(查看原文) 阅读量:9 收藏

As a cloud integrated development environment, one of the main goals of SAP Business Application Studio is to provide productivity tools to help developers to create services and applications for SAP Business Technology Platform (BTP) more efficiently. With the emergence of Generative AI, it has become evident that it serves as a valuable productivity tool. Therefore, I would like to provide you with a brief overview of how SAP Business Application Studio incorporates Generative AI as Joule, a new introduced AI assistant within SAP that truly understands your business, enabling developers to enhance their productivity in conjunction with SAP Build Code.

In this blog, you will discover the changes made to regular development activities, with a particular focus on enhancing the development process for Cloud Application Programming (CAP) projects.

As of now, it is only available on the Build Code Business Application Studio pilot environment with AI feature enabled, and it will be finally available as an add-on service to SAP Build Code GA (Generally Available).

Let us build a customer loyalty application that can calculate and store reward points for customers based on their purchases. The purchase points are one tenth of the purchase value and are tracked for each customer. This is recorded along with basic contact data about the customer such as name, total points, total purchase value, number of purchases, and total points redeemed.

When you create a new project `lcapCustomerLoyalty` from Build Code lobby, the Business Application Studio will get launched with the Storyboard viewer opened.

To guide developers to use the Generative AI features more efficiently within Business Application Studio, a new guide `Generative AI-Powered Development` has been introduced into the Guide Center panel. So far, we support 4 main use cases that help you develop your application quickly.

Joule is activated by pressing the `Open Joule` button within the guide.

Besides the normal approach of manually modeling the data model with the CDS (Core Data Services) graphical modeler tool within Business Application Studio, this time we could ask Joule to generate it using a pure natural language prompt.

Typically, the response fully respecting the requirements will get returned, and it can be accepted directly to the working project, just by pressing the `Accept` button on the top-right corner of the code block within the response content. Storyboard will get refreshed automatically to reflect the newly generated result.

So, you can see that Joule within Business Application Studio not only generates code but also supports the visual modelers in SAP Business Application Studio, allowing users to continue using the existing visual editors.

Besides the generated data model and data service, contextual sample data also gets initialized based on the user’s prompt.

In addition, the UI annotations were also generated. This means that your application is ready, and you can do a quick preview for the generated content using the default Fiori Element preview application. For example, in this case with the support on association entity and date type input.

If you think the result is not good enough, you can also press the `Regenerate` button to see a different result with the same user prompt. As you may be aware, Joule does not consistently produce identical results. Instead, it often introduces slight variations to the generated output.

Or you can still refine your text by pressing the `Pencil` button beside the initial text and resend it.

Till now, we have seen the generation of CAP data models, sample data and UI annotations. Next, we shall see how we can customize the CAP service via application logic. This can also be done by Joule, which generates JavaScript code based on your prompt.

Within the graphical modeler editor, first select the service entity `Purchase`, and then press the `Add Logic` context menu.

Provide necessary information for the newly created application logic in natural language.

Map the new created application logic to standard CAP event as below within the Business Application Studio Application Logic editor.

Once the configuration is ready, the `Open Code Editor` button will be available to use.  Choose `Application Logic AI-enabled` item to ask Joule again for the custom logic implementation.

We could provide more detailed information to Joule for the generation, like below.

Joule returns a response based on the requirements. And once you press the `Accept` button, the corresponding file content will be updated directly.

Besides the `Regenerate` button and `Pencil` button on the initial text to do a reset, there is further support on the JavaScript code generation to improve the result using feedback message. You can ask Joule to generate the application logic one more time and get the improved response like below.

So, you see, it is a chat style conversation, all the history of your chat messages are sent along with the necessary project context information to the Generative AI model to generate the responses. However, when you think the history would be misleading, or the conversation has become too long, please reset the current conversation by pressing the panel top-right corner button. Then you could start your conversation from scratch once again.

Besides this, you can use the “Error Check” button to directly open the relevant log panel, such as `DEBUG CONSOLE`, to get the runtime errors. You can then copy the runtime error into Joule and Joule will generate an improved result for you.

In addition, besides the above shown scenarios, we also support the improvement on the existing sample data, and the unit test generation for the corresponding application logic. They all work similarly in this interactive chat style.

Leveraging Joule on Business Application Studio, it is just like you have an AI assistant who knows your business context and the latest SAP technology sitting beside you and happy to give you help at any time. While it may not deliver perfect results consistently, it provides a solid starting point and opportunities for learning. We hope you enjoy its benefits and seamlessly integrate it into your work process.

What’s next?

If this has you excited, we have many more exciting features in store for you in 2024.

Drop us an email at [email protected] or comment on this post to talk to us regarding all things SAP Business Application Studio.

Until next time, happy coding!


文章来源: https://blogs.sap.com/2023/11/07/joule-on-business-application-studio/
如有侵权请联系:admin#unsafe.sh