protected RuleResult execPlannerFor( RuleRegistry ruleRegistry )
{
flowPlanner.configRuleRegistryDefaults( ruleRegistry );
String registryName = ruleRegistry.getName();
RuleExec ruleExec = new RuleExec( traceWriter, ruleRegistry );
PlannerContext plannerContext = new PlannerContext( ruleRegistry, flowPlanner, flowDef, flow, traceWriter.isTransformTraceEnabled() );
RuleResult ruleResult = ruleExec.exec( plannerContext, flowElementGraph );
getFlowLogger().logInfo( "executed rule registry: {}, completed as: {}, in: {}", registryName, ruleResult.getResultStatus(), formatDurationFromMillis( ruleResult.getDuration() ) );
traceWriter.writeTracePlan( registryName, "completed-flow-element-graph", ruleResult.getAssemblyGraph() );
traceWriter.writeStats( plannerContext, ruleResult );
Exception plannerException;
if( ruleResult.isSuccess() )
plannerException = flowPlanner.verifyResult( ruleResult );
else
plannerException = ruleResult.getPlannerException();
if( plannerException != null && plannerException instanceof PlannerException && ( (PlannerException) plannerException ).getElementGraph() != null )
traceWriter.writeTracePlan( registryName, "failed-source-element-graph", ( (PlannerException) plannerException ).getElementGraph() );
if( ruleResult.isSuccess() && plannerException != null )
rethrow( plannerException );
return ruleResult;
}