go.uber.org/cadence@v1.2.9/internal/compatibility/testdata/decision.go (about)

     1  // Copyright (c) 2021 Uber Technologies Inc.
     2  //
     3  // Permission is hereby granted, free of charge, to any person obtaining a copy
     4  // of this software and associated documentation files (the "Software"), to deal
     5  // in the Software without restriction, including without limitation the rights
     6  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     7  // copies of the Software, and to permit persons to whom the Software is
     8  // furnished to do so, subject to the following conditions:
     9  //
    10  // The above copyright notice and this permission notice shall be included in all
    11  // copies or substantial portions of the Software.
    12  //
    13  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    14  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    15  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    16  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    17  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    18  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    19  // SOFTWARE.
    20  
    21  package testdata
    22  
    23  import (
    24  	apiv1 "github.com/uber/cadence-idl/go/proto/api/v1"
    25  )
    26  
    27  var (
    28  	DecisionArray = []*apiv1.Decision{
    29  		&Decision_CancelTimer,
    30  		&Decision_CancelWorkflowExecution,
    31  		&Decision_CompleteWorkflowExecution,
    32  		&Decision_ContinueAsNewWorkflowExecution,
    33  		&Decision_FailWorkflowExecution,
    34  		&Decision_RecordMarker,
    35  		&Decision_RequestCancelActivityTask,
    36  		&Decision_RequestCancelExternalWorkflowExecution,
    37  		&Decision_ScheduleActivityTask,
    38  		&Decision_SignalExternalWorkflowExecution,
    39  		&Decision_StartChildWorkflowExecution,
    40  		&Decision_StartTimer,
    41  		&Decision_UpsertWorkflowSearchAttributes,
    42  	}
    43  
    44  	Decision_CancelTimer = apiv1.Decision{Attributes: &apiv1.Decision_CancelTimerDecisionAttributes{
    45  		CancelTimerDecisionAttributes: &CancelTimerDecisionAttributes,
    46  	}}
    47  	Decision_CancelWorkflowExecution = apiv1.Decision{Attributes: &apiv1.Decision_CancelWorkflowExecutionDecisionAttributes{
    48  		CancelWorkflowExecutionDecisionAttributes: &CancelWorkflowExecutionDecisionAttributes,
    49  	}}
    50  	Decision_CompleteWorkflowExecution = apiv1.Decision{Attributes: &apiv1.Decision_CompleteWorkflowExecutionDecisionAttributes{
    51  		CompleteWorkflowExecutionDecisionAttributes: &CompleteWorkflowExecutionDecisionAttributes,
    52  	}}
    53  	Decision_ContinueAsNewWorkflowExecution = apiv1.Decision{Attributes: &apiv1.Decision_ContinueAsNewWorkflowExecutionDecisionAttributes{
    54  		ContinueAsNewWorkflowExecutionDecisionAttributes: &ContinueAsNewWorkflowExecutionDecisionAttributes,
    55  	}}
    56  	Decision_FailWorkflowExecution = apiv1.Decision{Attributes: &apiv1.Decision_FailWorkflowExecutionDecisionAttributes{
    57  		FailWorkflowExecutionDecisionAttributes: &FailWorkflowExecutionDecisionAttributes,
    58  	}}
    59  	Decision_RecordMarker = apiv1.Decision{Attributes: &apiv1.Decision_RecordMarkerDecisionAttributes{
    60  		RecordMarkerDecisionAttributes: &RecordMarkerDecisionAttributes,
    61  	}}
    62  	Decision_RequestCancelActivityTask = apiv1.Decision{Attributes: &apiv1.Decision_RequestCancelActivityTaskDecisionAttributes{
    63  		RequestCancelActivityTaskDecisionAttributes: &RequestCancelActivityTaskDecisionAttributes,
    64  	}}
    65  	Decision_RequestCancelExternalWorkflowExecution = apiv1.Decision{Attributes: &apiv1.Decision_RequestCancelExternalWorkflowExecutionDecisionAttributes{
    66  		RequestCancelExternalWorkflowExecutionDecisionAttributes: &RequestCancelExternalWorkflowExecutionDecisionAttributes,
    67  	}}
    68  	Decision_ScheduleActivityTask = apiv1.Decision{Attributes: &apiv1.Decision_ScheduleActivityTaskDecisionAttributes{
    69  		ScheduleActivityTaskDecisionAttributes: &ScheduleActivityTaskDecisionAttributes,
    70  	}}
    71  	Decision_SignalExternalWorkflowExecution = apiv1.Decision{Attributes: &apiv1.Decision_SignalExternalWorkflowExecutionDecisionAttributes{
    72  		SignalExternalWorkflowExecutionDecisionAttributes: &SignalExternalWorkflowExecutionDecisionAttributes,
    73  	}}
    74  	Decision_StartChildWorkflowExecution = apiv1.Decision{Attributes: &apiv1.Decision_StartChildWorkflowExecutionDecisionAttributes{
    75  		StartChildWorkflowExecutionDecisionAttributes: &StartChildWorkflowExecutionDecisionAttributes,
    76  	}}
    77  	Decision_StartTimer = apiv1.Decision{Attributes: &apiv1.Decision_StartTimerDecisionAttributes{
    78  		StartTimerDecisionAttributes: &StartTimerDecisionAttributes,
    79  	}}
    80  	Decision_UpsertWorkflowSearchAttributes = apiv1.Decision{Attributes: &apiv1.Decision_UpsertWorkflowSearchAttributesDecisionAttributes{
    81  		UpsertWorkflowSearchAttributesDecisionAttributes: &UpsertWorkflowSearchAttributesDecisionAttributes,
    82  	}}
    83  
    84  	CancelTimerDecisionAttributes = apiv1.CancelTimerDecisionAttributes{
    85  		TimerId: TimerID,
    86  	}
    87  	CancelWorkflowExecutionDecisionAttributes = apiv1.CancelWorkflowExecutionDecisionAttributes{
    88  		Details: &Payload1,
    89  	}
    90  	CompleteWorkflowExecutionDecisionAttributes = apiv1.CompleteWorkflowExecutionDecisionAttributes{
    91  		Result: &Payload1,
    92  	}
    93  	ContinueAsNewWorkflowExecutionDecisionAttributes = apiv1.ContinueAsNewWorkflowExecutionDecisionAttributes{
    94  		WorkflowType:                 &WorkflowType,
    95  		TaskList:                     &TaskList,
    96  		Input:                        &Payload1,
    97  		ExecutionStartToCloseTimeout: Duration1,
    98  		TaskStartToCloseTimeout:      Duration2,
    99  		BackoffStartInterval:         Duration3,
   100  		RetryPolicy:                  &RetryPolicy,
   101  		Initiator:                    ContinueAsNewInitiator,
   102  		Failure:                      &Failure,
   103  		LastCompletionResult:         &Payload2,
   104  		CronSchedule:                 CronSchedule,
   105  		Header:                       &Header,
   106  		Memo:                         &Memo,
   107  		SearchAttributes:             &SearchAttributes,
   108  		JitterStart:                  Duration4,
   109  	}
   110  	FailWorkflowExecutionDecisionAttributes = apiv1.FailWorkflowExecutionDecisionAttributes{
   111  		Failure: &Failure,
   112  	}
   113  	RecordMarkerDecisionAttributes = apiv1.RecordMarkerDecisionAttributes{
   114  		MarkerName: MarkerName,
   115  		Details:    &Payload1,
   116  		Header:     &Header,
   117  	}
   118  	RequestCancelActivityTaskDecisionAttributes = apiv1.RequestCancelActivityTaskDecisionAttributes{
   119  		ActivityId: ActivityID,
   120  	}
   121  	RequestCancelExternalWorkflowExecutionDecisionAttributes = apiv1.RequestCancelExternalWorkflowExecutionDecisionAttributes{
   122  		Domain:            DomainName,
   123  		WorkflowExecution: &WorkflowExecution,
   124  		Control:           Control,
   125  		ChildWorkflowOnly: true,
   126  	}
   127  	ScheduleActivityTaskDecisionAttributes = apiv1.ScheduleActivityTaskDecisionAttributes{
   128  		ActivityId:             ActivityID,
   129  		ActivityType:           &ActivityType,
   130  		Domain:                 DomainName,
   131  		TaskList:               &TaskList,
   132  		Input:                  &Payload1,
   133  		ScheduleToCloseTimeout: Duration1,
   134  		ScheduleToStartTimeout: Duration2,
   135  		StartToCloseTimeout:    Duration3,
   136  		HeartbeatTimeout:       Duration4,
   137  		RetryPolicy:            &RetryPolicy,
   138  		Header:                 &Header,
   139  		RequestLocalDispatch:   true,
   140  	}
   141  	SignalExternalWorkflowExecutionDecisionAttributes = apiv1.SignalExternalWorkflowExecutionDecisionAttributes{
   142  		Domain:            DomainName,
   143  		WorkflowExecution: &WorkflowExecution,
   144  		SignalName:        SignalName,
   145  		Input:             &Payload1,
   146  		Control:           Control,
   147  		ChildWorkflowOnly: true,
   148  	}
   149  	StartChildWorkflowExecutionDecisionAttributes = apiv1.StartChildWorkflowExecutionDecisionAttributes{
   150  		Domain:                       DomainName,
   151  		WorkflowId:                   WorkflowID,
   152  		WorkflowType:                 &WorkflowType,
   153  		TaskList:                     &TaskList,
   154  		Input:                        &Payload1,
   155  		ExecutionStartToCloseTimeout: Duration1,
   156  		TaskStartToCloseTimeout:      Duration2,
   157  		ParentClosePolicy:            ParentClosePolicy,
   158  		Control:                      Control,
   159  		WorkflowIdReusePolicy:        WorkflowIDReusePolicy,
   160  		RetryPolicy:                  &RetryPolicy,
   161  		CronSchedule:                 CronSchedule,
   162  		Header:                       &Header,
   163  		Memo:                         &Memo,
   164  		SearchAttributes:             &SearchAttributes,
   165  	}
   166  	StartTimerDecisionAttributes = apiv1.StartTimerDecisionAttributes{
   167  		TimerId:            TimerID,
   168  		StartToFireTimeout: Duration1,
   169  	}
   170  	UpsertWorkflowSearchAttributesDecisionAttributes = apiv1.UpsertWorkflowSearchAttributesDecisionAttributes{
   171  		SearchAttributes: &SearchAttributes,
   172  	}
   173  )