public boolean isUnsupported() { return getPlannerException() instanceof UnsupportedPlanException; }
public boolean isInterrupted() { return getPlannerException() instanceof InterruptedException; }
private void notifyUnsupported() { if( unsupported.isEmpty() ) return; for( RuleResult ruleResult : unsupported ) getFlowLogger().logInfo( "rule registry: {}, does not support assembly", ruleResult.getRegistry().getName() ); if( !registrySet.isIgnoreFailed() || success.isEmpty() && illegal.isEmpty() && interrupted.isEmpty() ) rethrow( unsupported.get( 0 ).getPlannerException() ); }
private void notifyIllegal() { if( illegal.isEmpty() ) return; for( RuleResult ruleResult : illegal ) getFlowLogger().logInfo( "rule registry: {}, found assembly to be malformed", ruleResult.getRegistry().getName() ); if( !registrySet.isIgnoreFailed() || success.isEmpty() ) rethrow( illegal.get( 0 ).getPlannerException() ); }
private void notifyInterrupted() { if( interrupted.isEmpty() ) return; for( RuleResult ruleResult : interrupted ) getFlowLogger().logInfo( "rule registry: {}, planned longer than default duration, was cancelled", ruleResult.getRegistry().getName() ); if( interrupted.size() == registrySet.size() ) throw new PlannerException( "planner registry timeout exceeded for all registries: " + formatDurationFromMillis( registrySet.getPlannerTimeoutSec() * 1000 ) ); if( !registrySet.isIgnoreFailed() || success.isEmpty() ) rethrow( interrupted.get( 0 ).getPlannerException() ); }
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(); // will be re-thrown below 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; }