task_generator.go ×6

Frontier kind: Code frontier

unlabeled · c_e37dfaa81b98

24 tests · 2909 LOC · 140 files · introduces 0 tests · 48 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges48 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
462 ranges2909 lines · 140 files · Browse complete extent
All tests (intent)
24 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: 48 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/workflow/task_generator.go 44 introduced LOC · 6 ranges

Open complete file

935 transitionCount int64,
936 task hsm.Task,
937 > ) error { task_generator.go
938 > ser, ok := stateMachineRegistry.TaskSerializer(task.Type())
939 > if !ok {
940 return serviceerror.NewInternalf("no task serializer for %v", task.Type())
941 }
942 > data, err := ser.Serialize(task) task_generator.go
943 > if err != nil {
944 return err
945 }
946 > ppath := make([]*persistencespb.StateMachineKey, len(subStateMachinePath)) task_generator.go
947 > for i, k := range subStateMachinePath {
948 > ppath[i] = &persistencespb.StateMachineKey{
949 > Type: k.Type,
950 > Id: k.ID,
951 > }
952 > }
953 > machineLastUpdateVersionedTransition := node.InternalRepr().GetLastUpdateVersionedTransition()
954 >
955 > currentVersionedTransition := mutableState.CurrentVersionedTransition()
956 > ref := &persistencespb.StateMachineRef{
957 > Path: ppath,
958 > MutableStateVersionedTransition: currentVersionedTransition,
959 > MachineInitialVersionedTransition: node.InternalRepr().GetInitialVersionedTransition(),
960 > MachineLastUpdateVersionedTransition: machineLastUpdateVersionedTransition,
961 > MachineTransitionCount: transitionCount,
962 > }
963 >
964 > // Task is invalid at generation time.
965 > // This may happen during replication when multiple event batches are applied in a single transaction.
966 > if err := task.Validate(ref, node); err != nil {
967 return nil
968 }
969
970 > taskInfo := &persistencespb.StateMachineTaskInfo{ task_generator.go
971 > Ref: ref,
972 > Type: task.Type(),
973 > Data: data,
974 > }
975 > // NOTE: at the moment deadline is mutually exclusive with destination.
976 > // This will change when we add the outbound timer queue.
977 > if task.Deadline() != hsm.Immediate {
978 if task.Destination() != "" {
979 // TODO: support outbound timer tasks.
981 }
982 TrackStateMachineTimer(mutableState, task.Deadline(), taskInfo)
983 > } else if task.Destination() != "" { task_generator.go
984 > mutableState.AddTasks(&tasks.StateMachineOutboundTask{
985 > StateMachineTask: tasks.StateMachineTask{
986 > WorkflowKey: mutableState.GetWorkflowKey(),
987 > Info: taskInfo,
988 > },
989 > Destination: task.Destination(),
990 > })
991 > } else {
992 // TODO: support "transfer" tasks - immediate without destination.
993 return fmt.Errorf("task has no deadline or destination")
994 }
995
996 > return nil task_generator.go
997 }
998
go.temporal.io/server/api/persistence/v1/hsm.pb.go 4 introduced LOC · 1 range

Open complete file

102 }
103
104 > func (x *StateMachineNode) GetInitialVersionedTransition() *VersionedTransition { hsm.pb.go
105 > if x != nil {
106 > return x.InitialVersionedTransition
107 > }
108 return nil
109 }