return this.getCurrentPage();
}
private FlowActivityImplementor getTargetFAInNextFlow(FlowActivityImplementor currentFAInOriginalFlow,
List<FlowActivityImplementor> originalFAs, List<FlowActivityImplementor> nextFAs) {
FlowActivity flowActivity = this.getActivity(currentFAInOriginalFlow.getFlowPropertyProviderName());
if ( flowActivity != null ) {
// cool .. exact match on the names.
return (FlowActivityImplementor) flowActivity;
}
// find the first FlowActivity that is after all the flowActivities with the same names
// as FlowActivities in the previous flow.to find the same approximate spot in the the new flow.
int newCurrentIndex = this.getCurrentActivityIndex();
for (int prevIndex = 0; prevIndex < originalFAs.size(); prevIndex++) {
FlowActivity originalFA = originalFAs.get(prevIndex);
if ( isEqualTo(originalFA, currentFAInOriginalFlow)) {
break;
}
for(int nextIndex = newCurrentIndex; nextIndex < nextFAs.size(); nextIndex++) {
FlowActivity nextFA = nextFAs.get(nextIndex);
if(isEqualTo(originalFA, nextFA)) {
newCurrentIndex = nextIndex+1;
}
}
}