Title: Weighted Chain The WeightedChain takes a list of [EnhancementEngine](../engines) names as input and uses the "org.apache.stanbol.enhancer.engine.order" metadata of the configured Engines to calculate an ExecutionPlan. This chain is designed for easy configuration - just a list of the engine names - but has limited possibilities to control the execution order. ## Configuration The property "stanbol.enhancer.chain.weighted.chain" is used to provide the list of engine names. Both arrays and collections are supported as values. In addition it is possible to define engines as optional. This allows to specify that the enhancement process should not fail if an engine is not active or fails while processing a content item. The syntax to define an Engine as optional is as follows _(Both variants make the execution of the engine with the name optional.)_: :::text ;optional ;optional=true ![Configuration dialog for the WeightedCahin](enhancer-weightedchain-config.png "Screenshot of the configuration dialog for a WeightedChain with two required and one optional engine") ## Calculation of the ExecutionPlan It is important to note that the ordering of the list has no influence on the ExecutionPlan because the order of execution of the configured [EnhancementEngines](../engines) is calculated only by using the value of the "org.apache.stanbol.enhancer.engine.order" property provided by the EnhancementEngine: * Engines with a lower order are executed before engines with a higher value * Engines with the same order may be executed simultaneously if the EnhancementJobManager and the EnhancementEngine do support this feature. The WeightedCahin follows exactly the same algorithm as the WeightedJobManager used to decide the execution order of all active EnhancementEngines. However the WeightedChain will only consider configured chains and ignore others. The following image shows the ExecutionPlan as calculated based on the above configuration. ![ExecutionPlan for the keyword chain](enhancer-weightedchain-allactive.png "The ExecutionPlan is calculated based on the 'order' information of the Enhancement Engines. In this case first 'metaxa' is used to convert any type of content to plain text; second the 'langid' engine is used to detect the language and third the words mentioned in the text are used to lookup entities in DBpedia.org") If some of the Enhancement Engines are not available this will be visualized as follows. If you parse content by using the RESTful interface similar information will be available via the the Execution Metadata included in the metadata of the enhanced content item. ![Optional Engine is inactive](enhancer-weightedchain-optionalinactive.png "The optional 'metaxa' engine is inactive. The engines can still be executed however content other than plain text will bot get enhanced") This shows that the optional engine 'metaxa' is currently not available. The chain can be still used however the functionality provided by this optional engine will not be available. In this case only requests for plain text files could be processed. The next figure shows a situation where a required engine is not active. Requests to this chain will fail until all required engines are active. ![Required Engine is inactive](enhancer-weightedchain-requiredinactive.png "The required 'langid' engine is not active. Because of this requests to this chain will fail.")