workflow_handler.go ×7

Frontier kind: Code frontier

unlabeled · c_07f65bce6d6a

7 tests · 4193 LOC · 206 files · introduces 0 tests · 52 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges52 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
690 ranges4193 lines · 206 files · Browse complete extent
All tests (intent)
7 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: 52 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/frontend/workflow_handler.go 48 introduced LOC · 7 ranges

Open complete file

5842 }
5843
5844 > inputPayload, err := payloads.Encode(input) workflow_handler.go
5845 > if err != nil {
5846 return nil, err
5847 }
5848
5849 > memo := &commonpb.Memo{ workflow_handler.go
5850 > Fields: map[string]*commonpb.Payload{
5851 > batcher.BatchOperationTypeMemo: payload.EncodeString(snakeCaseBatchType(input.BatchType)),
5852 > batcher.BatchReasonMemo: payload.EncodeString(request.GetReason()),
5853 > },
5854 > }
5855 > if len(visibilityQuery) > 0 {
5856 memo.Fields[batcher.BatchOperationVisibilityQueryMemo] = payload.EncodeString(visibilityQuery)
5857 }
5858 > if executions := batchOperationExecutionsFromRequest(request); len(executions) > 0 { workflow_handler.go
5859 executionsPayload, err := payload.Encode(executions)
5860 if err != nil {
5865
5866 // Add predefined search attributes
5867 > var searchAttributes *commonpb.SearchAttributes workflow_handler.go
5868 > searchattribute.AddSearchAttributes(
5869 > &searchAttributes,
5870 > chasm.SearchAttributeBatcherUser.Value(identity),
5871 > chasm.SearchAttributeTemporalNamespaceDivision.Value(batcher.NamespaceDivision),
5872 > )
5873 >
5874 > startReq := &workflowservice.StartWorkflowExecutionRequest{
5875 > Namespace: request.Namespace,
5876 > WorkflowId: request.GetJobId(),
5877 > WorkflowType: &commonpb.WorkflowType{Name: batcher.BatchWFTypeProtobufName},
5878 > TaskQueue: &taskqueuepb.TaskQueue{Name: primitives.PerNSWorkerTaskQueue},
5879 > Input: inputPayload,
5880 > Identity: identity,
5881 > RequestId: uuid.NewString(),
5882 > WorkflowIdConflictPolicy: enumspb.WORKFLOW_ID_CONFLICT_POLICY_FAIL,
5883 > WorkflowIdReusePolicy: enumspb.WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE,
5884 > Memo: memo,
5885 > SearchAttributes: searchAttributes,
5886 > Priority: &commonpb.Priority{}, // ie default priority
5887 > }
5888 >
5889 > _, err = wh.historyClient.StartWorkflowExecution(
5890 > ctx,
5891 > common.CreateHistoryStartWorkflowRequest(
5892 > namespaceID.String(),
5893 > startReq,
5894 > nil,
5895 > nil,
5896 > time.Now().UTC(),
5897 > ),
5898 > )
5899 > if err != nil {
5900 return nil, err
5901 }
5902 > return &workflowservice.StartBatchOperationResponse{}, nil workflow_handler.go
5903 }
5904
5944 // DescribeBatchOperation. It prefers TargetExecutions and falls back to the
5945 // deprecated Executions field, converting WorkflowExecution to Execution.
5946 > func batchOperationExecutionsFromRequest(request *workflowservice.StartBatchOperationRequest) []*commonpb.Execution { workflow_handler.go
5947 > if targetExecutions := request.GetTargetExecutions(); len(targetExecutions) > 0 {
5948 return targetExecutions
5949 }
5950 //nolint:staticcheck // SA1019: Executions is deprecated but still needed for backward compatibility
5951 > executions := request.GetExecutions() workflow_handler.go
5952 > if len(executions) == 0 {
5953 return nil
5954 }
go.temporal.io/server/common/searchattribute/search_attirbute.go 4 introduced LOC · 2 ranges

Open complete file

46 func AddSearchAttributes(saPtr **commonpb.SearchAttributes, sas ...chasm.SearchAttributeKeyValue) {
47 if *saPtr == nil {
48 > *saPtr = &commonpb.SearchAttributes{} search_attirbute.go
49 > }
50 if (*saPtr).IndexedFields == nil {
51 > (*saPtr).IndexedFields = make(map[string]*commonpb.Payload) search_attirbute.go
52 > }
53 for _, sa := range sas {
54 (*saPtr).IndexedFields[sa.Field] = sa.Value.MustEncode()