@@ -12,14 +12,16 @@ type ScheduleSubWorkflowCommand struct {
12
12
command
13
13
14
14
Instance * core.WorkflowInstance
15
- Name string
16
- Inputs []payload.Payload
15
+ Metadata * core.WorkflowMetadata
16
+
17
+ Name string
18
+ Inputs []payload.Payload
17
19
}
18
20
19
21
var _ Command = (* ScheduleSubWorkflowCommand )(nil )
20
22
21
23
func NewScheduleSubWorkflowCommand (
22
- id int64 , parentInstance * core.WorkflowInstance , subWorkflowInstanceID , name string , inputs []payload.Payload ,
24
+ id int64 , parentInstance * core.WorkflowInstance , subWorkflowInstanceID , name string , inputs []payload.Payload , metadata * core. WorkflowMetadata ,
23
25
) * ScheduleSubWorkflowCommand {
24
26
if subWorkflowInstanceID == "" {
25
27
subWorkflowInstanceID = uuid .New ().String ()
@@ -32,6 +34,7 @@ func NewScheduleSubWorkflowCommand(
32
34
},
33
35
34
36
Instance : core .NewSubWorkflowInstance (subWorkflowInstanceID , uuid .NewString (), parentInstance .InstanceID , id ),
37
+ Metadata : metadata ,
35
38
36
39
Name : name ,
37
40
Inputs : inputs ,
@@ -45,8 +48,6 @@ func (*ScheduleSubWorkflowCommand) Type() string {
45
48
func (c * ScheduleSubWorkflowCommand ) Commit (clock clock.Clock ) * CommandResult {
46
49
c .commit ()
47
50
48
- // TODO: TRACING: Add span
49
-
50
51
return & CommandResult {
51
52
// Record scheduled sub-workflow
52
53
Events : []history.Event {
@@ -55,6 +56,7 @@ func (c *ScheduleSubWorkflowCommand) Commit(clock clock.Clock) *CommandResult {
55
56
history .EventType_SubWorkflowScheduled ,
56
57
& history.SubWorkflowScheduledAttributes {
57
58
SubWorkflowInstance : c .Instance ,
59
+ Metadata : c .Metadata ,
58
60
Name : c .Name ,
59
61
Inputs : c .Inputs ,
60
62
},
@@ -69,8 +71,9 @@ func (c *ScheduleSubWorkflowCommand) Commit(clock clock.Clock) *CommandResult {
69
71
clock .Now (),
70
72
history .EventType_WorkflowExecutionStarted ,
71
73
& history.ExecutionStartedAttributes {
72
- Name : c .Name ,
73
- Inputs : c .Inputs ,
74
+ Name : c .Name ,
75
+ Inputs : c .Inputs ,
76
+ Metadata : c .Metadata ,
74
77
},
75
78
history .ScheduleEventID (0 ),
76
79
),
0 commit comments