Skip to content

Commit

Permalink
bring back check for duration string might be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
nitram509 committed Nov 10, 2023
1 parent e840b0e commit 6c67876
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/bpmn_engine/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bpmn_engine

import (
"fmt"
"strings"
"time"

"github.com/nitram509/lib-bpmn-engine/pkg/spec/BPMN20"
Expand Down Expand Up @@ -125,5 +126,9 @@ func findExistingTimerNotYetTriggered(state *BpmnEngineState, id string, instanc
}

func findDurationValue(ice BPMN20.TIntermediateCatchEvent) (duration.Duration, error) {
return duration.ParseISO8601(ice.TimerEventDefinition.TimeDuration.XMLText)
durationStr := ice.TimerEventDefinition.TimeDuration.XMLText
if len(strings.TrimSpace(durationStr)) == 0 {
return duration.Duration{}, newEngineErrorf("Can't find 'timeDuration' value for INTERMEDIATE_CATCH_EVENT with id=%s", ice.Id)
}
return duration.ParseISO8601(durationStr)
}

0 comments on commit 6c67876

Please sign in to comment.