/
protocol.go
1338 lines (1183 loc) · 71.4 KB
/
protocol.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package swf
import (
"bytes"
"fmt"
"strconv"
"time"
)
// ErrorResponse models the swf json protocol.
type ErrorResponse struct {
StatusCode int
Type string `json:"__type"`
Message string `json:"message"`
}
// constants for various SWF and Kinesis status and error codes.
const (
StatusRegistered = "REGISTERED"
StatusDeprecated = "DEPRECATED"
ErrorTypeUnknownResourceFault = "com.amazonaws.swf.base.model#UnknownResourceFault"
ErrorTypeWorkflowExecutionAlreadyStartedFault = "com.amazonaws.swf.base.model#WorkflowExecutionAlreadyStartedFault"
ErrorTypeStreamNotFound = "ResourceNotFoundException"
)
func (err *ErrorResponse) Error() string {
return err.Type + ": " + err.Message
}
// StartWorkflowRequest models the swf json protocol.
type StartWorkflowRequest struct {
ChildPolicy string `json:"childPolicy,omitempty"`
Domain string `json:"domain"`
ExecutionStartToCloseTimeout string `json:"executionStartToCloseTimeout,omitempty"`
Input string `json:"input,omitempty"`
TagList []string `json:"tagList,omitempty"`
TaskList *TaskList `json:"taskList,omitempty"`
TaskStartToCloseTimeout string `json:"taskStartToCloseTimeout,omitempty"`
WorkflowID string `json:"workflowId"`
WorkflowType WorkflowType `json:"workflowType"`
}
// StartWorkflowResponse models the swf json protocol.
type StartWorkflowResponse struct {
RunID string `json:"runId"`
}
// RequestCancelWorkflowExecution models the swf json protocol.
type RequestCancelWorkflowExecution struct {
Domain string `json:"domain"`
RunID string `json:"runId,omitempty"`
WorkflowID string `json:"workflowId"`
}
// SignalWorkflowRequest models the swf json protocol.
type SignalWorkflowRequest struct {
Domain string `json:"domain"`
Input string `json:"input,omitempty"`
RunID string `json:"runId,omitempty"`
SignalName string `json:"signalName"`
WorkflowID string `json:"workflowId"`
}
// ListWorkflowTypesRequest models the swf json protocol.
type ListWorkflowTypesRequest struct {
Domain string `json:"domain"`
MaximumPageSize int `json:"maximumPageSize,omitempty"`
Name string `json:"name,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
RegistrationStatus string `json:"registrationStatus"`
ReverseOrder bool `json:"reverseOrder,omitempty"`
}
// ListWorkflowTypesResponse models the swf json protocol.
type ListWorkflowTypesResponse struct {
NextPageToken string `json:"nextPageToken,omitempty"`
TypeInfos []WorkflowTypeInfo `json:"typeInfos"`
}
// TerminateWorkflowExecution models the swf json protocol.
type TerminateWorkflowExecution struct {
ChildPolicy string `json:"childPolicy,omitempty"`
Details string `json:"details,omitempty"`
Domain string `json:"domain"`
Reason string `json:"reason,omitempty"`
RunID string `json:"runId,omitempty"`
WorkflowID string `json:"workflowId,omitempty"`
}
/*DecisionWorkerProtocol*/
// PollForDecisionTaskRequest models the swf json protocol.
type PollForDecisionTaskRequest struct {
Domain string `json:"domain"`
Identity string `json:"identity,omitempty"`
MaximumPageSize int `json:"maximumPageSize,omitempty"`
NextPageToken string `json:"nextPageToken,omitempty"`
ReverseOrder bool `json:"reverseOrder,omitempty"`
TaskList TaskList `json:"taskList"`
}
// PollForDecisionTaskResponse models the swf json protocol.
type PollForDecisionTaskResponse struct {
Events []HistoryEvent `json:"events"`
NextPageToken string `json:"nextPageToken"`
PreviousStartedEventID int `json:"previousStartedEventId"`
StartedEventID int `json:"startedEventId"`
TaskToken string `json:"taskToken"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
WorkflowType WorkflowType `json:"workflowType"`
}
// EventType := WorkflowExecutionStarted | WorkflowExecutionCancelRequested | WorkflowExecutionCompleted | CompleteWorkflowExecutionFailed | WorkflowExecutionFailed | FailWorkflowExecutionFailed |
// WorkflowExecutionTimedOut | WorkflowExecutionCanceled | CancelWorkflowExecutionFailed | WorkflowExecutionContinuedAsNew | ContinueAsNewWorkflowExecutionFailed | WorkflowExecutionTerminated |
// DecisionTaskScheduled | DecisionTaskStarted | DecisionTaskCompleted | DecisionTaskTimedOut | ActivityTaskScheduled | ScheduleActivityTaskFailed | ActivityTaskStarted | ActivityTaskCompleted |
// ActivityTaskFailed | ActivityTaskTimedOut | ActivityTaskCanceled | ActivityTaskCancelRequested | RequestCancelActivityTaskFailed | WorkflowExecutionSignaled | MarkerRecorded | RecordMarkerFailed |
// TimerStarted | StartTimerFailed | TimerFired | TimerCanceled | CancelTimerFailed | StartChildWorkflowExecutionInitiated | StartChildWorkflowExecutionFailed | ChildWorkflowExecutionStarted |
// ChildWorkflowExecutionCompleted | ChildWorkflowExecutionFailed | ChildWorkflowExecutionTimedOut | ChildWorkflowExecutionCanceled | ChildWorkflowExecutionTerminated | SignalExternalWorkflowExecutionInitiated |
// SignalExternalWorkflowExecutionFailed | ExternalWorkflowExecutionSignaled | RequestCancelExternalWorkflowExecutionInitiated | RequestCancelExternalWorkflowExecutionFailed | ExternalWorkflowExecutionCancelRequested
// Valid values for the field EventType in the HistoryEvent struct.
const (
EventTypeWorkflowExecutionStarted = "WorkflowExecutionStarted"
EventTypeWorkflowExecutionCancelRequested = "WorkflowExecutionCancelRequested"
EventTypeWorkflowExecutionCompleted = "WorkflowExecutionCompleted"
EventTypeCompleteWorkflowExecutionFailed = "CompleteWorkflowExecutionFailed"
EventTypeWorkflowExecutionFailed = "WorkflowExecutionFailed"
EventTypeFailWorkflowExecutionFailed = "FailWorkflowExecutionFailed"
EventTypeWorkflowExecutionTimedOut = "WorkflowExecutionTimedOut"
EventTypeWorkflowExecutionCanceled = "WorkflowExecutionCanceled"
EventTypeCancelWorkflowExecutionFailed = "CancelWorkflowExecutionFailed"
EventTypeWorkflowExecutionContinuedAsNew = "WorkflowExecutionContinuedAsNew"
EventTypeContinueAsNewWorkflowExecutionFailed = "ContinueAsNewWorkflowExecutionFailed"
EventTypeWorkflowExecutionTerminated = "WorkflowExecutionTerminated"
EventTypeDecisionTaskScheduled = "DecisionTaskScheduled"
EventTypeDecisionTaskStarted = "DecisionTaskStarted"
EventTypeDecisionTaskCompleted = "DecisionTaskCompleted"
EventTypeDecisionTaskTimedOut = "DecisionTaskTimedOut"
EventTypeActivityTaskScheduled = "ActivityTaskScheduled"
EventTypeScheduleActivityTaskFailed = "ScheduleActivityTaskFailed"
EventTypeActivityTaskStarted = "ActivityTaskStarted"
EventTypeActivityTaskCompleted = "ActivityTaskCompleted"
EventTypeActivityTaskFailed = "ActivityTaskFailed"
EventTypeActivityTaskTimedOut = "ActivityTaskTimedOut"
EventTypeActivityTaskCanceled = "ActivityTaskCanceled"
EventTypeActivityTaskCancelRequested = "ActivityTaskCancelRequested"
EventTypeRequestCancelActivityTaskFailed = "RequestCancelActivityTaskFailed"
EventTypeWorkflowExecutionSignaled = "WorkflowExecutionSignaled"
EventTypeMarkerRecorded = "MarkerRecorded"
EventTypeRecordMarkerFailed = "RecordMarkerFailed"
EventTypeTimerStarted = "TimerStarted"
EventTypeStartTimerFailed = "StartTimerFailed"
EventTypeTimerFired = "TimerFired"
EventTypeTimerCanceled = "TimerCanceled"
EventTypeCancelTimerFailed = "CancelTimerFailed"
EventTypeStartChildWorkflowExecutionInitiated = "StartChildWorkflowExecutionInitiated"
EventTypeStartChildWorkflowExecutionFailed = "StartChildWorkflowExecutionFailed"
EventTypeChildWorkflowExecutionStarted = "ChildWorkflowExecutionStarted"
EventTypeChildWorkflowExecutionCompleted = "ChildWorkflowExecutionCompleted"
EventTypeChildWorkflowExecutionFailed = "ChildWorkflowExecutionFailed"
EventTypeChildWorkflowExecutionTimedOut = "ChildWorkflowExecutionTimedOut"
EventTypeChildWorkflowExecutionCanceled = "ChildWorkflowExecutionCanceled"
EventTypeChildWorkflowExecutionTerminated = "ChildWorkflowExecutionTerminated"
EventTypeSignalExternalWorkflowExecutionInitiated = "SignalExternalWorkflowExecutionInitiated"
EventTypeSignalExternalWorkflowExecutionFailed = "SignalExternalWorkflowExecutionFailed"
EventTypeExternalWorkflowExecutionSignaled = "ExternalWorkflowExecutionSignaled"
EventTypeRequestCancelExternalWorkflowExecutionInitiated = "RequestCancelExternalWorkflowExecutionInitiated"
EventTypeRequestCancelExternalWorkflowExecutionFailed = "RequestCancelExternalWorkflowExecutionFailed"
EventTypeExternalWorkflowExecutionCancelRequested = "ExternalWorkflowExecutionCancelRequested"
)
var eventTypes = map[string]func(HistoryEvent) interface{}{
EventTypeWorkflowExecutionStarted: func(h HistoryEvent) interface{} { return h.WorkflowExecutionStartedEventAttributes },
EventTypeWorkflowExecutionCancelRequested: func(h HistoryEvent) interface{} { return h.WorkflowExecutionCancelRequestedEventAttributes },
EventTypeWorkflowExecutionCompleted: func(h HistoryEvent) interface{} { return h.WorkflowExecutionCompletedEventAttributes },
EventTypeCompleteWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.CompleteWorkflowExecutionFailedEventAttributes },
EventTypeWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.WorkflowExecutionFailedEventAttributes },
EventTypeFailWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.FailWorkflowExecutionFailedEventAttributes },
EventTypeWorkflowExecutionTimedOut: func(h HistoryEvent) interface{} { return h.WorkflowExecutionTimedOutEventAttributes },
EventTypeWorkflowExecutionCanceled: func(h HistoryEvent) interface{} { return h.WorkflowExecutionCanceledEventAttributes },
EventTypeCancelWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.CancelWorkflowExecutionFailedEventAttributes },
EventTypeWorkflowExecutionContinuedAsNew: func(h HistoryEvent) interface{} { return h.WorkflowExecutionContinuedAsNewEventAttributes },
EventTypeContinueAsNewWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.ContinueAsNewWorkflowExecutionFailedEventAttributes },
EventTypeWorkflowExecutionTerminated: func(h HistoryEvent) interface{} { return h.WorkflowExecutionTerminatedEventAttributes },
EventTypeDecisionTaskScheduled: func(h HistoryEvent) interface{} { return h.DecisionTaskScheduledEventAttributes },
EventTypeDecisionTaskStarted: func(h HistoryEvent) interface{} { return h.DecisionTaskStartedEventAttributes },
EventTypeDecisionTaskCompleted: func(h HistoryEvent) interface{} { return h.DecisionTaskCompletedEventAttributes },
EventTypeDecisionTaskTimedOut: func(h HistoryEvent) interface{} { return h.DecisionTaskTimedOutEventAttributes },
EventTypeActivityTaskScheduled: func(h HistoryEvent) interface{} { return h.ActivityTaskScheduledEventAttributes },
EventTypeScheduleActivityTaskFailed: func(h HistoryEvent) interface{} { return h.ScheduleActivityTaskFailedEventAttributes },
EventTypeActivityTaskStarted: func(h HistoryEvent) interface{} { return h.ActivityTaskStartedEventAttributes },
EventTypeActivityTaskCompleted: func(h HistoryEvent) interface{} { return h.ActivityTaskCompletedEventAttributes },
EventTypeActivityTaskFailed: func(h HistoryEvent) interface{} { return h.ActivityTaskFailedEventAttributes },
EventTypeActivityTaskTimedOut: func(h HistoryEvent) interface{} { return h.ActivityTaskTimedOutEventAttributes },
EventTypeActivityTaskCanceled: func(h HistoryEvent) interface{} { return h.ActivityTaskCanceledEventAttributes },
EventTypeActivityTaskCancelRequested: func(h HistoryEvent) interface{} { return h.ActivityTaskCancelRequestedEventAttributes },
EventTypeRequestCancelActivityTaskFailed: func(h HistoryEvent) interface{} { return h.RequestCancelActivityTaskFailedEventAttributes },
EventTypeWorkflowExecutionSignaled: func(h HistoryEvent) interface{} { return h.WorkflowExecutionSignaledEventAttributes },
EventTypeMarkerRecorded: func(h HistoryEvent) interface{} { return h.MarkerRecordedEventAttributes },
EventTypeRecordMarkerFailed: func(h HistoryEvent) interface{} { return h.RecordMarkerFailedEventAttributes },
EventTypeTimerStarted: func(h HistoryEvent) interface{} { return h.TimerStartedEventAttributes },
EventTypeStartTimerFailed: func(h HistoryEvent) interface{} { return h.StartTimerFailedEventAttributes },
EventTypeTimerFired: func(h HistoryEvent) interface{} { return h.TimerFiredEventAttributes },
EventTypeTimerCanceled: func(h HistoryEvent) interface{} { return h.TimerCanceledEventAttributes },
EventTypeCancelTimerFailed: func(h HistoryEvent) interface{} { return h.CancelTimerFailedEventAttributes },
EventTypeStartChildWorkflowExecutionInitiated: func(h HistoryEvent) interface{} { return h.StartChildWorkflowExecutionInitiatedEventAttributes },
EventTypeStartChildWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.StartChildWorkflowExecutionFailedEventAttributes },
EventTypeChildWorkflowExecutionStarted: func(h HistoryEvent) interface{} { return h.ChildWorkflowExecutionStartedEventAttributes },
EventTypeChildWorkflowExecutionCompleted: func(h HistoryEvent) interface{} { return h.ChildWorkflowExecutionCompletedEventAttributes },
EventTypeChildWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.ChildWorkflowExecutionFailedEventAttributes },
EventTypeChildWorkflowExecutionTimedOut: func(h HistoryEvent) interface{} { return h.ChildWorkflowExecutionTimedOutEventAttributes },
EventTypeChildWorkflowExecutionCanceled: func(h HistoryEvent) interface{} { return h.ChildWorkflowExecutionCanceledEventAttributes },
EventTypeChildWorkflowExecutionTerminated: func(h HistoryEvent) interface{} { return h.ChildWorkflowExecutionTerminatedEventAttributes },
EventTypeSignalExternalWorkflowExecutionInitiated: func(h HistoryEvent) interface{} { return h.SignalExternalWorkflowExecutionInitiatedEventAttributes },
EventTypeSignalExternalWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.SignalExternalWorkflowExecutionFailedEventAttributes },
EventTypeExternalWorkflowExecutionSignaled: func(h HistoryEvent) interface{} { return h.ExternalWorkflowExecutionSignaledEventAttributes },
EventTypeRequestCancelExternalWorkflowExecutionInitiated: func(h HistoryEvent) interface{} {
return h.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
},
EventTypeRequestCancelExternalWorkflowExecutionFailed: func(h HistoryEvent) interface{} { return h.RequestCancelExternalWorkflowExecutionFailedEventAttributes },
EventTypeExternalWorkflowExecutionCancelRequested: func(h HistoryEvent) interface{} { return h.ExternalWorkflowExecutionCancelRequestedEventAttributes },
}
// HistoryEvent models the swf json protocol.
type HistoryEvent struct {
ActivityTaskCancelRequestedEventAttributes *ActivityTaskCancelRequestedEventAttributes `json:"activityTaskCancelRequestedEventAttributes,omitempty"`
ActivityTaskCanceledEventAttributes *ActivityTaskCanceledEventAttributes `json:"activityTaskCanceledEventAttributes,omitempty"`
ActivityTaskCompletedEventAttributes *ActivityTaskCompletedEventAttributes `json:"activityTaskCompletedEventAttributes,omitempty"`
ActivityTaskFailedEventAttributes *ActivityTaskFailedEventAttributes `json:"activityTaskFailedEventAttributes,omitempty"`
ActivityTaskScheduledEventAttributes *ActivityTaskScheduledEventAttributes `json:"activityTaskScheduledEventAttributes,omitempty"`
ActivityTaskStartedEventAttributes *ActivityTaskStartedEventAttributes `json:"activityTaskStartedEventAttributes,omitempty"`
ActivityTaskTimedOutEventAttributes *ActivityTaskTimedOutEventAttributes `json:"activityTaskTimedOutEventAttributes,omitempty"`
CancelTimerFailedEventAttributes *CancelTimerFailedEventAttributes `json:"cancelTimerFailedEventAttributes,omitempty"`
CancelWorkflowExecutionFailedEventAttributes *CancelWorkflowExecutionFailedEventAttributes `json:"cancelWorkflowExecutionFailedEventAttributes,omitempty"`
ChildWorkflowExecutionCanceledEventAttributes *ChildWorkflowExecutionCanceledEventAttributes `json:"childWorkflowExecutionCanceledEventAttributes,omitempty"`
ChildWorkflowExecutionCompletedEventAttributes *ChildWorkflowExecutionCompletedEventAttributes `json:"childWorkflowExecutionCompletedEventAttributes,omitempty"`
ChildWorkflowExecutionFailedEventAttributes *CancelWorkflowExecutionFailedEventAttributes `json:"childWorkflowExecutionFailedEventAttributes,omitempty"`
ChildWorkflowExecutionStartedEventAttributes *ChildWorkflowExecutionStartedEventAttributes `json:"childWorkflowExecutionStartedEventAttributes,omitempty"`
ChildWorkflowExecutionTerminatedEventAttributes *ChildWorkflowExecutionTerminatedEventAttributes `json:"childWorkflowExecutionTerminatedEventAttributes,omitempty"`
ChildWorkflowExecutionTimedOutEventAttributes *ChildWorkflowExecutionTimedOutEventAttributes `json:"childWorkflowExecutionTimedOutEventAttributes,omitempty"`
CompleteWorkflowExecutionFailedEventAttributes *CompleteWorkflowExecutionFailedEventAttributes `json:"completeWorkflowExecutionFailedEventAttributes,omitempty"`
ContinueAsNewWorkflowExecutionFailedEventAttributes *ContinueAsNewWorkflowExecutionFailedEventAttributes `json:"continueAsNewWorkflowExecutionFailedEventAttributes,omitempty"`
DecisionTaskCompletedEventAttributes *DecisionTaskCompletedEventAttributes `json:"decisionTaskCompletedEventAttributes,omitempty"`
DecisionTaskScheduledEventAttributes *DecisionTaskScheduledEventAttributes `json:"decisionTaskScheduledEventAttributes,omitempty"`
DecisionTaskStartedEventAttributes *DecisionTaskStartedEventAttributes `json:"decisionTaskStartedEventAttributes,omitempty"`
DecisionTaskTimedOutEventAttributes *DecisionTaskTimedOutEventAttributes `json:"decisionTaskTimedOutEventAttributes,omitempty"`
EventID int `json:"eventId"`
EventTimestamp *Date `json:"eventTimestamp"`
EventType string `json:"eventType"`
ExternalWorkflowExecutionCancelRequestedEventAttributes *ExternalWorkflowExecutionCancelRequestedEventAttributes `json:"externalWorkflowExecutionCancelRequestedEventAttributes,omitempty"`
ExternalWorkflowExecutionSignaledEventAttributes *ExternalWorkflowExecutionSignaledEventAttributes `json:"externalWorkflowExecutionSignaledEventAttributes,omitempty"`
FailWorkflowExecutionFailedEventAttributes *FailWorkflowExecutionFailedEventAttributes `json:"failWorkflowExecutionFailedEventAttributes,omitempty"`
MarkerRecordedEventAttributes *MarkerRecordedEventAttributes `json:"markerRecordedEventAttributes,omitempty"`
RecordMarkerFailedEventAttributes *RecordMarkerFailedEventAttributes `json:"recordMarkerFailedEventAttributes,omitempty"`
RequestCancelActivityTaskFailedEventAttributes *RequestCancelActivityTaskFailedEventAttributes `json:"requestCancelActivityTaskFailedEventAttributes,omitempty"`
RequestCancelExternalWorkflowExecutionFailedEventAttributes *RequestCancelExternalWorkflowExecutionFailedEventAttributes `json:"requestCancelExternalWorkflowExecutionFailedEventAttributes,omitempty"`
RequestCancelExternalWorkflowExecutionInitiatedEventAttributes *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes `json:"requestCancelExternalWorkflowExecutionInitiatedEventAttributes,omitempty"`
ScheduleActivityTaskFailedEventAttributes *ScheduleActivityTaskFailedEventAttributes `json:"scheduleActivityTaskFailedEventAttributes,omitempty"`
SignalExternalWorkflowExecutionFailedEventAttributes *SignalExternalWorkflowExecutionFailedEventAttributes `json:"signalExternalWorkflowExecutionFailedEventAttributes,omitempty"`
SignalExternalWorkflowExecutionInitiatedEventAttributes *SignalExternalWorkflowExecutionInitiatedEventAttributes `json:"signalExternalWorkflowExecutionInitiatedEventAttributes,omitempty"`
StartChildWorkflowExecutionFailedEventAttributes *StartChildWorkflowExecutionFailedEventAttributes `json:"startChildWorkflowExecutionFailedEventAttributes,omitempty"`
StartChildWorkflowExecutionInitiatedEventAttributes *StartChildWorkflowExecutionInitiatedEventAttributes `json:"startChildWorkflowExecutionInitiatedEventAttributes,omitempty"`
StartTimerFailedEventAttributes *StartTimerFailedEventAttributes `json:"startTimerFailedEventAttributes,omitempty"`
TimerCanceledEventAttributes *TimerCanceledEventAttributes `json:"timerCanceledEventAttributes,omitempty"`
TimerFiredEventAttributes *TimerFiredEventAttributes `json:"timerFiredEventAttributes,omitempty"`
TimerStartedEventAttributes *TimerStartedEventAttributes `json:"timerStartedEventAttributes,omitempty"`
WorkflowExecutionCancelRequestedEventAttributes *WorkflowExecutionCancelRequestedEventAttributes `json:"workflowExecutionCancelRequestedEventAttributes,omitempty"`
WorkflowExecutionCanceledEventAttributes *WorkflowExecutionCanceledEventAttributes `json:"workflowExecutionCanceledEventAttributes,omitempty"`
WorkflowExecutionCompletedEventAttributes *WorkflowExecutionCompletedEventAttributes `json:"workflowExecutionCompletedEventAttributes,omitempty"`
WorkflowExecutionContinuedAsNewEventAttributes *WorkflowExecutionContinuedAsNewEventAttributes `json:"workflowExecutionContinuedAsNewEventAttributes,omitempty"`
WorkflowExecutionFailedEventAttributes *WorkflowExecutionFailedEventAttributes `json:"workflowExecutionFailedEventAttributes,omitempty"`
WorkflowExecutionSignaledEventAttributes *WorkflowExecutionSignaledEventAttributes `json:"workflowExecutionSignaledEventAttributes,omitempty"`
WorkflowExecutionStartedEventAttributes *WorkflowExecutionStartedEventAttributes `json:"workflowExecutionStartedEventAttributes,omitempty"`
WorkflowExecutionTerminatedEventAttributes *WorkflowExecutionTerminatedEventAttributes `json:"workflowExecutionTerminatedEventAttributes,omitempty"`
WorkflowExecutionTimedOutEventAttributes *WorkflowExecutionTimedOutEventAttributes `json:"workflowExecutionTimedOutEventAttributes,omitempty"`
}
func (h HistoryEvent) String() string {
var buffer bytes.Buffer
buffer.WriteString("HistoryEvent{ ")
buffer.WriteString(fmt.Sprintf("EventId: %d,", h.EventID))
buffer.WriteString(fmt.Sprintf("EventTimestamp: %s, ", h.EventTimestamp))
buffer.WriteString(fmt.Sprintf("EventType:, %s", h.EventType))
buffer.WriteString(fmt.Sprintf("%+v", eventTypes[h.EventType](h)))
buffer.WriteString(" }")
return buffer.String()
}
// EventTypes returns a slice containing the valid values of the HistoryEvent.EventType field.
func EventTypes() []string {
es := make([]string, 0, len(eventTypes))
for k := range eventTypes {
es = append(es, k)
}
return es
}
// ActivityTaskCancelRequestedEventAttributes models the swf json protocol.
type ActivityTaskCancelRequestedEventAttributes struct {
ActivityID string `json:"activityId"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
}
// ActivityTaskCanceledEventAttributes models the swf json protocol.
type ActivityTaskCanceledEventAttributes struct {
Details string `json:"details"`
LatestCancelRequestedEventID int `json:"latestCancelRequestedEventId"`
ScheduledEventID int `json:"scheduledEventId"`
StartedEventID int `json:"startedEventId"`
}
// ActivityTaskCompletedEventAttributes models the swf json protocol.
type ActivityTaskCompletedEventAttributes struct {
Result string `json:"result"`
ScheduledEventID int `json:"scheduledEventId"`
StartedEventID int `json:"startedEventId"`
}
// ActivityTaskFailedEventAttributes models the swf json protocol.
type ActivityTaskFailedEventAttributes struct {
Details string `json:"details"`
Reason string `json:"reason"`
ScheduledEventID int `json:"scheduledEventId"`
StartedEventID int `json:"startedEventId"`
}
// ActivityTaskScheduledEventAttributes models the swf json protocol.
type ActivityTaskScheduledEventAttributes struct {
ActivityID string `json:"activityId"`
ActivityType ActivityType `json:"activityType"`
Control string `json:"control"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
HeartbeatTimeout string `json:"heartbeatTimeout"`
Input string `json:"input"`
ScheduleToCloseTimeout string `json:"scheduleToCloseTimeout"`
ScheduleToStartTimeout string `json:"scheduleToStartTimeout"`
StartToCloseTimeout string `json:"startToCloseTimeout"`
TaskList TaskList `json:"taskList"`
}
// ActivityTaskStartedEventAttributes models the swf json protocol.
type ActivityTaskStartedEventAttributes struct {
Identity string `json:"identity"`
ScheduledEventID int `json:"scheduledEventId"`
}
// ActivityTaskTimedOutEventAttributes models the swf json protocol.
type ActivityTaskTimedOutEventAttributes struct {
Details string `json:"details"`
ScheduledEventID int `json:"scheduledEventId"`
StartedEventID int `json:"startedEventId"`
TimeoutType string `json:"timeoutType"`
}
// CancelTimerFailedEventAttributes models the swf json protocol.
type CancelTimerFailedEventAttributes struct {
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
TimerID string `json:"timerId"`
}
// CancelWorkflowExecutionFailedEventAttributes models the swf json protocol.
type CancelWorkflowExecutionFailedEventAttributes struct {
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
}
// ChildWorkflowExecutionCanceledEventAttributes models the swf json protocol.
type ChildWorkflowExecutionCanceledEventAttributes struct {
Details string `json:"details"`
InitiatedEventID int `json:"initiatedEventId"`
StartedEventID int `json:"startedEventId"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
WorkflowType WorkflowType `json:"workflowType"`
}
// ChildWorkflowExecutionCompletedEventAttributes models the swf json protocol.
type ChildWorkflowExecutionCompletedEventAttributes struct {
InitiatedEventID int `json:"initiatedEventId"`
Result string `json:"result"`
StartedEventID int `json:"startedEventId"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
WorkflowType WorkflowType `json:"workflowType"`
}
// ChildWorkflowExecutionFailedEventAttributes models the swf json protocol.
type ChildWorkflowExecutionFailedEventAttributes struct {
Details string `json:"details"`
InitiatedEventID int `json:"initiatedEventId"`
Reason string `json:"reason"`
StartedEventID int `json:"startedEventId"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
WorkflowType WorkflowType `json:"workflowType"`
}
// ChildWorkflowExecutionStartedEventAttributes models the swf json protocol.
type ChildWorkflowExecutionStartedEventAttributes struct {
InitiatedEventID int `json:"initiatedEventId"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
WorkflowType WorkflowType `json:"workflowType"`
}
// ChildWorkflowExecutionTerminatedEventAttributes models the swf json protocol.
type ChildWorkflowExecutionTerminatedEventAttributes struct {
InitiatedEventID int `json:"initiatedEventId"`
StartedEventID int `json:"startedEventId"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
WorkflowType WorkflowType `json:"workflowType"`
}
// ChildWorkflowExecutionTimedOutEventAttributes models the swf json protocol.
type ChildWorkflowExecutionTimedOutEventAttributes struct {
InitiatedEventID int `json:"initiatedEventId"`
StartedEventID int `json:"startedEventId"`
TimeoutType string `json:"timeoutType"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
WorkflowType WorkflowType `json:"workflowType"`
}
// CompleteWorkflowExecutionFailedEventAttributes models the swf json protocol.
type CompleteWorkflowExecutionFailedEventAttributes struct {
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
}
// ContinueAsNewWorkflowExecutionFailedEventAttributes models the swf json protocol.
type ContinueAsNewWorkflowExecutionFailedEventAttributes struct {
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
}
// DecisionTaskCompletedEventAttributes models the swf json protocol.
type DecisionTaskCompletedEventAttributes struct {
ExecutionContext string `json:"executionContext"`
ScheduledEventID int `json:"scheduledEventId"`
StartedEventID int `json:"startedEventId"`
}
// DecisionTaskScheduledEventAttributes models the swf json protocol.
type DecisionTaskScheduledEventAttributes struct {
StartToCloseTimeout string `json:"startToCloseTimeout"`
TaskList TaskList `json:"taskList"`
}
// DecisionTaskStartedEventAttributes models the swf json protocol.
type DecisionTaskStartedEventAttributes struct {
Identity string `json:"identity"`
ScheduledEventID int `json:"scheduledEventId"`
}
// DecisionTaskTimedOutEventAttributes models the swf json protocol.
type DecisionTaskTimedOutEventAttributes struct {
ScheduledEventID int `json:"scheduledEventId"`
StartedEventID int `json:"startedEventId"`
TimeoutType string `json:"timeoutType"`
}
// ExternalWorkflowExecutionCancelRequestedEventAttributes models the swf json protocol.
type ExternalWorkflowExecutionCancelRequestedEventAttributes struct {
InitiatedEventID int `json:"initiatedEventId"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
}
// ExternalWorkflowExecutionSignaledEventAttributes models the swf json protocol.
type ExternalWorkflowExecutionSignaledEventAttributes struct {
InitiatedEventID int `json:"initiatedEventId"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
}
// FailWorkflowExecutionFailedEventAttributes models the swf json protocol.
type FailWorkflowExecutionFailedEventAttributes struct {
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
}
// MarkerRecordedEventAttributes models the swf json protocol.
type MarkerRecordedEventAttributes struct {
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
Details string `json:"details"`
MarkerName string `json:"markerName"`
}
// RecordMarkerFailedEventAttributes models the swf json protocol.
type RecordMarkerFailedEventAttributes struct {
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
MarkerName string `json:"markerName"`
}
// RequestCancelActivityTaskFailedEventAttributes models the swf json protocol.
type RequestCancelActivityTaskFailedEventAttributes struct {
ActivityID string `json:"activityId"`
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
}
// RequestCancelExternalWorkflowExecutionFailedEventAttributes models the swf json protocol.
type RequestCancelExternalWorkflowExecutionFailedEventAttributes struct {
Cause string `json:"cause"`
Control string `json:"control"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
InitiatedEventID int `json:"initiatedEventId"`
RunID string `json:"runId"`
WorkflowID string `json:"workflowId"`
}
// RequestCancelExternalWorkflowExecutionInitiatedEventAttributes models the swf json protocol.
type RequestCancelExternalWorkflowExecutionInitiatedEventAttributes struct {
Control string `json:"control"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
RunID string `json:"runId"`
WorkflowID string `json:"workflowId"`
}
// ScheduleActivityTaskFailedEventAttributes models the swf json protocol.
type ScheduleActivityTaskFailedEventAttributes struct {
ActivityID string `json:"activityId"`
ActivityType ActivityType
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
}
// SignalExternalWorkflowExecutionFailedEventAttributes models the swf json protocol.
type SignalExternalWorkflowExecutionFailedEventAttributes struct {
Cause string `json:"cause"`
Control string `json:"control"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
InitiatedEventID int `json:"initiatedEventId"`
RunID string `json:"runId"`
WorkflowID string `json:"workflowId"`
}
// SignalExternalWorkflowExecutionInitiatedEventAttributes models the swf json protocol.
type SignalExternalWorkflowExecutionInitiatedEventAttributes struct {
Control string `json:"control"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
Input string `json:"input"`
RunID string `json:"runId"`
SignalName string `json:"signalName"`
WorkflowID string `json:"workflowId"`
}
// StartChildWorkflowExecutionFailedEventAttributes models the swf json protocol.
type StartChildWorkflowExecutionFailedEventAttributes struct {
Cause string `json:"cause"`
Control string `json:"control"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
InitiatedEventID int `json:"initiatedEventId"`
WorkflowID string `json:"workflowId"`
WorkflowType WorkflowType `json:"workflowType"`
}
// StartChildWorkflowExecutionInitiatedEventAttributes models the swf json protocol.
type StartChildWorkflowExecutionInitiatedEventAttributes struct {
ChildPolicy string `json:"childPolicy"`
Control string `json:"control"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
ExecutionStartToCloseTimeout string `json:"executionStartToCloseTimeout"`
Input string `json:"input"`
TagList []string `json:"tagList"`
TaskList TaskList `json:"taskList"`
TaskStartToCloseTimeout string `json:"taskStartToCloseTimeout"`
WorkflowID string `json:"workflowId"`
WorkflowType WorkflowType `json:"workflowType"`
}
// StartTimerFailedEventAttributes models the swf json protocol.
type StartTimerFailedEventAttributes struct {
Cause string `json:"cause"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
TimerID string `json:"timerId"`
}
// TimerCanceledEventAttributes models the swf json protocol.
type TimerCanceledEventAttributes struct {
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
StartedEventID int `json:"startedEventId"`
TimerID string `json:"timerId"`
}
// TimerFiredEventAttributes models the swf json protocol.
type TimerFiredEventAttributes struct {
StartedEventID int `json:"startedEventId"`
TimerID string `json:"timerId"`
}
// TimerStartedEventAttributes models the swf json protocol.
type TimerStartedEventAttributes struct {
Control string `json:"control"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
StartToFireTimeout string `json:"startToFireTimeout"`
TimerID string `json:"timerId"`
}
// WorkflowExecutionCancelRequestedEventAttributes models the swf json protocol.
type WorkflowExecutionCancelRequestedEventAttributes struct {
Cause string `json:"cause"`
ExternalInitiatedEventID int `json:"externalInitiatedEventId"`
ExternalWorkflowExecution WorkflowExecution `json:"externalWorkflowExecution"`
}
// WorkflowExecutionCanceledEventAttributes models the swf json protocol.
type WorkflowExecutionCanceledEventAttributes struct {
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
Details string `json:"details"`
}
// WorkflowExecutionCompletedEventAttributes models the swf json protocol.
type WorkflowExecutionCompletedEventAttributes struct {
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
Result string `json:"result"`
}
// WorkflowExecutionContinuedAsNewEventAttributes models the swf json protocol.
type WorkflowExecutionContinuedAsNewEventAttributes struct {
ChildPolicy string `json:"childPolicy"`
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
ExecutionStartToCloseTimeout string `json:"executionStartToCloseTimeout"`
Input string `json:"input"`
NewExecutionRunID string `json:"newExecutionRunId"`
TagList []string `json:"tagList"`
TaskList TaskList `json:"taskList"`
TaskStartToCloseTimeout string `json:"taskStartToCloseTimeout"`
WorkflowType WorkflowType `json:"workflowType"`
}
// WorkflowExecutionFailedEventAttributes models the swf json protocol.
type WorkflowExecutionFailedEventAttributes struct {
DecisionTaskCompletedEventID int `json:"decisionTaskCompletedEventId"`
Details string `json:"details"`
Reason string `json:"reason"`
}
// WorkflowExecutionSignaledEventAttributes models the swf json protocol.
type WorkflowExecutionSignaledEventAttributes struct {
ExternalInitiatedEventID int `json:"externalInitiatedEventId"`
ExternalWorkflowExecution WorkflowExecution `json:"externalWorkflowExecution"`
Input string `json:"input"`
SignalName string `json:"signalName"`
}
// WorkflowExecutionStartedEventAttributes models the swf json protocol.
type WorkflowExecutionStartedEventAttributes struct {
ChildPolicy string `json:"childPolicy"`
ContinuedExecutionRunID string `json:"continuedExecutionRunId"`
ExecutionStartToCloseTimeout string `json:"executionStartToCloseTimeout"`
Input string `json:"input"`
ParentInitiatedEventID int `json:"parentInitiatedEventId"`
ParentWorkflowExecution WorkflowExecution `json:"parentWorkflowExecution"`
TagList []string `json:"tagList"`
TaskList TaskList `json:"taskList"`
TaskStartToCloseTimeout string `json:"taskStartToCloseTimeout"`
WorkflowType WorkflowType `json:"workflowType"`
}
// WorkflowExecutionTerminatedEventAttributes models the swf json protocol.
type WorkflowExecutionTerminatedEventAttributes struct {
Cause string `json:"cause"`
ChildPolicy string `json:"childPolicy"`
Details string `json:"details"`
Reason string `json:"reason"`
}
// WorkflowExecutionTimedOutEventAttributes models the swf json protocol.
type WorkflowExecutionTimedOutEventAttributes struct {
ChildPolicy string `json:"childPolicy"`
TimeoutType string `json:"timeoutType"`
}
//DecisionType := ScheduleActivityTask | RequestCancelActivityTask | CompleteWorkflowExecution | FailWorkflowExecution | CancelWorkflowExecution | ContinueAsNewWorkflowExecution | RecordMarker | StartTimer | CancelTimer | SignalExternalWorkflowExecution | RequestCancelExternalWorkflowExecution | StartChildWorkflowExecution
// Valid values for the field DecisionType in the Decision struct.
const (
DecisionTypeScheduleActivityTask = "ScheduleActivityTask"
DecisionTypeRequestCancelActivityTask = "RequestCancelActivityTask"
DecisionTypeCompleteWorkflowExecution = "CompleteWorkflowExecution"
DecisionTypeFailWorkflowExecution = "FailWorkflowExecution"
DecisionTypeCancelWorkflowExecution = "CancelWorkflowExecution"
DecisionTypeContinueAsNewWorkflowExecution = "ContinueAsNewWorkflowExecution"
DecisionTypeRecordMarker = "RecordMarker"
DecisionTypeStartTimer = "StartTimer"
DecisionTypeCancelTimer = "CancelTimer"
DecisionTypeSignalExternalWorkflowExecution = "SignalExternalWorkflowExecution"
DecisionTypeRequestCancelExternalWorkflowExecution = "RequestCancelExternalWorkflowExecution"
DecisionTypeStartChildWorkflowExecution = "StartChildWorkflowExecution"
)
var decisionTypes = map[string]func(Decision) interface{}{
DecisionTypeScheduleActivityTask: func(d Decision) interface{} { return d.ScheduleActivityTaskDecisionAttributes },
DecisionTypeRequestCancelActivityTask: func(d Decision) interface{} { return d.RequestCancelActivityTaskDecisionAttributes },
DecisionTypeCompleteWorkflowExecution: func(d Decision) interface{} { return d.CompleteWorkflowExecutionDecisionAttributes },
DecisionTypeFailWorkflowExecution: func(d Decision) interface{} { return d.FailWorkflowExecutionDecisionAttributes },
DecisionTypeCancelWorkflowExecution: func(d Decision) interface{} { return d.CancelWorkflowExecutionDecisionAttributes },
DecisionTypeContinueAsNewWorkflowExecution: func(d Decision) interface{} { return d.ContinueAsNewWorkflowExecutionDecisionAttributes },
DecisionTypeRecordMarker: func(d Decision) interface{} { return d.RecordMarkerDecisionAttributes },
DecisionTypeStartTimer: func(d Decision) interface{} { return d.StartTimerDecisionAttributes },
DecisionTypeCancelTimer: func(d Decision) interface{} { return d.CancelTimerDecisionAttributes },
DecisionTypeSignalExternalWorkflowExecution: func(d Decision) interface{} { return d.SignalExternalWorkflowExecutionDecisionAttributes },
DecisionTypeRequestCancelExternalWorkflowExecution: func(d Decision) interface{} { return d.RequestCancelExternalWorkflowExecutionDecisionAttributes },
DecisionTypeStartChildWorkflowExecution: func(d Decision) interface{} { return d.StartChildWorkflowExecutionDecisionAttributes },
}
// Decision models the swf json protocol.
type Decision struct {
CancelTimerDecisionAttributes *CancelTimerDecisionAttributes `json:"cancelTimerDecisionAttributes,omitempty"`
CancelWorkflowExecutionDecisionAttributes *CancelWorkflowExecutionDecisionAttributes `json:"cancelWorkflowExecutionDecisionAttributes,omitempty"`
CompleteWorkflowExecutionDecisionAttributes *CompleteWorkflowExecutionDecisionAttributes `json:"completeWorkflowExecutionDecisionAttributes,omitempty"`
ContinueAsNewWorkflowExecutionDecisionAttributes *ContinueAsNewWorkflowExecutionDecisionAttributes `json:"continueAsNewWorkflowExecutionDecisionAttributes,omitempty"`
DecisionType string `json:"decisionType"`
FailWorkflowExecutionDecisionAttributes *FailWorkflowExecutionDecisionAttributes `json:"failWorkflowExecutionDecisionAttributes,omitempty"`
RecordMarkerDecisionAttributes *RecordMarkerDecisionAttributes `json:"recordMarkerDecisionAttributes,omitempty"`
RequestCancelActivityTaskDecisionAttributes *RequestCancelActivityTaskDecisionAttributes `json:"requestCancelActivityTaskDecisionAttributes,omitempty"`
RequestCancelExternalWorkflowExecutionDecisionAttributes *RequestCancelExternalWorkflowExecutionDecisionAttributes `json:"requestCancelExternalWorkflowExecutionDecisionAttributes,omitempty"`
ScheduleActivityTaskDecisionAttributes *ScheduleActivityTaskDecisionAttributes `json:"scheduleActivityTaskDecisionAttributes,omitempty"`
SignalExternalWorkflowExecutionDecisionAttributes *SignalExternalWorkflowExecutionDecisionAttributes `json:"signalExternalWorkflowExecutionDecisionAttributes,omitempty"`
StartChildWorkflowExecutionDecisionAttributes *StartChildWorkflowExecutionDecisionAttributes `json:"startChildWorkflowExecutionDecisionAttributes,omitempty"`
StartTimerDecisionAttributes *StartTimerDecisionAttributes `json:"startTimerDecisionAttributes,omitempty"`
}
func (d Decision) String() string {
var buffer bytes.Buffer
buffer.WriteString("Decision{ ")
buffer.WriteString(fmt.Sprintf("DecisionType: %s,", d.DecisionType))
buffer.WriteString(fmt.Sprintf("%+v", decisionTypes[d.DecisionType](d)))
buffer.WriteString(" }")
return buffer.String()
}
// DecisionTypes returns a slice containing the valid values of the Decision.DecisionType field.
func DecisionTypes() []string {
ds := make([]string, 0, len(decisionTypes))
for k := range eventTypes {
ds = append(ds, k)
}
return ds
}
// CancelTimerDecisionAttributes models the swf json protocol.
type CancelTimerDecisionAttributes struct {
TimerID string `json:"timerId"`
}
// CancelWorkflowExecutionDecisionAttributes models the swf json protocol.
type CancelWorkflowExecutionDecisionAttributes struct {
Details string `json:"details"`
}
// CompleteWorkflowExecutionDecisionAttributes models the swf json protocol.
type CompleteWorkflowExecutionDecisionAttributes struct {
Result string `json:"result"`
}
// ContinueAsNewWorkflowExecutionDecisionAttributes models the swf json protocol.
type ContinueAsNewWorkflowExecutionDecisionAttributes struct {
ChildPolicy string `json:"childPolicy,omitempty"`
ExecutionStartToCloseTimeout string `json:"executionStartToCloseTimeout,omitempty"`
Input string `json:"input"`
TagList []string `json:"tagList"`
TaskList *TaskList `json:"taskList,omitempty"`
TaskStartToCloseTimeout string `json:"taskStartToCloseTimeout,omitempty"`
WorkflowTypeVersion string `json:"workflowTypeVersion,omitempty"`
}
// FailWorkflowExecutionDecisionAttributes models the swf json protocol.
type FailWorkflowExecutionDecisionAttributes struct {
Details string `json:"details"`
Reason string `json:"reason"`
}
// RecordMarkerDecisionAttributes models the swf json protocol.
type RecordMarkerDecisionAttributes struct {
Details string `json:"details"`
MarkerName string `json:"markerName"`
}
// RequestCancelActivityTaskDecisionAttributes models the swf json protocol.
type RequestCancelActivityTaskDecisionAttributes struct {
ActivityID string `json:"activityId"`
}
// RequestCancelExternalWorkflowExecutionDecisionAttributes models the swf json protocol.
type RequestCancelExternalWorkflowExecutionDecisionAttributes struct {
Control string `json:"control"`
RunID string `json:"runId"`
WorkflowID string `json:"workflowId"`
}
// ScheduleActivityTaskDecisionAttributes models the swf json protocol.
type ScheduleActivityTaskDecisionAttributes struct {
ActivityID string `json:"activityId"`
ActivityType ActivityType `json:"activityType"`
Control string `json:"control"`
HeartbeatTimeout string `json:"heartbeatTimeout,omitempty"`
Input string `json:"input,omitempty"`
ScheduleToCloseTimeout string `json:"scheduleToCloseTimeout,omitempty"`
ScheduleToStartTimeout string `json:"scheduleToStartTimeout,omitempty"`
StartToCloseTimeout string `json:"startToCloseTimeout,omitempty"`
TaskList *TaskList `json:"taskList,omitempty"`
}
// SignalExternalWorkflowExecutionDecisionAttributes models the swf json protocol.
type SignalExternalWorkflowExecutionDecisionAttributes struct {
Control string `json:"control"`
Input string `json:"input"`
RunID string `json:"runId"`
SignalName string `json:"signalName"`
WorkflowID string `json:"workflowId"`
}
// StartChildWorkflowExecutionDecisionAttributes models the swf json protocol.
type StartChildWorkflowExecutionDecisionAttributes struct {
ChildPolicy string `json:"childPolicy"`
Control string `json:"control"`
ExecutionStartToCloseTimeout string `json:"executionStartToCloseTimeout"`
Input string `json:"input"`
TagList []string `json:"tagList"`
TaskList TaskList `json:"taskList"`
TaskStartToCloseTimeout string `json:"taskStartToCloseTimeout"`
WorkflowID string `json:"workflowId"`
WorkflowType WorkflowType `json:"workflowType"`
}
// StartTimerDecisionAttributes models the swf json protocol.
type StartTimerDecisionAttributes struct {
Control string `json:"control"`
StartToFireTimeout string `json:"startToFireTimeout"`
TimerID string `json:"timerId"`
}
// RespondDecisionTaskCompletedRequest models the swf json protocol.
type RespondDecisionTaskCompletedRequest struct {
Decisions []Decision `json:"decisions"`
ExecutionContext string `json:"executionContext"`
TaskToken string `json:"taskToken"`
}
/*ActivityWorkerProtocol*/
// PollForActivityTaskRequest models the swf json protocol.
type PollForActivityTaskRequest struct {
Domain string `json:"domain"`
Identity string `json:"identity,omitempty"`
TaskList TaskList `json:"taskList"`
}
// PollForActivityTaskResponse models the swf json protocol.
type PollForActivityTaskResponse struct {
ActivityID string `json:"activityId"`
ActivityType ActivityType `json:"activityType"`
Input string `json:"input"`
StartedEventID int `json:"startedEventId"`
TaskToken string `json:"taskToken"`
WorkflowExecution WorkflowExecution `json:"workflowExecution"`
}
// RespondActivityTaskCompletedRequest models the swf json protocol.
type RespondActivityTaskCompletedRequest struct {
Result string `json:"result,omitempty"`
TaskToken string `json:"taskToken"`
}
// RespondActivityTaskFailedRequest models the swf json protocol.
type RespondActivityTaskFailedRequest struct {
Details string `json:"details,omitempty"`
Reason string `json:"reason,omitempty"`
TaskToken string `json:"taskToken"`
}
// RespondActivityTaskCanceledRequest models the swf json protocol.
type RespondActivityTaskCanceledRequest struct {
Details string `json:"details,omitempty"`
TaskToken string `json:"taskToken"`
}
// RecordActivityTaskHeartbeatRequest models the swf json protocol.
type RecordActivityTaskHeartbeatRequest struct {
Details string `json:"details,omitempty"`
TaskToken string `json:"taskToken"`
}
// RecordActivityTaskHeartbeatResponse models the swf json protocol.
type RecordActivityTaskHeartbeatResponse struct {
CancelRequested bool `json:"cancelRequested"`
}
// DeprecateActivityType models the swf json protocol.
type DeprecateActivityType struct {
ActivityType ActivityType `json:"activityType"`
Domain string `json:"domain"`
}
// DeprecateWorkflowType models the swf json protocol.
type DeprecateWorkflowType struct {
Domain string `json:"domain"`
WorkflowType WorkflowType `json:"workflowType"`
}
// DeprecateDomain models the swf json protocol.
type DeprecateDomain struct {
Name string `json:"name"`
}
// RegisterActivityType models the swf json protocol.
type RegisterActivityType struct {
DefaultTaskHeartbeatTimeout string `json:"defaultTaskHeartbeatTimeout,omitempty"`
DefaultTaskList *TaskList `json:"defaultTaskList,omitempty"`
DefaultTaskScheduleToCloseTimeout string `json:"defaultTaskScheduleToCloseTimeout,omitempty"`
DefaultTaskScheduleToStartTimeout string `json:"defaultTaskScheduleToStartTimeout,omitempty"`
DefaultTaskStartToCloseTimeout string `json:"defaultTaskStartToCloseTimeout,omitempty"`
Description string `json:"description,omitempty"`
Domain string `json:"domain"`
Name string `json:"name"`
Version string `json:"version"`
}
// RegisterDomain models the swf json protocol.
type RegisterDomain struct {
Description string `json:"description,omitempty"`
Name string `json:"name"`
WorkflowExecutionRetentionPeriodInDays string `json:"workflowExecutionRetentionPeriodInDays"`
}
// RegisterWorkflowType models the swf json protocol.
type RegisterWorkflowType struct {
DefaultChildPolicy string `json:"defaultChildPolicy,omitempty"`
DefaultExecutionStartToCloseTimeout string `json:"defaultExecutionStartToCloseTimeout,omitempty"`
DefaultTaskList *TaskList `json:"defaultTaskList,omitempty"`
DefaultTaskStartToCloseTimeout string `json:"defaultTaskStartToCloseTimeout,omitempty"`
Description string `json:"description,omitempty"`
Domain string `json:"domain"`
Name string `json:"name"`
Version string `json:"version"`
}
// CountClosedWorkflowExecutionsRequest models the swf json protocol.
type CountClosedWorkflowExecutionsRequest struct {
CloseStatusFilter *StatusFilter `json:"closeStatusFilter,omitempty"`
CloseTimeFilter *TimeFilter `json:"closeTimeFilter,omitempty"`
Domain string `json:"domain"`
ExecutionFilter *ExecutionFilter `json:"executionFilter,omitempty"`
StartTimeFilter *TimeFilter `json:"startTimeFilter,omitempty"`
TagFilter *TagFilter `json:"tagFilter,omitempty"`
TypeFilter *TypeFilter `json:"typeFilter,omitempty"`
}
// CountOpenWorkflowExecutionsRequest models the swf json protocol.
type CountOpenWorkflowExecutionsRequest struct {
Domain string `json:"domain"`
ExecutionFilter *ExecutionFilter `json:"executionFilter,omitempty"`
StartTimeFilter TimeFilter `json:"startTimeFilter,omitempty"`
TagFilter *TagFilter `json:"tagFilter,omitempty"`
TypeFilter *TypeFilter `json:"typeFilter,omitempty"`
}
// CountPendingActivityTasksRequest models the swf json protocol.
type CountPendingActivityTasksRequest struct {
Domain string `json:"domain"`
TaskList TaskList `json:"taskList"`
}
// CountPendingDecisionTasksRequest models the swf json protocol.
type CountPendingDecisionTasksRequest struct {
Domain string `json:"domain"`
TaskList TaskList `json:"taskList"`
}
// DescribeActivityTypeRequest models the swf json protocol.
type DescribeActivityTypeRequest struct {
ActivityType ActivityType `json:"activityType"`
Domain string `json:"domain"`
}
// DescribeActivityTypeResponse models the swf json protocol.
type DescribeActivityTypeResponse struct {
Configuration ActivityTypeConfiguration `json:"configuration"`
TypeInfo ActivityTypeInfo `json:"typeInfo"`
}
// ActivityTypeConfiguration models the swf json protocol.
type ActivityTypeConfiguration struct {
DefaultTaskHeartbeatTimeout string `json:"defaultTaskHeartbeatTimeout"`
DefaultTaskList TaskList `json:"defaultTaskList"`
DefaultTaskScheduleToCloseTimeout string `json:"defaultTaskScheduleToCloseTimeout"`
DefaultTaskScheduleToStartTimeout string `json:"defaultTaskScheduleToStartTimeout"`
DefaultTaskStartToCloseTimeout string `json:"defaultTaskStartToCloseTimeout"`
}
// DescribeDomainRequest models the swf json protocol.
type DescribeDomainRequest struct {
Name string `json:"name"`
}
// DescribeDomainResponse models the swf json protocol.
type DescribeDomainResponse struct {
Configuration DomainConfiguration `json:"configuration"`
DomainInfo DomainInfo `json:"domainInfo"`
}
// DomainConfiguration models the swf json protocol.
type DomainConfiguration struct {