I've created a visualforce page that has a "popup" (aka outputpanel that is rendered when the flow is called). This works fine for Flows that don't reference another flow.

I've created a flow that has another flow embedded in it, but it will not show the second flow on my visualforce page. What appears to be happening is when the second flow is called the visualforce page is being called again, thus running the constructor in the custom controller. By default the popup is set to rendered=false, so the second flow never runs.

As part of debugging I've set the popup to always render. I can see the data pass bewteen the inital flow and the one being called. The first three flows work just fine.

All I can think of is to set a flag in an object to indicate that the flow is still active, so when the inital flow calls others the outputpanel continues to render.

<apex:component controller="OrderController" allowDML="true">
  <apex:attribute name="UsrID" description="The id of the contact user for the Meal"
                  type="String" required="required" assignTo="{!UserID}"/>
    <apex:pageBlock id="item">
        <apex:form >
               <td width="213" rowspan="2">
                    <apex:image value="{!$Resource.PhotoHolder}"/>                   
                    <apex:commandButton action="{!EditItem}" image="{!$Resource.edit}" reRender="modifier"/>  
                   <apex:commandButton action="{!RemoveItem}" image="{!$Resource.decrease}" reRender="Order,item"/>
                   &nbsp;{!if (IsNew,0,orderitem.quantity__C)}&nbsp;
                   <apex:commandButton action="{!AddItem}" image="{!$Resource.increase}" reRender="Order,item,flow" />                   
 <apex:outputPanel id="flow">
    <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!ShowFlow}"/>
    <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!ShowFlow}">
        <!--This is generating an error. Doing a static workaround
        <apex:dynamicComponent componentValue="{!Oflow}" />  -->
        <flow:interview name="OptAssIng" interview="{!OAIFlow}"  rendered="{!ShowModFlow}"/>
        <flow:interview name="SoupSize" interview="{!SSFlow}"  rendered="{!ShowSoupFlow}"/>
        <flow:interview name="BrettsPFlow" interview="{!PFlow}"  rendered="{!ShowPlateFlow}"/>
        <flow:interview name="N_Order_Flow" interview="{!NOFlow}"  rendered="{!ShowOrderFlow}"/>                

<style type="text/css">
    .row {overflow:hidden; position:absolute;}
    .row {left:0; right: 0;}
    .search.row {top: 0 ; height:29px;}
    .menu.row {top:30px; height:40%;}
    .order.row {bottom:0; top:44%;}
    .scroll-y {overflow-y:auto;}
        background-color: white;
        border-width: 2px;
        border-style: solid;
        z-index: 9999;
        left: 20%;
        right: 20%;
       position: absolute;
       /*   These are the 3 css properties you will need to change so the popup 
        displays in the center of the screen. First set the width. Then set 
        margin-left to negative half of what the width is. You can add 
        the height property for a fixed size pop up if you want.*/
        width: 200px;

        opacity: 0.20;
        filter: alpha(opacity = 20);
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: 9998;


public class OrderController{

    string ItemSearch;
    boolean ShowModifier;
    boolean ShowAdd;
    public boolean ShowCategory {get;set;}
    public boolean ShowFlow {get;set;}
    public boolean ShowModFlow {get;set;}
    public boolean ShowAssMod {get;set;}
    public boolean ShowSoupFlow {get;set;}
    public boolean ShowPlateFlow {get;set;}
    public boolean ShowOrder {get;set;} 
    public boolean ShowOrderFlow {get;set;}
    boolean IsNew;
    list<asset_in_meal__C> MyOrder;
    list<asset> Menu;
    list<AggregateResult> MenuCategories;
    asset Item;
    case Meal;
    asset_in_meal__C OrderItem;
    contact cnct;
    decimal rating;
    string ModCopy;
    public list<assetmodifierWrapper> ModChooser {get;set;}
    public string ModComments {get;set;}
    //public component.flow.interview OFlow {get;set;}
    public flow.interview.OptAssIng OAIFlow {get;set;}
    public flow.interview.SoupSize SSFlow {get;set;}
    public flow.interview.BrettsPFlow PFlow {get;set;}
    public flow.interview.Nepo_Order_Flow NOFlow {get;set;}
    ID UserID;

