Chore: migrate to remote service without manual service#79
Closed
Schmarvinius wants to merge 34 commits into
Closed
Chore: migrate to remote service without manual service#79Schmarvinius wants to merge 34 commits into
Schmarvinius wants to merge 34 commits into
Conversation
…ode that creates sdkRow to separate method
…mputed, @readonly and remove logic from 'toSdkRow' method that was already executed elsewhere
…und and recommendations are therefore skipped
…FioriRecommendationHandler
… FioriRecommendationHandler
…s selected and false
…cluded in the select query returned by buildContextQuery
…x column for non-string single keys
Schmarvinius
marked this pull request as ready for review
June 17, 2026 13:52
Contributor
There was a problem hiding this comment.
The PR refactors the AICoreService interface and AICoreServiceImpl in favour of using the standard CAP RemoteService with typed EventContext emissions — a clean architectural improvement. Three substantive issues were found: a composite-key inconsistency in MockRecommendationClient, a potential IndexOutOfBoundsException in test helpers, and a fragile instanceof String value-based index-column resolution in RptInferenceClient that breaks when a key field is null.
PR Bot Information
Version: 1.25.0
- File Content Strategy: Full file content
- LLM:
anthropic--claude-4.6-sonnet - Correlation ID:
b93ea7ed-eaec-4cfa-b6f9-215da15b5070 - Event Trigger:
pull_request.ready_for_review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate AI Core Service to CAP Java
RemoteService♻️ Refactor: Removes the custom
AICoreServiceinterface andAICoreServiceImplclass, replacing them with a standard CAP JavaRemoteServiceauto-created by the framework'sRemoteServiceConfiguration. Callers now interact with the service by emitting typedEventContextinstances (ResourceGroupContext,DeploymentIdContext,InferenceClientContext) instead of calling methods on a custom service interface.Changes
Core API & Service Registration
AICore.java(new): Replaces the removedAICoreServiceinterface as the central constants holder forSERVICE_NAME,RESOURCE_GROUPS,DEPLOYMENTS, andCONFIGURATIONS.AICoreService.java(removed): Custom service interface eliminated.AICoreServiceImpl.java(removed): Custom service implementation eliminated.AICoreServiceConfiguration.java: Adds anenvironment()lifecycle phase that injects aRemoteServiceConfigfor "AICore" into the CAP runtime properties, enabling the framework to auto-create theRemoteService. Helper methods (hasAICoreModel,hasAICoreBinding,detectMultiTenancy) moved to the bottom of the class.Event Context Javadoc Updates
DeploymentIdContext.java,InferenceClientContext.java,ModelDeploymentSpec.java,ResourceGroupContext.java: Updated Javadoc references fromAICoreServicemethod calls to event-based descriptions.Handler
@ServiceNameUpdatesAICoreApiHandler,ActionHandler,ConfigurationHandler,DeploymentHandler,MockAICoreApiHandler,MockEntityHandler,ResourceGroupHandler: All@ServiceNameannotations updated fromAICoreService.DEFAULT_NAMEtoAICore.SERVICE_NAME.Recommendation Feature
FioriRecommendationHandler.java: Field type changed fromAICoreServicetoRemoteService;PersistenceServiceinjected via constructor instead of being looked up per-request; fixed a draft check guard; prediction flow refactored to passpredictionRow+contextRowsseparately.RecommendationConfiguration.java: Looks upRemoteServicebyAICore.SERVICE_NAME;resolveRptClientnow emits typed contexts;PersistenceServicenull check added.RecommendationContextBuilder.java: RemovedassembleRows/computeSyntheticKey/indexColumn/syntheticKeyNeeded;buildPredictRownow filters to allowed columns only; added@Core.Computed/@readonlyfilters for context columns; added@cds.odata.valuelist: falseexclusion for prediction elements.RecommendationClient.java: Interface method signature changed topredict(CdsData predictionRow, List<CdsData> contextRows, List<String> predictionColumns, List<String> keyNames).RecommendationClientResolver.java: Parameter type changed fromAICoreServicetoRemoteService.RptInferenceClient.java: Migrated to newpredictsignature; synthetic key logic (resolveIndexColumn,computeSyntheticKey,addSyntheticKeyIfNeeded) moved into this class;preparePredictRowadded;PREDICTconstant made public.Tests
RemoteServicefrom the catalog and emit typed event contexts instead of calling the old service interface methods.RptInferenceClientTest.java(new): Tests forresolveIndexColumnandcomputeSyntheticKeyhelper methods.FioriRecommendationHandlerTest.java: Added tests for@cds.odata.valuelist: falseexclusion and context query correctness.recommendations-test.cds: AddedBooksWithDisabledValueListentity andBooksWithDisabledValueListservice projection.Samples
AICoreShowcaseHandler.java,ai-core-service.cds,.cdsrc.json: Updated to useRemoteServicepattern and corrected CDS model import path.PR Bot Information
Version:
1.25.0b93ea7ed-eaec-4cfa-b6f9-215da15b5070anthropic--claude-4.6-sonnetpull_request.ready_for_review