File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1
1
package workflow
2
2
3
3
import (
4
+ "github.com/dapr/durabletask-go/api/helpers"
4
5
"github.com/dapr/durabletask-go/task"
5
6
)
6
7
@@ -20,9 +21,7 @@ func NewRegistry() *Registry {
20
21
// AddWorkflow adds an orchestrator function to the registry. The name of the orchestrator
21
22
// function is determined using reflection.
22
23
func (r * Registry ) AddWorkflow (w Workflow ) error {
23
- return r .registry .AddOrchestrator (func (ctx * task.OrchestrationContext ) (any , error ) {
24
- return w (& WorkflowContext {ctx })
25
- })
24
+ return r .AddWorkflowN (helpers .GetTaskFunctionName (w ), w )
26
25
}
27
26
28
27
// AddWorkflowN adds an orchestrator function to the registry with a
@@ -36,9 +35,7 @@ func (r *Registry) AddWorkflowN(name string, w Workflow) error {
36
35
// AddActivity adds an activity function to the registry. The name of the
37
36
// activity function is determined using reflection.
38
37
func (r * Registry ) AddActivity (a Activity ) error {
39
- return r .registry .AddActivity (func (ctx task.ActivityContext ) (any , error ) {
40
- return a (ctx .(ActivityContext ))
41
- })
38
+ return r .AddActivityN (helpers .GetTaskFunctionName (a ), a )
42
39
}
43
40
44
41
// AddActivityN adds an activity function to the registry with a specified
You can’t perform that action at this time.
0 commit comments