commands.go ×4

Frontier kind: Code frontier

unlabeled · c_bb82daca7d11

3 tests · 3564 LOC · 147 files · introduces 0 tests · 19 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges19 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
690 ranges3564 lines · 147 files · Browse complete extent
All tests (intent)
3 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 19 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/components/nexusoperations/workflow/commands.go 16 introduced LOC · 4 ranges

Open complete file

274 }
275
276 > if node != nil { commands.go
277 // TODO(bergundy): Remove this when operation auto-deletes itself on terminal state.
278 // Operation may already be in a terminal state because it doesn't yet delete itself. We don't want to accept
297 // The event will be applied before the completion since buffered events are reordered and put at the end of the
298 // batch, after command events from the workflow task.
299 > event := ms.AddHistoryEvent(enumspb.EVENT_TYPE_NEXUS_OPERATION_CANCEL_REQUESTED, func(he *historypb.HistoryEvent) { commands.go
300 > he.Attributes = &historypb.HistoryEvent_NexusOperationCancelRequestedEventAttributes{
301 > NexusOperationCancelRequestedEventAttributes: &historypb.NexusOperationCancelRequestedEventAttributes{
302 > ScheduledEventId: attrs.ScheduledEventId,
303 > WorkflowTaskCompletedEventId: workflowTaskCompletedEventID,
304 > },
305 > }
306 > he.UserMetadata = command.UserMetadata
307 > he.EventGroupMarkers = command.EventGroupMarkers
308 > })
309
310 > err = nexusoperations.CancelRequestedEventDefinition{}.Apply(ms.HSM(), event) commands.go
311 >
312 > // Cancel spawns a child Cancelation machine, if that machine already exists we got a duplicate cancelation request.
313 > if errors.Is(err, hsm.ErrStateMachineAlreadyExists) {
314 return chasmworkflow.FailWorkflowTaskError{
315 Cause: enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_NEXUS_OPERATION_ATTRIBUTES,
316 Message: fmt.Sprintf("cancelation was already requested for an operation with scheduled event ID %d", attrs.ScheduledEventId),
317 }
318 > } else if errors.Is(err, hsm.ErrStateMachineNotFound) { commands.go
319 // This may happen if there's a buffered completion. Ignore.
320 return nil
go.temporal.io/server/components/nexusoperations/events.go 3 introduced LOC · 2 ranges

Open complete file

45 }
46
47 > func (d CancelRequestedEventDefinition) Apply(root *hsm.Node, event *historypb.HistoryEvent) error { events.go
48 > _, err := transitionOperation(root, event, func(node *hsm.Node, o Operation) (hsm.TransitionOutput, error) {
49 return o.Cancel(node, event.EventTime.AsTime(), event.EventId)
50 })
51
52 > return err events.go
53 }
54