runner

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 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.Session, error)

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

func StartFlow

func StartFlow(
	ctx context.Context, db *sqlx.DB, rp *redis.Pool, org *models.OrgAssets,
	flow *models.Flow, contactIDs []flows.ContactID, options *StartOptions,
	buildTrigger TriggerBuilder, hook models.SessionCommitHook) ([]*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

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
}

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