Revert "Creation of request and interface method for Workflow raise event" (#2666)
This commit is contained in:
parent
1d40321ac0
commit
d5420155eb
|
@ -64,7 +64,7 @@ func ConformanceTests(t *testing.T, props map[string]string, workflowItem workfl
|
||||||
Input: 10, // Time that the activity within the workflow runs for
|
Input: 10, // Time that the activity within the workflow runs for
|
||||||
WorkflowName: "TestWorkflow",
|
WorkflowName: "TestWorkflow",
|
||||||
}
|
}
|
||||||
req.InstanceID = "TestID"
|
req.WorkflowReference.InstanceID = "TestID"
|
||||||
req.Options = make(map[string]string)
|
req.Options = make(map[string]string)
|
||||||
req.Options["task_queue"] = "TestTaskQueue"
|
req.Options["task_queue"] = "TestTaskQueue"
|
||||||
wf, err := workflowItem.Start(context.Background(), req)
|
wf, err := workflowItem.Start(context.Background(), req)
|
||||||
|
|
|
@ -6,15 +6,8 @@ type WorkflowReference struct {
|
||||||
|
|
||||||
// StartRequest is the object describing a Start Workflow request.
|
// StartRequest is the object describing a Start Workflow request.
|
||||||
type StartRequest struct {
|
type StartRequest struct {
|
||||||
Options map[string]string `json:"workflow_options"`
|
Options map[string]string `json:"workflow_options"`
|
||||||
InstanceID string `json:"workflow_reference"`
|
WorkflowReference WorkflowReference `json:"workflow_reference"`
|
||||||
WorkflowName string `json:"function_name"`
|
WorkflowName string `json:"function_name"`
|
||||||
Input interface{} `json:"input"`
|
Input interface{} `json:"input"`
|
||||||
}
|
|
||||||
|
|
||||||
// RaiseEventRequest is the object describing a Raise Event request.
|
|
||||||
type RaiseEventRequest struct {
|
|
||||||
InstanceID string `json:"workflow_reference"`
|
|
||||||
EventName string `json:"event_name"`
|
|
||||||
Input []byte `json:"input"`
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ func (c *TemporalWF) Start(ctx context.Context, req *workflows.StartRequest) (*w
|
||||||
}
|
}
|
||||||
taskQ := req.Options["task_queue"]
|
taskQ := req.Options["task_queue"]
|
||||||
|
|
||||||
opt := client.StartWorkflowOptions{ID: req.InstanceID, TaskQueue: taskQ}
|
opt := client.StartWorkflowOptions{ID: req.WorkflowReference.InstanceID, TaskQueue: taskQ}
|
||||||
run, err := c.client.ExecuteWorkflow(ctx, opt, req.WorkflowName, req.Input)
|
run, err := c.client.ExecuteWorkflow(ctx, opt, req.WorkflowName, req.Input)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &workflows.WorkflowReference{}, fmt.Errorf("error executing workflow: %w", err)
|
return &workflows.WorkflowReference{}, fmt.Errorf("error executing workflow: %w", err)
|
||||||
|
@ -124,11 +124,6 @@ func (c *TemporalWF) Get(ctx context.Context, req *workflows.WorkflowReference)
|
||||||
return &outputStruct, nil
|
return &outputStruct, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *TemporalWF) RaiseEvent(ctx context.Context, req *workflows.RaiseEventRequest) error {
|
|
||||||
// Unimplemented
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *TemporalWF) Close() {
|
func (c *TemporalWF) Close() {
|
||||||
c.client.Close()
|
c.client.Close()
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,5 +21,4 @@ type Workflow interface {
|
||||||
Start(ctx context.Context, req *StartRequest) (*WorkflowReference, error)
|
Start(ctx context.Context, req *StartRequest) (*WorkflowReference, error)
|
||||||
Terminate(ctx context.Context, req *WorkflowReference) error
|
Terminate(ctx context.Context, req *WorkflowReference) error
|
||||||
Get(ctx context.Context, req *WorkflowReference) (*StateResponse, error)
|
Get(ctx context.Context, req *WorkflowReference) (*StateResponse, error)
|
||||||
RaiseEvent(ctx context.Context, req *RaiseEventRequest) error
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue