public class FlowController { public Flow.Interview.flowname myflow { get; set; } public Case apexCaseVar; public Case getApexCaseVar() { return myflow.caseVar; } }
<apex:page controller="FlowController" tabStyle="Case"> <flow:interview name="flowname" interview="{!myflow}"/> <apex:outputText value="Default Case Priority: {!apexCaseVar.Priority}"/> </apex:page>
public class FlowController { public Flow.Interview.flowname myflow { get; set; } public List<String> getVarValue() { if (myflow == null) { return null; } else { return (List<String>)myflow.emailsCollVar; } } }
<apex:page controller="FlowController"> <flow:interview name="flowname" interview="{!myflow}" /> <apex:repeat value="{!varValue}" var="item"> <apex:outputText value="{!item}"/><br/> </apex:repeat> </apex:page>
The following example uses an Apex class to set the flow to {!myflow} and then uses a Visualforce page to run the flow interview. The Visualforce page uses a data table to iterate over the flow’s sObject collection variable and display the values for each item in the collection.
public class MyCustomController { public Flow.Interview.flowname myflow { get; set; } }
<apex:page controller="MyCustomController" tabStyle="Account"> <flow:interview name="flowname" interview="{!myflow}" reRender="nameSection" /> <!-- The data table iterates over the variable set in the "value" attribute and sets that variable to the value for the "var" attribute, so that instead of referencing {!myflow.collectionVariable} in each column, you can simply refer to "account".--> <apex:dataTable value="{!myflow.collectionVariable}" var="account" rowClasses="odd,even" border="1" cellpadding="4"> <!-- Add a column for each value that you want to display.--> <apex:column > <apex:facet name="header">Name</apex:facet> <apex:outputlink value="/{!account['Id']}"> {!account['Name']} </apex:outputlink> </apex:column> <apex:column > <apex:facet name="header">Rating</apex:facet> <apex:outputText value="{!account['Rating']}"/> </apex:column> <apex:column > <apex:facet name="header">Billing City</apex:facet> <apex:outputText value="{!account['BillingCity']}"/> </apex:column> <apex:column > <apex:facet name="header">Employees</apex:facet> <apex:outputText value="{!account['NumberOfEmployees']}"/> </apex:column> </apex:dataTable> </apex:page>
Depending
on the contents of the sObject collection variable in your flow, here’s what
that data table looks like.