get_workflow_util.go ×5

Frontier kind: Code frontier

unlabeled · c_f2c060dc7fe3

26 tests · 5029 LOC · 197 files · introduces 0 tests · 59 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges59 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
858 ranges5029 lines · 197 files · Browse complete extent
All tests (intent)
26 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.

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

go.temporal.io/server/service/history/api/get_workflow_util.go 52 introduced LOC · 5 ranges

Open complete file

351 func MutableStateToGetResponse(
352 mutableState historyi.MutableState,
353 > ) (*historyservice.GetMutableStateResponse, error) { get_workflow_util.go
354 > // NOTE: fields of GetMutableStateResponse (returned value of this func)
355 > // are accessed outside of workflow lock, and, therefore,
356 > // ***MUST*** be copied by value from mutableState fields.
357 > // strings are immutable, []byte is also considered to be immutable.
358 >
359 > currentBranchToken, err := mutableState.GetCurrentBranchToken()
360 > if err != nil {
361 return nil, err
362 }
363
364 > executionInfo := mutableState.GetExecutionInfo() get_workflow_util.go
365 > workflowState, workflowStatus := mutableState.GetWorkflowStateStatus()
366 > lastFirstEventID, lastFirstEventTxnID := mutableState.GetLastFirstEventIDTxnID()
367 >
368 > var mostRecentWorkerVersionStamp *commonpb.WorkerVersionStamp
369 > if mrwvs := mutableState.GetExecutionInfo().GetMostRecentWorkerVersionStamp(); mrwvs != nil {
370 mostRecentWorkerVersionStamp = &commonpb.WorkerVersionStamp{
371 BuildId: mrwvs.GetBuildId(),
375
376 // Get transient/speculative workflow task events if present
377 > var transientOrSpeculativeTasks *historyspb.TransientWorkflowTaskInfo get_workflow_util.go
378 > if workflowTask := mutableState.GetPendingWorkflowTask(); workflowTask != nil {
379 transientOrSpeculativeTasks = mutableState.GetTransientWorkflowTaskInfo(workflowTask, "")
380 > } else if workflowTask := mutableState.GetStartedWorkflowTask(); workflowTask != nil { get_workflow_util.go
381 transientOrSpeculativeTasks = mutableState.GetTransientWorkflowTaskInfo(workflowTask, "")
382 }
383
384 > return &historyservice.GetMutableStateResponse{ get_workflow_util.go
385 > Execution: &commonpb.WorkflowExecution{
386 > WorkflowId: mutableState.GetExecutionInfo().WorkflowId,
387 > RunId: mutableState.GetExecutionState().RunId,
388 > },
389 > WorkflowType: &commonpb.WorkflowType{Name: executionInfo.WorkflowTypeName},
390 > LastFirstEventId: lastFirstEventID,
391 > LastFirstEventTxnId: lastFirstEventTxnID,
392 > NextEventId: mutableState.GetNextEventID(),
393 > PreviousStartedEventId: mutableState.GetLastCompletedWorkflowTaskStartedEventId(),
394 > TaskQueue: &taskqueuepb.TaskQueue{
395 > Name: executionInfo.TaskQueue,
396 > Kind: enumspb.TASK_QUEUE_KIND_NORMAL,
397 > },
398 > StickyTaskQueue: &taskqueuepb.TaskQueue{
399 > Name: executionInfo.StickyTaskQueue,
400 > Kind: enumspb.TASK_QUEUE_KIND_STICKY,
401 > NormalName: executionInfo.TaskQueue,
402 > },
403 > StickyTaskQueueScheduleToStartTimeout: executionInfo.StickyScheduleToStartTimeout,
404 > CurrentBranchToken: currentBranchToken,
405 > WorkflowState: workflowState,
406 > WorkflowStatus: workflowStatus,
407 > IsStickyTaskQueueEnabled: mutableState.IsStickyTaskQueueSet(),
408 > VersionHistories: versionhistory.CopyVersionHistories(
409 > mutableState.GetExecutionInfo().GetVersionHistories(),
410 > ),
411 > FirstExecutionRunId: executionInfo.FirstExecutionRunId,
412 > AssignedBuildId: mutableState.GetAssignedBuildId(),
413 > InheritedBuildId: mutableState.GetInheritedBuildId(),
414 > MostRecentWorkerVersionStamp: mostRecentWorkerVersionStamp,
415 > TransitionHistory: transitionhistory.CopyVersionedTransitions(mutableState.GetExecutionInfo().TransitionHistory),
416 > VersioningInfo: common.CloneProto(mutableState.GetExecutionInfo().VersioningInfo),
417 > TransientOrSpeculativeTasks: transientOrSpeculativeTasks,
418 > }, nil
419 }
go.temporal.io/server/api/persistence/v1/executions.pb.go 4 introduced LOC · 1 range

Open complete file

914 }
915
916 > func (x *WorkflowExecutionInfo) GetMostRecentWorkerVersionStamp() *v13.WorkerVersionStamp { executions.pb.go
917 > if x != nil {
918 > return x.MostRecentWorkerVersionStamp
919 > }
920 return nil
921 }
go.temporal.io/server/service/history/workflow/mutable_state_impl.go 3 introduced LOC · 1 range

Open complete file

2464 // GetLastFirstEventIDTxnID returns last first event ID and corresponding transaction ID
2465 // first event ID is the ID of a batch of events in a single history events record
2466 > func (ms *MutableStateImpl) GetLastFirstEventIDTxnID() (int64, int64) { mutable_state_impl.go
2467 > return ms.executionInfo.LastFirstEventId, ms.executionInfo.LastFirstEventTxnId
2468 > }
2469
2470 // GetNextEventID returns next event ID