Revert "Fixes Wf duplicate issues for gateway steps"

This reverts commit d4bf6fc6bb.
This commit is contained in:
Tomaž Jerman
2021-10-08 17:18:01 +02:00
parent 15674723f7
commit 859aec34eb
2 changed files with 11 additions and 14 deletions
+7 -10
View File
@@ -203,16 +203,16 @@ func (svc workflowConverter) workflowStepDefConv(g *wfexec.Graph, s *types.Workf
}
}()
if err == nil && conv == nil {
if err != nil {
return false, err
} else if conv != nil {
conv.SetID(s.ID)
g.AddStep(conv)
return true, err
} else {
// signal caller that we were unable to
// resolve definition at the moment
return false, nil
} else {
if conv != nil {
conv.SetID(s.ID)
g.AddStep(conv)
}
return err == nil, err
}
}
@@ -276,9 +276,6 @@ func (svc workflowConverter) convGateway(g *wfexec.Graph, s *types.WorkflowStep,
}
}
// return empty struct even if we get an error,
// so step definitions converted into workflow.Step instances
// and this step don't go through verification more than one time
if s.Ref == "excl" {
return wfexec.ExclGateway(pp...)
} else {
+4 -4
View File
@@ -100,12 +100,12 @@ type inclGateway struct {
// InclGateway fn initializes inclusive gateway
func InclGateway(pp ...*GatewayPath) (*inclGateway, error) {
if len(pp) < 2 {
return &inclGateway{}, fmt.Errorf("expecting at least two paths for incusive gateway")
return nil, fmt.Errorf("expecting at least two paths for incusive gateway")
}
for _, p := range pp {
if p.test == nil {
return &inclGateway{}, fmt.Errorf("all inclusve gateway paths must have valid test Expression")
return nil, fmt.Errorf("all inclusve gateway paths must have valid test Expression")
}
}
@@ -142,12 +142,12 @@ type exclGateway struct {
func ExclGateway(pp ...*GatewayPath) (*exclGateway, error) {
t := len(pp)
if t < 2 {
return &exclGateway{}, fmt.Errorf("expecting at least two paths for exclusive gateway")
return nil, fmt.Errorf("expecting at least two paths for exclusive gateway")
}
for i, p := range pp {
if p.test == nil && i != t-1 {
return &exclGateway{}, fmt.Errorf("all exclusive gateway paths must have valid test Expression")
return nil, fmt.Errorf("all exclusive gateway paths must have valid test Expression")
}
}