fix(workflows): handle path segments whose port is a container's collection port - #1023
Merged
Merged
Conversation
…ection port The instance viewer's journal selects nested activities by node id through DiagramDesignerWrapper.SelectActivityByActivityIdAsync, which fetches path segments from elsa-core's path-segments endpoint. For an activity nested inside a Flowchart or BpmnProcess container, that endpoint reports the hop with PortName set to the container's own "Activities" collection property rather than a named embedded port, which no port provider declares -- so resolving it threw before the segment could become a container to display or a breadcrumb to draw. Treat a collection-port segment as the container itself, and never throw while building a breadcrumb for an unmatched port. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
…readcrumb collection-port test The fixture used an empty BPMN scope, so the BPMN designer never mounted a canvas and the final SelectActivityByActivityIdAsync call was a silent no-op -- the test asserted only the displayed container and breadcrumb, and would still pass with selection missing or wrong. Give the process a minimal process payload binding the child activity to a BPMN element, and assert the selectBpmnElement JS interop invocation targets that element. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Closes #1018.
The defect, reproduced
Selecting an activity by id through the path the instance viewer uses (
SelectActivityByActivityIdAsync→GetPathSegmentsAsync) crashed the designer when the activity sat inside a container that is not a flowchart, such as aBpmnProcess. The server's path-segments endpoint names such a segment's port after the container's reflected child-list property,PortName = "Activities". That comes fromPropertyBasedActivityResolveroverContainer.Activities. No port provider yields that port, so:GetEmbeddedActivityresolved it through the embedded-port path and calledAsObject()on theactivitiesJSON array, throwingInvalidOperationException;GetBreadcrumbItemsdidports.First(...)on a port that does not exist.What changed
Both changes are in
DiagramDesignerWrapper.razor.cs:If.Then, a flowchart in a sequence) resolve as before.Verification
BreadcrumbCollectionPortSegmentTestsstubs the path segments in the exact shape elsa-core's endpoint returns and selects through the instance-viewer path. It fails before the fix withInvalidOperationExceptionand passes after, confirmed independently by the spec reviewer.Review: one iteration on the standards and spec axes. Recorded as won't-fix: the breadcrumb fallback is deliberately generic, as the issue asked; and a private helper's doc comment has no
<summary>tag, which the XML-doc rule only requires on public members.🤖 Generated with Claude Code