@@ -11,6 +11,7 @@ import (
1111	"time" 
1212
1313	"github.com/cschleiden/go-workflows/backend" 
14+ 	"github.com/cschleiden/go-workflows/internal/contextpropagation" 
1415	"github.com/cschleiden/go-workflows/internal/converter" 
1516	"github.com/cschleiden/go-workflows/internal/core" 
1617	"github.com/cschleiden/go-workflows/internal/history" 
@@ -78,6 +79,10 @@ func (b *mysqlBackend) Converter() converter.Converter {
7879	return  b .options .Converter 
7980}
8081
82+ func  (b  * mysqlBackend ) ContextPropagators () []contextpropagation.ContextPropagator  {
83+ 	return  b .options .ContextPropagators 
84+ }
85+ 
8186func  (b  * mysqlBackend ) CreateWorkflowInstance (ctx  context.Context , instance  * workflow.Instance , event  * history.Event ) error  {
8287	tx , err  :=  b .db .BeginTx (ctx , & sql.TxOptions {
8388		Isolation : sql .LevelReadCommitted ,
@@ -626,9 +631,8 @@ func (b *mysqlBackend) GetActivityTask(ctx context.Context) (*task.Activity, err
626631	res  :=  tx .QueryRowContext (
627632		ctx ,
628633		`SELECT activities.id, activity_id, activities.instance_id, 
629- 			instances.metadata,  event_type, timestamp, schedule_event_id, attributes, visible_at 
634+ 			event_type, timestamp, schedule_event_id, attributes, visible_at 
630635			FROM activities 
631- 				INNER JOIN instances ON activities.instance_id = instances.instance_id 
632636			WHERE activities.locked_until IS NULL OR activities.locked_until < ? 
633637			LIMIT 1 
634638			FOR UPDATE SKIP LOCKED` ,
@@ -638,11 +642,10 @@ func (b *mysqlBackend) GetActivityTask(ctx context.Context) (*task.Activity, err
638642	var  id  int64 
639643	var  instanceID  string 
640644	var  attributes  []byte 
641- 	var  metadataJson  sql.NullString 
642645	event  :=  & history.Event {}
643646
644647	if  err  :=  res .Scan (
645- 		& id , & event .ID , & instanceID , & metadataJson ,  & event .Type ,
648+ 		& id , & event .ID , & instanceID , & event .Type ,
646649		& event .Timestamp , & event .ScheduleEventID , & attributes , & event .VisibleAt ); err  !=  nil  {
647650		if  err  ==  sql .ErrNoRows  {
648651			return  nil , nil 
@@ -651,11 +654,6 @@ func (b *mysqlBackend) GetActivityTask(ctx context.Context) (*task.Activity, err
651654		return  nil , fmt .Errorf ("finding activity task to lock: %w" , err )
652655	}
653656
654- 	var  metadata  * workflow.Metadata 
655- 	if  err  :=  json .Unmarshal ([]byte (metadataJson .String ), & metadata ); err  !=  nil  {
656- 		return  nil , fmt .Errorf ("unmarshaling metadata: %w" , err )
657- 	}
658- 
659657	a , err  :=  history .DeserializeAttributes (event .Type , attributes )
660658	if  err  !=  nil  {
661659		return  nil , fmt .Errorf ("deserializing attributes: %w" , err )
@@ -676,7 +674,6 @@ func (b *mysqlBackend) GetActivityTask(ctx context.Context) (*task.Activity, err
676674	t  :=  & task.Activity {
677675		ID :               event .ID ,
678676		WorkflowInstance : core .NewWorkflowInstance (instanceID ),
679- 		Metadata :         metadata ,
680677		Event :            event ,
681678	}
682679
0 commit comments