runner

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FireCampaignEvents added in v0.0.20

func FireCampaignEvents(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool,
	orgID models.OrgID, fires []*models.EventFire, flowUUID assets.FlowUUID,
	event *triggers.CampaignEvent) ([]*models.Session, error)

FireCampaignEvents starts the flow for the passed in org, contact and flow

func ResumeFlow added in v0.0.38

func ResumeFlow(ctx context.Context, db *sqlx.DB, rp *redis.Pool, org *models.OrgAssets, sa flows.SessionAssets, session *models.Session, resume flows.Resume, hook models.SessionCommitHook) (*models.Session, error)

ResumeFlow resumes the passed in session using the passed in session

func StartFlow

func StartFlow(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool, org *models.OrgAssets,
	flow *models.Flow, contactIDs []flows.ContactID, options *StartOptions) ([]*models.Session, error)

StartFlow runs the passed in flow for the passed in contact

func StartFlowBatch added in v0.0.27

func StartFlowBatch(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool,
	batch *models.FlowStartBatch) ([]*models.Session, error)

StartFlowBatch starts the flow for the passed in org, contacts and flow

func StartFlowForContacts added in v0.0.38

func StartFlowForContacts(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool, org *models.OrgAssets, assets flows.SessionAssets,
	triggers []flows.Trigger, hook models.SessionCommitHook, interrupt bool) ([]*models.Session, error)

StartFlowForContacts runs the passed in flow for the passed in contact

Types

type StartOptions added in v0.0.27

type StartOptions struct {
	// RestartParticipants should be true if the flow start should restart participants already in this flow
	RestartParticipants bool

	// IncludeActive should be true if we want to interrupt people active in other flows (including this one)
	IncludeActive bool

	// Interrupt should be true if we want to interrupt the flows runs for any contact started in this flow
	// (simple campaign events do not currently interrupt)
	Interrupt bool

	// CommitHook is the hook that will be called in the transaction where each session is written
	CommitHook models.SessionCommitHook

	// TriggerBuilder is the builder that will be used to build a trigger for each contact started in the flow
	TriggerBuilder TriggerBuilder
}

StartOptions define the various parameters that can be used when starting a flow

func NewStartOptions added in v0.0.42

func NewStartOptions() *StartOptions

NewStartOptions creates and returns the default start options to be used for flow starts

type TriggerBuilder added in v0.0.27

type TriggerBuilder func(contact *flows.Contact) flows.Trigger

TriggerBuilder defines the interface for building a trigger for the passed in contact

Jump to

Keyboard shortcuts

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