Newer Version Available

This content describes an older version of this product. View Latest

Interview Class

The Flow.Interview class provides advanced Visualforce controller access to flows.

Namespace

Flow

Usage

Used with Visual Workflow, the Flow.Interview class has one method, which enables a Visualforce controller to access the value of a flow variable embedded in the Visualforce page, or in a separate flow called by a subflow element.

Example

The following sample uses the getVariableValue method to obtain breadcrumb (navigation) information from the flow embedded in the Visualforce page. If that flow contains subflow elements, and each of the referenced flows also contains a vaBreadCrumb variable, the Visualforce page can provide users with breadcrumbs regardless of which flow the interview is running.
1swfobject.registerObject("clippy.flow_getVariableValue_codesample", "9");public class SampleContoller {
2
3   //Instance of the flow
4   public Flow.Interview.Flow_Template_Gallery myFlow {get; set;}
5
6   public String getBreadCrumb() {
7      String aBreadCrumb;
8      if (myFlow==null) { return 'Home';}
9      else aBreadCrumb = (String) myFlow.getVariableValue('vaBreadCrumb');
10
11      return(aBreadCrumb==null ? 'Home': aBreadCrumb);
12
13   }
14}
15

Interview Methods

The following are instance methods for Interview.

getVariableValue(String)

Returns the value of the specified flow variable. The flow variable can be in the flow embedded in the Visualforce page, or in a separate flow that is called by a subflow element.

Signature

public Object getVariableValue(String variableName)

Parameters

variableName
Type: String
Specifies the unique name of the flow variable.

Return Value

Type: Object

Usage

The returned variable value comes from whichever flow the interview is currently running. If the specified variable can’t be found in that flow, the method returns null.

This method checks for the existence of the variable at run time only, not at compile time.