Skip to content

Add resolved suggestions to CDS Hooks cards for nested actions - #1124

Open
ft9dipesh wants to merge 1 commit into
cqframework:mainfrom
ft9dipesh:fix-cds-hooks-nested-action-suggestions
Open

ft9dipesh wants to merge 1 commit into
cqframework:mainfrom
ft9dipesh:fix-cds-hooks-nested-action-suggestions

Conversation

@ft9dipesh

@ft9dipesh ft9dipesh commented Sep 23, 2026 •

Copy link
Copy Markdown

Problem

CdsResponseEncoderService.resolveAction resolves each child action of a selectionBehavior action via resolveSuggestion, but never adds the result to the card:

if (action.hasSelectionBehavior()) {
    card.setSelectionBehaviour(action.getSelectionBehavior());
    action.getAction().forEach(this::resolveSuggestion);
}

Any PlanDefinition with nested actions therefore produces a card with selectionBehavior set and no suggestions.

Fix

action.getAction().forEach(child -> card.addSuggestion(resolveSuggestion(child)));

Test

Added testResolveAction_shouldAddSuggestionsForNestedActionsWhenSelectionBehaviorIsSet to ResponseEncoderMethodResolveActionTest.

CdsResponseEncoderService.resolveAction resolved each child action of a
selectionBehavior action via resolveSuggestion but discarded the result,
so cards carried a selectionBehavior and no suggestions. Add each
resolved suggestion to the card.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant