Revert "Creation of request and interface method for Workflow raise event" (#2666)

This commit is contained in:
Alessandro (Ale) Segala 2023-03-14 12:30:40 -07:00 committed by GitHub
parent 1d40321ac0
commit d5420155eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 19 deletions

View File

@ -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
WorkflowName: "TestWorkflow",
}
req.InstanceID = "TestID"
req.WorkflowReference.InstanceID = "TestID"
req.Options = make(map[string]string)
req.Options["task_queue"] = "TestTaskQueue"
wf, err := workflowItem.Start(context.Background(), req)

View File

@ -6,15 +6,8 @@ type WorkflowReference struct {
// StartRequest is the object describing a Start Workflow request.
type StartRequest struct {
Options map[string]string `json:"workflow_options"`
InstanceID string `json:"workflow_reference"`
WorkflowName string `json:"function_name"`
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"`
Options map[string]string `json:"workflow_options"`
WorkflowReference WorkflowReference `json:"workflow_reference"`
WorkflowName string `json:"function_name"`
Input interface{} `json:"input"`
}

View File

@ -86,7 +86,7 @@ func (c *TemporalWF) Start(ctx context.Context, req *workflows.StartRequest) (*w
}
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)
if err != nil {
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
}
func (c *TemporalWF) RaiseEvent(ctx context.Context, req *workflows.RaiseEventRequest) error {
// Unimplemented
return nil
}
func (c *TemporalWF) Close() {
c.client.Close()
}

View File

@ -21,5 +21,4 @@ type Workflow interface {
Start(ctx context.Context, req *StartRequest) (*WorkflowReference, error)
Terminate(ctx context.Context, req *WorkflowReference) error
Get(ctx context.Context, req *WorkflowReference) (*StateResponse, error)
RaiseEvent(ctx context.Context, req *RaiseEventRequest) error
}