Procedure
The procedure to include custom configuration or custom logic is given below:
1. Create a new CUSTOM_DISCREPANCY in DiscrepancyTypeRB.rbInfo using enumCustomize tool.
2. Create a new delegate CustomDiscrepancyDelegate and add an entry in the WT_HOME/codebase/com/ptc/windchill/associativity/xconfs/associativity.service.properties.xconf file.
<Option cardinality="singleton" selector="CUSTOM_DISCREPANCY" requestor="null"
serviceClass="com.ptc.windchill.associativity.reconciliation.part.CustomDiscrepancyDelegate"/>
Implement the following methods in CustomDiscrepancyDelegate:
public Collection<Discrepancy2> detect(ReconciliationContext context, AssociativePath currentPath,AssociativePath oldPath) throws WTException ;
Provides the logic to detect discrepancies.
public void verify(ReconciliationContext context, Collection<? extends Discrepancy2> discrepancies) throws WTException;
Provides the logic to verify the discrepancies. It provides separation of logic to find a discrepancy and verify if it is valid and can be handled by resolve.
public ReconciliationReport resolve(ReconciliationContext context, Collection<? extends Discrepancy2> discrepancies) throws WTException;
Provides the logic to resolve the discrepancies.
protected AbstractDiscrepancy2 getDiscrepancyInstance(ReconciliationContext context) throws WTException;
Returns an instance of custom discrepancy. This can be overridden to use the instance from JSON (ReconciliationContext, String) method to populate default information.
public boolean isOccurrenceBased();
Specifies whether the discrepancy is occurrence based or usage based.
public String toJSON(ReconciliationContext context, Discrepancy2 discrepancy) throws WTException;
Provides a way to transfer information from server to client. Each delegate ensures that all the required information is translated so that it can be converted back to Discrepancy2. If it is required to be resolved, call the super method before adding specific information to JSON.
public Discrepancy2 fromJSON(ReconciliationContext context, String discrepancyData) throws WTException;
Provides a way to transfer client information back to server objects. Each delegate ensures that all the required data is translated to be consistent with JSON (ReconciliationContext, Discrepancy2). Call the super method before handling specific information.
The configuration for CustomDiscrepancyDelegate is given below:
Was this helpful?