2025-09-06 17:45:28 +02:00
|
|
|
package actions
|
|
|
|
|
|
|
|
|
|
import "github.com/beevik/etree"
|
|
|
|
|
|
|
|
|
|
type ActionInstance struct {
|
|
|
|
|
model *Action
|
|
|
|
|
|
|
|
|
|
arguments ArgumentSet
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *ActionInstance) Name() string {
|
|
|
|
|
return a.model.Name()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *ActionInstance) TypeID() string {
|
|
|
|
|
return "ActionInstance"
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-07 11:45:43 +02:00
|
|
|
func (a *ActionInstance) Arguments(name string) (*Argument, bool) {
|
|
|
|
|
arg, ok := a.arguments[name]
|
|
|
|
|
return arg, ok
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-06 17:45:28 +02:00
|
|
|
func (a *ActionInstance) ToXMLElement() *etree.Element {
|
|
|
|
|
elem := etree.NewElement("action")
|
|
|
|
|
|
|
|
|
|
name := elem.CreateElement("name")
|
|
|
|
|
name.SetText(a.Name())
|
|
|
|
|
|
|
|
|
|
elem.AddChild(a.arguments.ToXMLElement())
|
|
|
|
|
return elem
|
|
|
|
|
}
|