workflow

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const NAME = "Workflow"

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	FullName string `xml:"fullName"`
	CcEmails []struct {
		Text string `xml:",chardata"`
	} `xml:"ccEmails"`
	Description   *TextLiteral `xml:"description"`
	Protected     *BooleanText `xml:"protected"`
	Recipients    []Recipient  `xml:"recipients"`
	SenderAddress *TextLiteral `xml:"senderAddress"`
	SenderType    *TextLiteral `xml:"senderType"`
	Template      *TextLiteral `xml:"template"`
}

type AlertFilter

type AlertFilter func(Alert) bool

type FieldUpdate

type FieldUpdate struct {
	FullName           TextLiteral  `xml:"fullName"`
	Description        *TextLiteral `xml:"description"`
	Field              TextLiteral  `xml:"field"`
	Formula            *TextLiteral `xml:"formula"`
	LiteralValue       *TextLiteral `xml:"literalValue"`
	LookupValue        *TextLiteral `xml:"lookupValue"`
	LookupValueType    *TextLiteral `xml:"lookupValueType"`
	Name               TextLiteral  `xml:"name"`
	NotifyAssignee     *BooleanText `xml:"notifyAssignee"`
	Operation          *TextLiteral `xml:"operation"`
	Protected          *BooleanText `xml:"protected"`
	ReevaluateOnChange *BooleanText `xml:"reevaluateOnChange"`
	TargetObject       *TextLiteral `xml:"targetObject"`
}

type Recipient

type Recipient struct {
	Field     *TextLiteral `xml:"field"`
	Recipient *TextLiteral `xml:"recipient"`
	Type      struct {
		Text string `xml:",chardata"`
	} `xml:"type"`
}

type Rule

type Rule struct {
	FullName string `xml:"fullName"`
	Actions  []struct {
		Name struct {
			Text string `xml:",chardata"`
		} `xml:"name"`
		Type struct {
			Text string `xml:",chardata"`
		} `xml:"type"`
	} `xml:"actions"`
	Active        BooleanText  `xml:"active"`
	BooleanFilter *TextLiteral `xml:"booleanFilter"`
	CriteriaItems []struct {
		Field struct {
			Text string `xml:",chardata"`
		} `xml:"field"`
		Operation struct {
			Text string `xml:",chardata"`
		} `xml:"operation"`
		Value *TextLiteral `xml:"value"`
	} `xml:"criteriaItems"`
	Description          *TextLiteral `xml:"description"`
	Formula              *TextLiteral `xml:"formula"`
	TriggerType          *TextLiteral `xml:"triggerType"`
	WorkflowTimeTriggers *struct {
		Actions struct {
			Name struct {
				Text string `xml:",chardata"`
			} `xml:"name"`
			Type struct {
				Text string `xml:",chardata"`
			} `xml:"type"`
		} `xml:"actions"`
		OffsetFromField struct {
			Text string `xml:",chardata"`
		} `xml:"offsetFromField"`
		TimeLength struct {
			Text string `xml:",chardata"`
		} `xml:"timeLength"`
		WorkflowTimeTriggerUnit struct {
			Text string `xml:",chardata"`
		} `xml:"workflowTimeTriggerUnit"`
	} `xml:"workflowTimeTriggers"`
}

type RuleFilter

type RuleFilter func(Rule) bool

type Task

type Task struct {
	FullName struct {
		Text string `xml:",chardata"`
	} `xml:"fullName"`
	AssignedTo struct {
		Text string `xml:",chardata"`
	} `xml:"assignedTo"`
	AssignedToType struct {
		Text string `xml:",chardata"`
	} `xml:"assignedToType"`
	DueDateOffset struct {
		Text string `xml:",chardata"`
	} `xml:"dueDateOffset"`
	NotifyAssignee struct {
		Text string `xml:",chardata"`
	} `xml:"notifyAssignee"`
	OffsetFromField struct {
		Text string `xml:",chardata"`
	} `xml:"offsetFromField"`
	Priority struct {
		Text string `xml:",chardata"`
	} `xml:"priority"`
	Protected struct {
		Text string `xml:",chardata"`
	} `xml:"protected"`
	Status struct {
		Text string `xml:",chardata"`
	} `xml:"status"`
	Subject struct {
		Text string `xml:",chardata"`
	} `xml:"subject"`
}

type Workflow

type Workflow struct {
	metadata.MetadataInfo
	XMLName      xml.Name      `xml:"Workflow"`
	Xmlns        string        `xml:"xmlns,attr"`
	Alerts       []Alert       `xml:"alerts"`
	FieldUpdates []FieldUpdate `xml:"fieldUpdates"`
	Rules        []Rule        `xml:"rules"`
	Tasks        []Task        `xml:"tasks"`
}

func Open

func Open(path string) (*Workflow, error)

func (*Workflow) DeleteAlert

func (o *Workflow) DeleteAlert(alertName string) error

func (*Workflow) DeleteRule

func (o *Workflow) DeleteRule(ruleName string) error

func (*Workflow) GetAlerts

func (w *Workflow) GetAlerts(filters ...AlertFilter) []Alert

func (*Workflow) GetFieldUpdates

func (w *Workflow) GetFieldUpdates() []FieldUpdate

func (*Workflow) GetRules

func (w *Workflow) GetRules(filters ...RuleFilter) []Rule

func (*Workflow) SetMetadata

func (c *Workflow) SetMetadata(m metadata.MetadataInfo)

func (Workflow) Tidy

func (f Workflow) Tidy()

func (*Workflow) Type

func (c *Workflow) Type() metadata.MetadataType

func (*Workflow) UpdateAlert

func (o *Workflow) UpdateAlert(alertName string, updates Alert) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL