workflow

package
v0.0.0-...-5255ffc Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t tools.DataType, username string, peerID string, groups []string, caller *tools.HTTPCaller) *workflowMongoAccessor

New creates a new instance of the workflowMongoAccessor

func NewHistory

func NewHistory() *workflowHistoryMongoAccessor

New creates a new instance of the workspaceMongoAccessor

Types

type AbstractWorkflow

type AbstractWorkflow struct {
	resources.ResourceSet
	Graph          *graph.Graph      `bson:"graph,omitempty" json:"graph,omitempty"`       // Graph UI & logic representation of the workflow
	ScheduleActive bool              `json:"schedule_active" bson:"schedule_active"`       // ScheduleActive is a flag that indicates if the schedule is active, if not the workflow is not scheduled and no execution or booking will be set
	Schedule       *WorkflowSchedule `bson:"schedule,omitempty" json:"schedule,omitempty"` // Schedule is the schedule of the workflow
	Shared         []string          `json:"shared,omitempty" bson:"shared,omitempty"`     // Shared is the ID of the shared workflow
}

* AbstractWorkflow is a struct that represents a workflow for resource or native workflow * Warning: there is 2 types of workflows, the resource workflow and the native workflow * native workflow is the one that you create to schedule an execution * resource workflow is the one that is created to set our native workflow in catalog

func (*AbstractWorkflow) GetComputeByRelatedProcessing

func (w *AbstractWorkflow) GetComputeByRelatedProcessing(processingID string) []*resources.ComputeResource

func (*AbstractWorkflow) GetProcessings

func (w *AbstractWorkflow) GetProcessings() (list_computings []graph.GraphItem)

func (*AbstractWorkflow) GetStoragesByRelatedProcessing

func (w *AbstractWorkflow) GetStoragesByRelatedProcessing(processingID string) []*resources.StorageResource

func (*AbstractWorkflow) GetWorkflows

func (w *AbstractWorkflow) GetWorkflows() (list_computings []graph.GraphItem)

type ScheduleMode

type ScheduleMode int

WorkflowSchedule is a struct that contains the scheduling information of a workflow

const (
	TASK ScheduleMode = iota
	SERVICE
)

type Workflow

type Workflow struct {
	utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name)
	AbstractWorkflow     // AbstractWorkflow contains the basic fields of a workflow
}

* Workflow is a struct that represents a workflow * it defines the native workflow

func (*Workflow) CheckBooking

func (wfa *Workflow) CheckBooking(caller *tools.HTTPCaller) (bool, error)

* CheckBooking is a function that checks the booking of the workflow on peers (even ourselves)

func (*Workflow) GetAccessor

func (d *Workflow) GetAccessor(username string, peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor

func (*Workflow) VerifyAuth

func (ao *Workflow) VerifyAuth(username string, peerID string, groups []string) bool

type WorkflowHistory

type WorkflowHistory struct{ Workflow }

func (*WorkflowHistory) GenerateID

func (r *WorkflowHistory) GenerateID()

func (*WorkflowHistory) GetAccessor

func (d *WorkflowHistory) GetAccessor(username string, peerID string, groups []string, caller *tools.HTTPCaller) utils.Accessor

type WorkflowSchedule

type WorkflowSchedule struct {
	Mode  int64      `json:"mode" bson:"mode" validate:"required"`               // Mode is the mode of the schedule (Task or Service)
	Name  string     `json:"name" bson:"name" validate:"required"`               // Name is the name of the schedule
	Start *time.Time `json:"start" bson:"start" validate:"required,ltfield=End"` // Start is the start time of the schedule, is required and must be less than the End time
	End   *time.Time `json:"end,omitempty" bson:"end,omitempty"`                 // End is the end time of the schedule
	Cron  string     `json:"cron,omitempty" bson:"cron,omitempty"`               // here the cron format : ss mm hh dd MM dw task
}

* WorkflowSchedule is a struct that contains the scheduling information of a workflow * It contains the mode of the schedule (Task or Service), the name of the schedule, the start and end time of the schedule and the cron expression

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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