runner

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 15 Imported by: 3

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.ContactID, 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 []models.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,
	flow *models.Flow, triggers []flows.Trigger, hook models.SessionCommitHook, interrupt bool) ([]*models.Session, error)

StartFlowForContacts runs the passed in flow for the passed in contact

func TriggerIVRFlow added in v0.0.97

func TriggerIVRFlow(ctx context.Context, db *sqlx.DB, rp *redis.Pool, orgID models.OrgID, flowID models.FlowID, contactIDs []models.ContactID, hook DBHook) error

TriggerIVRFlow will create a new flow start with the passed in flow and set of contacts. This will cause us to request calls to start, which once we get the callback will trigger our actual flow to start.

Types

type DBHook added in v0.0.97

type DBHook func(ctx context.Context, tx *sqlx.Tx) error

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
	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