lib/flowBuilder.js
/**
 * Builds all subflows for this flow
 * @param flowInst
 * @param subflowSpecImpls   array of subflow specification objects
 */
Builds all subflows for this flow
@param flowInst
@param subflowSpecImpls   array of subflow specification objects
Builds all subflows for this flow @param flowInst @param subflowSpecImpls array of subflow specification objects
function buildSubflows(flowInst, subflowSpecImpls) {
    var flowInstance = flowInst;
    var subflowNames = [];
    if(subflowSpecImpls) {
        flowInst._subflows = {};
        subflowSpecImpls.forEach( function(subflowSpecImpl) {
            var subflow = new Flow(flowInstance._flowEventListeners, flowInstance.id, flowInstance);
            subflow._isSubflow = true;
            subflow._stateBuilderStartIndex = flowInstance._stateBuilderEndIndex + 1;
            subflow.setRenderCallback(flowInstance._renderCallback);
            buildFlow(subflow, subflowSpecImpl);
            flowInstance._subflows[subflow.name] = subflow;
            assert(!subflowNames[subflow.name], 'Subflow name: ' + subflow.name + '  is NOT unique');
            subflowNames[subflow.name] = subflow.name;
            flowInstance._stateBuilderEndIndex = subflow._stateBuilderEndIndex;
        });
    }
}
function buildSubflows ( flowInst , subflowSpecImpls ) { var flowInstance = flowInst ; var subflowNames = [ ] ; if ( subflowSpecImpls ) { flowInst . _subflows = { } ; subflowSpecImpls . forEach ( function ( subflowSpecImpl ) { var subflow = new Flow ( flowInstance . _flowEventListeners , flowInstance . id , flowInstance ) ; subflow . _isSubflow = true ; subflow . _stateBuilderStartIndex = flowInstance . _stateBuilderEndIndex + 1 ; subflow . setRenderCallback ( flowInstance . _renderCallback ) ; buildFlow ( subflow , subflowSpecImpl ) ; flowInstance . _subflows [ subflow . name ] = subflow ; assert ( ! subflowNames [ subflow . name ] , 'Subflow name: ' + subflow . name + '  is NOT unique' ) ; subflowNames [ subflow . name ] = subflow . name ; flowInstance . _stateBuilderEndIndex = subflow . _stateBuilderEndIndex ; } ) ; } }
Builds all subflows for this flow
 @param flowInst
 @param subflowSpecImpls   array of subflow specification objects
Builds all subflows for this flow @param flowInst @param subflowSpecImpls array of subflow specification objects
//    debug('>>>>>>>>>>flow:'); //    debug(flowInst); //    debug('>>>>>>>>>>Subflow specs:'); //    debug(subflowSpecImpls); // validate that subflow names are unique