improve condition evaluate
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
maputil "github.com/usual2970/certimate/internal/pkg/utils/map"
|
||||
@@ -109,11 +110,13 @@ type WorkflowNodeConfigForNotify struct {
|
||||
}
|
||||
|
||||
func (n *WorkflowNode) GetConfigForCondition() WorkflowNodeConfigForCondition {
|
||||
raw := maputil.GetString(n.Config, "expression")
|
||||
if raw == "" {
|
||||
expression := n.Config["expression"]
|
||||
if expression == nil {
|
||||
return WorkflowNodeConfigForCondition{}
|
||||
}
|
||||
|
||||
raw, _ := json.Marshal(expression)
|
||||
|
||||
expr, err := UnmarshalExpr([]byte(raw))
|
||||
if err != nil {
|
||||
return WorkflowNodeConfigForCondition{}
|
||||
|
||||
Reference in New Issue
Block a user