Personalizzazione avanzata > Business Logic Customization > Customizing MPMLink > Customizing Consumption Discrepancy Search
  
Customizing Consumption Discrepancy Search
Objective
To configure the Resolve Consumption Discrepancies action to display custom output while detecting discrepancies.
Problem Statement
Provide additional configuration to compare the paths between the upstream and downstream structures based on custom logic when identifying discrepancies.
Background
The Resolve Consumption Discrepancies action provides the capability to fix unresolved consumption links for a given downstream structure.
Intended Outcome
Display the desired custom discrepancy information in the Consumption Discrepancy Report dialog box.
Solution
Extend the abstract class HealConsumptionDelegate to create your own delegate with custom logic. This abstract class provides the default implementation for the methods in the interface.
Here is an example of an out-of-the-box configuration. The xconf file for configuration associativity.service.properties.xconf, is located at codebase\com\ptc\windchill\associativity\xconfs.
<Service context="default" name="com.ptc.windchill.associativity.consumption.HealConsumptionDelegate">
<Option cardinality="singleton" requestor="java.lang.Object" serviceClass="com.ptc.windchill.associativity.consumption.DefaultHealConsumptionDelegate"/>
</Service>
The following API provides additional hooks to add custom logic to match the paths apart from the out-of-the-box logic for identifying discrepancy.
protected void matchOnCustomLogic(Collection<AssociativePath> upPaths, Collection<AssociativePath> downPaths, HealConsumptionParams params, HealConsumptionReport report) throws WTException