Files
micromdm/workflow/workflow.go
Victor Vrantchan fa487119fc more crud
2016-05-16 10:04:30 -04:00

28 lines
782 B
Go

package workflow
import "errors"
// ErrExists is returned when trying to add a resource which already exists
var ErrExists = errors.New("resource already exists in the datastore")
// Workflow describes a workflow that a device will execute
// A workflow contains a list of configuration profiles,
// Applications and included workflows
type Workflow struct {
UUID string `json:"uuid" db:"workflow_uuid"`
Name string `json:"name" db:"name"`
Profiles []Profile `json:"profiles"`
// Applications []application
// IncludedWorkflows []Workflow
}
// HasProfile checks if a profile is present in the workflow
func (wf Workflow) HasProfile(pi string) bool {
for _, p := range wf.Profiles {
if p.PayloadIdentifier == pi {
return true
}
}
return false
}