Skip to main content

What does the Motor Vehicle Search Workflow Definition look like?

workflows/motor_vehicle_incident_search.go

func MotorVehicleIncidentSearch(ctx workflow.Context, input *MotorVehicleIncidentSearchWorkflowInput) (*MotorVehicleIncidentSearchWorkflowResult, error) {
var result MotorVehicleIncidentSearchWorkflowResult

name := input.FullName
address := input.Address
var motorvehicleIncidents []string

activityInput := activities.MotorVehicleIncidentSearchInput{
FullName: name,
Address: address,
}
var activityResult activities.MotorVehicleIncidentSearchResult

ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: time.Minute,
})

motorvehicleIncidentSearch := workflow.ExecuteActivity(ctx, a.MotorVehicleIncidentSearch, activityInput)

err := motorvehicleIncidentSearch.Get(ctx, &activityResult)
if err == nil {
motorvehicleIncidents = append(motorvehicleIncidents, activityResult.MotorVehicleIncidents...)
}
result.MotorVehicleIncidents = motorvehicleIncidents

r := MotorVehicleIncidentSearchWorkflowResult(result)
return &r, nil
}

Swim lane diagram of the State Criminal Search Child Workflow Execution