}
int activity = flow.getCurrentActivityIndex();
String blockName = FlowWebUtils.getBlockName(activity);
IComponent comp = getComponentSafe(blockName);
if(comp==null) {
FlowActivity flowActivity = flow.getCurrentActivity();
if(flowActivity == null){
String message = getStartErrorMessage(flow) + "' but current activity (#" + activity + ") is null. Flow state: " + flow.getFlowStateLifecycle() + "; Values: " + flow.getFlowValuesMap() ;
throw new IllegalStateException(message);
} else {
String message = getStartErrorMessage(flow) + "' but there is no component named '" + blockName + "'. This should be the block containing the FlowActivity named '" + flowActivity.getFlowPropertyProviderName() + "' (activity #" + activity + ") ";
if ( flowActivity.isInvisible() ) {
throw new IllegalStateException(message+" -- this is an invisible activity");
} else {
throw new IllegalStateException(message+" -- flow activity claims it is supposed to be visible. Are you sure this flow is defined on this page?");
}
}