Skip to content

Commit

Permalink
allow empty IotOption selection
Browse files Browse the repository at this point in the history
  • Loading branch information
IngoRoessner committed Apr 24, 2024
1 parent 6be17d8 commit b78df90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 4 additions & 1 deletion pkg/analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ func (this *Analytics) inputsToNodes(token auth.Token, task model.CamundaExterna
if err != nil {
return result, err
}
if selection.DeviceSelection == nil && selection.ImportSelection == nil && selection.DeviceGroupSelection == nil {
continue
}
nodeInput, err := this.selectionToNodeInputs(token, selection, task, input.Id, port)
if err != nil {
return result, err
Expand Down Expand Up @@ -336,7 +339,7 @@ func (this *Analytics) selectionToNodeInputs(token auth.Token, selection model.I
if selection.DeviceGroupSelection != nil {
return this.groupSelectionToNodeInputs(token, *selection.DeviceGroupSelection, task, inputId, portName)
}
return []NodeInput{}, nil
return result, errors.New("expect selection to contain none nil value")
}

func (this *Analytics) deviceSelectionToNodeInputs(selection model.DeviceSelection, inputPort string) (result []NodeInput, err error) {
Expand Down
5 changes: 1 addition & 4 deletions pkg/analytics/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ func (this *Analytics) getSelection(task model.CamundaExternalTask, inputId stri
if err != nil {
return result, fmt.Errorf("unable to interpret pipeline input selection (%v): %w", variableName, err)
}
if result.DeviceSelection == nil && result.ImportSelection == nil && result.DeviceGroupSelection == nil {
return result, fmt.Errorf("unable to interpret pipeline input selection (%v): %v", variableName, "expect selection to contain none nil value")
}
return result, err
return result, nil
}

func (this *Analytics) getNodePathCriteria(task model.CamundaExternalTask, inputId string, portName string) (result []devices.FilterCriteria, err error) {
Expand Down

0 comments on commit b78df90

Please sign in to comment.