mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
规则引擎
This commit is contained in:
34
pkg/rule_engine/nodes/action_create_relation_node.go
Normal file
34
pkg/rule_engine/nodes/action_create_relation_node.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package nodes
|
||||
|
||||
import (
|
||||
"pandax/pkg/rule_engine/message"
|
||||
)
|
||||
|
||||
type createRelationNode struct {
|
||||
bareNode
|
||||
Direction string
|
||||
RelationType string
|
||||
EntityType string
|
||||
EntityNamePattern string
|
||||
EntityTypePattern string
|
||||
EntityCacheExpiration int64
|
||||
CreateEntityIfNotExists bool
|
||||
ChangeOriginatorToRelatedEntity bool
|
||||
RemoveCurrentRelations bool
|
||||
}
|
||||
|
||||
type createRelationNodeFactory struct{}
|
||||
|
||||
func (f createRelationNodeFactory) Name() string { return "CreateRelationNode" }
|
||||
func (f createRelationNodeFactory) Category() string { return NODE_CATEGORY_ACTION }
|
||||
func (f createRelationNodeFactory) Create(id string, meta Metadata) (Node, error) {
|
||||
labels := []string{"Success", "Failure"}
|
||||
node := &createRelationNode{
|
||||
bareNode: newBareNode(f.Name(), id, meta, labels),
|
||||
}
|
||||
return decodePath(meta, node)
|
||||
}
|
||||
|
||||
func (n *createRelationNode) Handle(msg message.Message) error {
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user