Following the blog post Product Updates for SAP Build Code – July 2024 Edition by @BirgitS. Use Joule to enhance your already existing data models and services is now supported in SAP Build Code, which enables the developers to enhance a specific data model and service back and forth contextually and incrementally. Please go through the blog post above for more details. In this blog post, I would like to showcase this feature with some practical uses.
As explained in the product update blog post, we can edit the data model or services with joule icon on the storyboard conveniently.
However, Joule on storyboard can't be activated if you have multiple data model files and service files, and it shows a tip about "you can only edit models or services if you have only one data file and one single service file" as screenshot below. No worry. Joule on Storyboard is essentially invoking a new slash command in Joule.
In 2024 July's update, several Slash commands are introduced into Joule in SAP Build Code as screenshot below. A slash command specifies and restricts the intent of the prompt for code generation instead of free-style, and the commands are displayed contextually based on the current opening file or editor.
Slash Commands for Application generation (Initial application generation)
Slash Commands with Specific Intents
We will focus on the /cap-edit-model slash command, which is the very function triggered by Joule icon on storyboard to edit the data model or service. The rest commands are just the evolution of previous features.
In the following scenario, let's assume a new developer Daniel has been assigned to maintain and enhance the customer loyalty management solution, which is initially generated with Joule in SAP Build Code in our previous blog post.
(For an existing CAP project isn't generated with Joule in SAP Build Code, please follow this blog post by MioYasutake to enable the support for existing CAP Projects in SAP Build Code, and note that manual migration of existing business logic are required for generated template of business logic by Joule in SAP Build Code.)
Daniel's needs and daily activities
Let's address Daniel's needs, and narrow down to enhance data model and services incrementally using slash /cap-edit-model with some practical uses below beyond editing the data model itself, as the rest are covered in our blog post about develop with Joule in SAP Build Code.
Import note: As the conversation with /cap-edit-model in Joule is contextual, therefore, more token may be used. Be aware of the limited monthly quota of AI requests per user for using Joule. Please make wise use of the tokens. For some explicit code changes, for example, set the length of string, adding a property etc, manual code editing or graphical modelling will be more efficient than Joule.
Demo Video:
With this contextual and incremental enhancement capability of existing CDS data model and services, Joule in SAP Build Code is extremely useful and helpful for maintaining and enhancing the existing CAP Data Model and Services with various practical uses beyond editing data model itself, such as code explanation, extracting design documentation, improving code readability, role-based code review, implementing best practices, pre-production check etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
13 | |
12 | |
11 | |
9 | |
9 | |
7 | |
5 | |
5 | |
5 |