Configuration and runtime graph for a sales/marketing journey: the set of stages, journey nodes (goals and actions), scoring, automations, exports and task definitions that together define how a lead moves through the funnel. Stored per repository branch and loaded through FunnelCache; FunnelManager reads a Funnel to evaluate incoming events, transition leads between nodes, run automations and score engagement. Configured in XML under the element name "funnel".
Group: Journeys
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| automations | List<FunnelAutomation> | Trigger/action automations attached to this funnel, checked by FunnelManager against each incoming FunnelEvent. |
| branch | Branch | The repository branch this funnel is stored against, re-fetched from the current Hibernate session on each call. |
| cancelledActions | List<GoalAction> | Actions run when a lead in this funnel is cancelled, i.e. lost. |
| categories | List<FunnelTag> | Task categories defined for this funnel's task definitions, used to group and filter tasks. |
| closedActions | List<GoalAction> | Actions run when a lead in this funnel is closed, i.e. won. |
| customerActivities | List<CustomerAction> | Suggested customer interaction activities offered against leads in this funnel, such as a call or an email. |
| defaultBegin | Begin | The Begin node leads enter this funnel's journey through by default, i.e. the one marked as its initial goal. Computed by init(); null until the funnel has been initialised. |
| derivedFields | List<DerivedFunnelField> | Fields whose value is calculated dynamically by a JS function, rather than being stored directly, alongside this funnel's regular fields. See findDerivedField to look one up by name. |
| disabled | Boolean | Whether this funnel is disabled. A null value is treated as not disabled - see isDisabled for the null-safe primitive check. |
| disabled | boolean | Null-safe check of whether this funnel is disabled. |
| emailCapturePrefix | String | Prefix used to recognise inbound emails as belonging to this funnel, matched against the leading part of the recipient address by LeadManApp when capturing leads from email. |
| entryPoints | List<Begin> | The Begin nodes that a lead can enter this funnel's journey through, i.e. those whose configured next node is a Goal. Computed by init() from this funnel's nodes; empty until the funnel has been initialised. |
| exports | List<FunnelExport> | Named, reusable lead field sets this funnel's leads can be exported with. See findExport to look one up by name. |
| extraFields | List<ExtraField> | Custom fields collected on leads in this funnel, in addition to the built-in lead fields. |
| formattedName | String | Display name for this funnel: its title if set, otherwise its name, otherwise its repository's title or name, falling back to "Untitled journey" if none of those are available. |
| funnelRepo | FunnelRepository | The FunnelRepository backing this funnel, resolved from its branch and cached in the current request's attributes. |
| funnelTesters | List<FunnelTester> | Rules identifying test accounts that should be handled differently to real leads in this funnel. |
| hiddenToSales | boolean | Whether this funnel is hidden from sales-facing lead lists and searches, such as FunnelManager.getNonHiddenFunnels. Defaults to false. |
| jsPaths | List<String> | Repository paths of the JS files loaded into this funnel's script engine, used by executeJs and by FunnelAutomation check functions and DerivedFunnelField calculations. |
| leadNumTemplate | String | A KCode/MVEL template used to calculate a new lead's leadNum property when it is created in this funnel. |
| leadRoleDefs | List<LeadRoleDef> | Custom lead participant roles defined directly on this funnel. Does not include the legacy roles implied by Lead's built-in fields - use FunnelManager.getLeadRoleDefs for the combined list. |
| leadsGroup | String | Configured identifier of the group new leads for this funnel are added to - either a numeric group id or a group name. Use the no-arg leadsGroup() method to resolve this to the actual Group. |
| lostReasons | List<String> | Reasons offered when a lead in this funnel is marked as lost, for selection on an EndGoalAction or CancelGoalAction. |
| name | String | Portable, path-safe identifier for this funnel, taken from its repository name. Used as the lookup key in FunnelCache and FunnelManager. |
| nodes | List<JourneyNode> | All journey nodes making up this funnel's graph - the goals, actions and begin nodes a lead moves between. |
| preferentialJobTitles | List<String> | Job titles that cause a lead to be ranked higher in this funnel. |
| requestAttributes | Map<String,Object> | Scratch attributes attached to this funnel for the duration of the current request/thread, used to pass values such as a matched EmailItem between matches() and onEnter() on a journey node, and to cache getFunnelRepo's result. Not persisted. |
| scoringFactors | List<EngagementScoringFactor> | Engagement scoring rules for this funnel, used by LeadScoringService.calcEngagementScore to compute a lead's engagement score. |
| sources | List<String> | Known lead sources for this funnel, such as "facebook" or "google ads", offered as suggestions in the admin UI. Not exhaustive - a lead's source is not restricted to values in this list. |
| stages | List<Stage> | Ordered list of stages a lead progresses through in this funnel, for example cold, warm, hot. Stage position is used by stageNum and by EngagementScoringFactor's equalOrLess/equalOrGreater comparisons. |
| tags | List<FunnelTag> | Tags defined for this funnel's task definitions, used to group and filter tasks. |
| taskDefs | List<TaskDef> | Task definitions this funnel can create tasks from. See findTaskDef, findTaskDefsByCategory and findTaskDefsByTag to look up individual definitions. |
| title | String | Display title for this funnel. Falls back to the repository's title, then its name, if not explicitly set - see getFormattedName for the resolved value to show in the UI. |
Methods
get(String id) · getName() · getSources() · getTitle() · getLeadsGroup() · getStages() · getExtraFields() · getCustomerActivities() · getCancelledActions() · getClosedActions() · getLostReasons() · getFunnelTesters() · getHiddenToSales() · getLeadNumTemplate() · getDisabled() · getScoringFactors() · getPreferentialJobTitles() · getAutomations() · getJsPaths() · getCategories() · getTags() · getTaskDefs() · getLeadRoleDefs() · getExports() · getDerivedFields() · getEmailCapturePrefix() · executeJs(String function, Object args) · isDisabled() · addLostReason(String s) · addClosedAction(GoalAction a) · addCancelledAction(GoalAction a) · addCustomerAction(boolean b, String id, String text) · addExtraField(String name, String title, boolean required, boolean aggregate) · addStage(String code, String desc) · stageNum(String stageName) · addNode(JourneyNode b) · getEntryPoints() · getNodes() · getBranch() · extraField(String fieldName) · getRequestAttributes() · getFunnelRepo() · getDefaultBegin() · taskGoal(String taskName) · customerActivity(String id) · leadsGroup() · getFormattedName() · findExport(String exportName) · findDerivedField(String name) · hasForks() · findAutomationById(String id) · findTaskDef(String id) · findLeadRoleDef(String roleKey) · findTaskDefsByCategory(String c) · findTaskDefsByTag(String t) · addTaskTag(String id, String title) · addTaskCategory(String id, String title) · addTaskDef(String taskName, String title, String category, String tag) · nodeTitle(String nodeName)
get(String id)
Returns: JourneyNode
Looks up a journey node (a goal, action or begin) in this funnel by its node id.
| Parameter | Description |
|---|---|
id | the node id to look up |
getName()
Returns: String
Portable, path-safe identifier for this funnel, taken from its repository name. Used as the lookup key in FunnelCache and FunnelManager.
getSources()
Returns: List<String>
Known lead sources for this funnel, such as "facebook" or "google ads", offered as suggestions in the admin UI. Not exhaustive - a lead's source is not restricted to values in this list.
getTitle()
Returns: String
Display title for this funnel. Falls back to the repository's title, then its name, if not explicitly set - see getFormattedName for the resolved value to show in the UI.
getLeadsGroup()
Returns: String
Configured identifier of the group new leads for this funnel are added to - either a numeric group id or a group name. Use the no-arg leadsGroup() method to resolve this to the actual Group.
getStages()
Returns: List<Stage>
Ordered list of stages a lead progresses through in this funnel, for example cold, warm, hot. Stage position is used by stageNum and by EngagementScoringFactor's equalOrLess/equalOrGreater comparisons.
getExtraFields()
Returns: List<ExtraField>
Custom fields collected on leads in this funnel, in addition to the built-in lead fields.
getCustomerActivities()
Returns: List<CustomerAction>
Suggested customer interaction activities offered against leads in this funnel, such as a call or an email.
getCancelledActions()
Returns: List<GoalAction>
Actions run when a lead in this funnel is cancelled, i.e. lost.
getClosedActions()
Returns: List<GoalAction>
Actions run when a lead in this funnel is closed, i.e. won.
getLostReasons()
Returns: List<String>
Reasons offered when a lead in this funnel is marked as lost, for selection on an EndGoalAction or CancelGoalAction.
getFunnelTesters()
Returns: List<FunnelTester>
Rules identifying test accounts that should be handled differently to real leads in this funnel.
getHiddenToSales()
Returns: boolean
Whether this funnel is hidden from sales-facing lead lists and searches, such as FunnelManager.getNonHiddenFunnels. Defaults to false.
getLeadNumTemplate()
Returns: String
A KCode/MVEL template used to calculate a new lead's leadNum property when it is created in this funnel.
getDisabled()
Returns: Boolean
Whether this funnel is disabled. A null value is treated as not disabled - see isDisabled for the null-safe primitive check.
getScoringFactors()
Returns: List<EngagementScoringFactor>
Engagement scoring rules for this funnel, used by LeadScoringService.calcEngagementScore to compute a lead's engagement score.
getPreferentialJobTitles()
Returns: List<String>
Job titles that cause a lead to be ranked higher in this funnel.
getAutomations()
Returns: List<FunnelAutomation>
Trigger/action automations attached to this funnel, checked by FunnelManager against each incoming FunnelEvent.
getJsPaths()
Returns: List<String>
Repository paths of the JS files loaded into this funnel's script engine, used by executeJs and by FunnelAutomation check functions and DerivedFunnelField calculations.
getCategories()
Returns: List<FunnelTag>
Task categories defined for this funnel's task definitions, used to group and filter tasks.
getTags()
Returns: List<FunnelTag>
Tags defined for this funnel's task definitions, used to group and filter tasks.
getTaskDefs()
Returns: List<TaskDef>
Task definitions this funnel can create tasks from. See findTaskDef, findTaskDefsByCategory and findTaskDefsByTag to look up individual definitions.
getLeadRoleDefs()
Returns: List<LeadRoleDef>
Custom lead participant roles defined directly on this funnel. Does not include the legacy roles implied by Lead's built-in fields - use FunnelManager.getLeadRoleDefs for the combined list.
getExports()
Returns: List<FunnelExport>
Named, reusable lead field sets this funnel's leads can be exported with. See findExport to look one up by name.
getDerivedFields()
Returns: List<DerivedFunnelField>
Fields whose value is calculated dynamically by a JS function, rather than being stored directly, alongside this funnel's regular fields. See findDerivedField to look one up by name.
getEmailCapturePrefix()
Returns: String
Prefix used to recognise inbound emails as belonging to this funnel, matched against the leading part of the recipient address by LeadManApp when capturing leads from email.
executeJs(String function, Object args)
Returns: Object
Calls a named JS function in this funnel's script engine (built from jsPaths), passing the given arguments through. Used to run FunnelAutomation check functions, DerivedFunnelField calculations and similar scripted behaviour configured on the funnel. Involves script execution so is not cheap; errors from the script are logged and swallowed, returning null.
| Parameter | Description |
|---|---|
function | the name of the JS function to call |
args | arguments passed through to the function |
isDisabled()
Returns: boolean
Null-safe check of whether this funnel is disabled.
addLostReason(String s)
Returns: Funnel
Adds a reason to the list offered when a lead in this funnel is marked lost, creating the list if needed.
| Parameter | Description |
|---|---|
s | the lost reason to add |
addClosedAction(GoalAction a)
Returns: void
Adds an action to be run when a lead in this funnel is closed (won), creating the action list if needed.
| Parameter | Description |
|---|---|
a | the action to run on closure |
addCancelledAction(GoalAction a)
Returns: void
Adds an action to be run when a lead in this funnel is cancelled (lost), creating the action list if needed.
| Parameter | Description |
|---|---|
a | the action to run on cancellation |
addCustomerAction(boolean b, String id, String text)
Returns: Funnel
Adds a suggested customer activity to this funnel, creating the activity list if needed.
| Parameter | Description |
|---|---|
b | whether the activity is enabled by default |
id | unique identifier for the activity |
text | the activity's display text |
addExtraField(String name, String title, boolean required, boolean aggregate)
Returns: Funnel
Adds a custom text field to this funnel's leads, creating the extra field list if needed.
| Parameter | Description |
|---|---|
name | the field's portable identifier |
title | the field's display label |
required | whether the field must be filled in |
aggregate | whether the field's values should be aggregated in reports |
addStage(String code, String desc)
Returns: void
Appends a stage to this funnel's ordered stage list, creating the list if needed.
| Parameter | Description |
|---|---|
code | the stage's portable identifier |
desc | the stage's display description |
stageNum(String stageName)
Returns: Integer
Zero-indexed ordinal position of the given stage name in this funnel's stage list, used to compare stages for order, for example by EngagementScoringFactor's equalOrLess/equalOrGreater modes.
| Parameter | Description |
|---|---|
stageName | the stage name to look up |
addNode(JourneyNode b)
Returns: void
Adds a journey node (a goal, action or begin) to this funnel, indexing it by its node id so it can be found with get().
| Parameter | Description |
|---|---|
b | the node to add |
getEntryPoints()
Returns: List<Begin>
The Begin nodes that a lead can enter this funnel's journey through, i.e. those whose configured next node is a Goal. Computed by init() from this funnel's nodes; empty until the funnel has been initialised.
getNodes()
Returns: List<JourneyNode>
All journey nodes making up this funnel's graph - the goals, actions and begin nodes a lead moves between.
getBranch()
Returns: Branch
The repository branch this funnel is stored against, re-fetched from the current Hibernate session on each call.
extraField(String fieldName)
Returns: ExtraField
Finds one of this funnel's extra field definitions by name.
| Parameter | Description |
|---|---|
fieldName | the field name to look up |
getRequestAttributes()
Returns: Map<String,Object>
Scratch attributes attached to this funnel for the duration of the current request/thread, used to pass values such as a matched EmailItem between matches() and onEnter() on a journey node, and to cache getFunnelRepo's result. Not persisted.
getFunnelRepo()
Returns: FunnelRepository
The FunnelRepository backing this funnel, resolved from its branch and cached in the current request's attributes.
getDefaultBegin()
Returns: Begin
The Begin node leads enter this funnel's journey through by default, i.e. the one marked as its initial goal. Computed by init(); null until the funnel has been initialised.
taskGoal(String taskName)
Returns: TaskGoal
Finds a TaskGoal node in this funnel matching the given task name or task definition id.
| Parameter | Description |
|---|---|
taskName | the task name or task definition id to match |
customerActivity(String id)
Returns: CustomerAction
Finds one of this funnel's suggested customer activities by id.
| Parameter | Description |
|---|---|
id | the activity id to look up |
leadsGroup()
Returns: Group
Resolves the Group new leads for this funnel are added to. Tries getLeadsGroup as a numeric group id first, then as a group name, and finally falls back to the app's default leads group when leadsGroup is blank. Involves a database lookup.
getFormattedName()
Returns: String
Display name for this funnel: its title if set, otherwise its name, otherwise its repository's title or name, falling back to "Untitled journey" if none of those are available.
findExport(String exportName)
Returns: FunnelExport
Finds one of this funnel's named exports by name.
| Parameter | Description |
|---|---|
exportName | the export name to look up |
findDerivedField(String name)
Returns: DerivedFunnelField
Finds one of this funnel's derived field definitions by name.
| Parameter | Description |
|---|---|
name | the derived field name to look up |
hasForks()
Returns: boolean
Checks whether this funnel's journey contains any ForkGoalAction nodes, i.e. whether a lead's journey through it can split into parallel forks.
findAutomationById(String id)
Returns: FunnelAutomation
Finds one of this funnel's automations by id.
| Parameter | Description |
|---|---|
id | the automation id to look up |
findTaskDef(String id)
Returns: TaskDef
Finds one of this funnel's task definitions by its task name.
| Parameter | Description |
|---|---|
id | the task name to look up |
findLeadRoleDef(String roleKey)
Returns: LeadRoleDef
Finds a custom lead role defined directly on this funnel. Does not know about the system roles implied by Lead's legacy fields - use FunnelManager.getLeadRoleDefs/findLeadRoleDef for the combined list.
| Parameter | Description |
|---|---|
roleKey | the role key to look up |
findTaskDefsByCategory(String c)
Returns: List<TaskDef>
Finds all of this funnel's task definitions in the given category.
| Parameter | Description |
|---|---|
c | the category id to match |
findTaskDefsByTag(String t)
Returns: List<TaskDef>
Finds all of this funnel's task definitions carrying the given tag.
| Parameter | Description |
|---|---|
t | the tag id to match |
addTaskTag(String id, String title)
Returns: FunnelTag
Adds a task tag to this funnel, creating the tag list if needed.
| Parameter | Description |
|---|---|
id | the tag's portable identifier |
title | the tag's display label |
addTaskCategory(String id, String title)
Returns: FunnelTag
Adds a task category to this funnel, creating the category list if needed.
| Parameter | Description |
|---|---|
id | the category's portable identifier |
title | the category's display label |
addTaskDef(String taskName, String title, String category, String tag)
Returns: TaskDef
Adds a task definition to this funnel, creating the task definition list if needed.
| Parameter | Description |
|---|---|
taskName | unique name for the task definition, also used as its created tasks' name |
title | template used as the title of tasks created from this definition |
category | id of the category to file the task definition under |
tag | id of a tag to apply to the task definition, or null for none |
nodeTitle(String nodeName)
Returns: String
Display title for a journey node in this funnel, falling back to the node's id if it has no title or does not exist.
| Parameter | Description |
|---|---|
nodeName | the node id to look up |