api.go ×6

Frontier kind: Joint frontier

unlabeled · c_21a859a85109

1 test · 7780 LOC · 251 files · introduces 1 test · 42 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges42 lines · 3 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1588 ranges7780 lines · 251 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

3 files ranked by introduced lines: 42 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/api/terminateworkflow/api.go 35 introduced LOC · 6 ranges

Open complete file

18 shardContext historyi.ShardContext,
19 workflowConsistencyChecker api.WorkflowConsistencyChecker,
20 > ) (resp *historyservice.TerminateWorkflowExecutionResponse, retError error) { api.go
21 > namespaceEntry, err := api.GetActiveNamespace(shardContext, namespace.ID(req.GetNamespaceId()), req.TerminateRequest.WorkflowExecution.WorkflowId)
22 > if err != nil {
23 return nil, err
24 }
25 > namespaceID := namespaceEntry.ID() api.go
26 >
27 > request := req.TerminateRequest
28 > parentExecution := req.ExternalWorkflowExecution
29 > childWorkflowOnly := req.ChildWorkflowOnly
30 > workflowID := request.WorkflowExecution.WorkflowId
31 > runID := request.WorkflowExecution.RunId
32 > firstExecutionRunID := request.FirstExecutionRunId
33 > if len(request.FirstExecutionRunId) != 0 {
34 > runID = ""
35 > }
36
37 > err = api.GetAndUpdateWorkflowWithNew( api.go
38 > ctx,
39 > nil,
40 > definition.NewWorkflowKey(
41 > namespaceID.String(),
42 > workflowID,
43 > runID,
44 > ),
45 > func(workflowLease api.WorkflowLease) (*api.UpdateWorkflowAction, error) {
46 > mutableState := workflowLease.GetMutableState()
47 > if !mutableState.IsWorkflowExecutionRunning() {
48 return nil, consts.ErrWorkflowCompleted
49 }
53 // let's compare the FirstExecutionRunID on the request to make sure we terminate the correct workflow
54 // execution.
55 > executionInfo := mutableState.GetExecutionInfo() api.go
56 > if len(firstExecutionRunID) > 0 && executionInfo.FirstExecutionRunId != firstExecutionRunID {
57 return nil, consts.ErrWorkflowExecutionNotFound
58 }
59
60 > if childWorkflowOnly { api.go
61 > if parentExecution.GetWorkflowId() != executionInfo.ParentWorkflowId ||
62 > parentExecution.GetRunId() != executionInfo.ParentRunId {
63 > return nil, consts.ErrWorkflowParent
64 > }
65 }
66
78 workflowConsistencyChecker,
79 )
80 > if err != nil { api.go
81 > return nil, err
82 > }
83 return &historyservice.TerminateWorkflowExecutionResponse{}, nil
84 }
go.temporal.io/server/api/historyservice/v1/request_response.pb.go 4 introduced LOC · 1 range

Open complete file

3234 }
3235
3236 > func (x *TerminateWorkflowExecutionRequest) GetNamespaceId() string { request_response.pb.go
3237 > if x != nil {
3238 > return x.NamespaceId
3239 > }
3240 return ""
3241 }
go.temporal.io/server/service/history/history_engine.go 3 introduced LOC · 1 range

Open complete file

693 ctx context.Context,
694 req *historyservice.TerminateWorkflowExecutionRequest,
695 > ) (*historyservice.TerminateWorkflowExecutionResponse, error) { history_engine.go
696 > return terminateworkflow.Invoke(ctx, req, e.shardContext, e.workflowConsistencyChecker)
697 > }
698
699 func (e *historyEngineImpl) DeleteWorkflowExecution(