    public OrderController(){    
        ShowCategory = true;
        ShowModifier = false;
        ShowModFlow = false;
        ShowSoupFlow = false;
       ShowFlow = true;
        ShowPlateFlow = false;
        ShowOrder = true;
        ShowOrderFlow = true;


    void construct(){

        MyOrder = [select asset__r.name,quantity__c,id,asset__r.id from asset_in_meal__c where meal__r.id = :meal.id];

public void AddItem(){
  //  system.debug(ApexPages.currentPage().getParameters().get('itmtyp'));
    if (IsNew){          
     orderitem = new asset_in_meal__c(meal__c=meal.id,quantity__c=1,asset__c=item.id);
     insert orderitem;
    // system.debug(orderitem.id);

     if (string.IsNotBlank(item.OrderFlow__c)){
            map<string,object> ParmMap = new map<string,object>();
            ShowFlow = true;

            if (item.orderflow__c=='OptAssIng'){
                ShowModFlow = true;

                OAIFlow = new flow.interview.OptAssIng(ParmMap);
                /*this is generating an error, doing a static workaround
                OFlow = new component.flow.interview(name = item.OrderFLow__c);*/
            } else if(item.orderflow__c =='SoupSize' || item.OrderFlow__c=='GlassBottle') {
                ShowSoupFlow= true;

                SSFlow = new flow.interview.SoupSize(ParmMap);

            } else if (item.orderflow__c.StartsWith ('BYO')) {
                ShowPlateFlow = true;

                PFLow = new flow.interview.BrettsPFlow(ParmMap);

            } else if (item.OrderFlow__c == 'quesa') {
                ShowPlateFlow = true;

                PFLow = new flow.Interview.BrettsPFlow(ParmMap);
            } else  {
                ShowOrderFlow = true;

                NOFLow = new flow.Interview.Nepo_Order_Flow(ParmMap);

    } else {
        orderitem.quantity__c = orderitem.quantity__c +1;//this will need to go into the nepoOrdering class to look for availability
        upsert orderitem;
     MyOrder = [select asset__r.name,quantity__c,id,asset__r.id from asset_in_meal__c where meal__r.id = :meal.id];              
 // return null;   


  • 1
    It would be helpful if you could share your code so we can see what you are trying to do.
    – JimRae
    May 29, 2014 at 19:48
  • what you are describing sounds like standard visual-workflow functionality. When you enter a flow, or pass between one to another, the page refreshes. This makes it challenging if trying to gather information in an apex:form AND from a workflow, but like @JimRae mentioned, without code it is difficult to offer better comments or answers
    – Tezyn
    May 29, 2014 at 20:07
  • Do you pass the variables as input/output parameters within your flows? And are the variables itself set to input AND output? Apr 20, 2015 at 6:52

2 Answers 2


If the issue is related to the page render, I would suggest you add a rerender tag on your interview lines and just update the panel you have the flows running in.


Thanks for sharing your code. I'm trying to run it to compose a solution for you. The component code is missing the /apex:component closing tag, so I don't know how much was cut off the end, but it won't save in its current state. There is no code provided for the Visualforce page, and the Class needs some custom objects, e.g. asset_in_meal__c, before it will save. Then, the flows are missing, as well...

Consider reducing your sample to the minimum required to illustrate the problem, and provide the complete package. Short of that, we can only speculate vs. provide a working solution.

  • The calling VisualForce page only calls this component, headers and sidebar. The full code is quite large and does incorporate both custom and standard objects. The issue I'm having is flows within flows are not passing data via variables. I'm not sure how to post what the flows are.
    – MarcoC
    Jun 1, 2014 at 10:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .