/** * Creates a new execution plan based on the configured {@link #chain} and * the currently available {@link EnhancementEngine}s. If required * {@link EnhancementEngine}s are missing a {@link ChainException} will be * thrown. * @return the execution plan * @throws ChainException if a required {@link EnhancementEngine} of the * configured {@link #chain} is not active. */ private ImmutableGraph createExecutionPlan() throws ChainException { List<EnhancementEngine> availableEngines = new ArrayList<EnhancementEngine>(chain.size()); Set<String> optionalEngines = new HashSet<String>(); Set<String> missingEngines = new HashSet<String>(); for(Entry<String,Map<String,List<String>>> entry : chain.entrySet()){ boolean optional = getState(entry.getValue(),"optional"); EnhancementEngine engine = tracker.getEngine(entry.getKey()); if(engine != null){ availableEngines.add(engine); } else { missingEngines.add(entry.getKey()); } if(optional){ optionalEngines.add(entry.getKey()); } } return calculateExecutionPlan(getName(),availableEngines,optionalEngines, missingEngines,chainScopedEnhProps); }
writeExecutionNode(graph, epNode, node.getKey(), getState(node.getValue(), "optional"), null, getEnhancementProperties(node.getValue())),
+ "twice in the configured list!"); boolean optional = getState(parsed.getValue(), "optional"); log.debug(" > Engine: {} ({})",parsed.getKey(),optional? "optional" : "required"); last = writeExecutionNode(ep, epNode, parsed.getKey(), optional,