Rule-based Processing Concepts
Rule-based processing is a post-processing step applied to an analyzed merge result (ANALYZED_DELTAV2) that automatically resolves simple, unambiguous changes without requiring human intervention.
How It Works
After the merge analysis step classifies each change as add, delete, or modify, rule-based processing applies a set of resolution rules:
-
Simple add (a single-branch addition with no
!=in the deltaV2 attribute): automatically accepted. -
Simple delete (a single-branch deletion with no
!=): automatically removed. -
Conflict (contains
!=, meaning multiple versions differ): left unresolved for human review. -
Modify: left unresolved.
The result is a RULE_PROCESSED_DELTAV2 document where simple changes have been collapsed and complex changes (conflicts) remain marked with their deltaV2 attributes.
Result Types
|
Result Type |
Description |
|---|---|
|
|
Auto-resolves simple adds and deletes; leaves conflicts |
|
|
Same resolution, but in simplified DeltaV2 format |
Command Line Example
java -jar deltanova-year.x.y.z.jar merge concurrent \
ancestor ancestor.xml \
anna anna.xml \
ben ben.xml \
result.xml \
ResultType=RULE_PROCESSED_DELTAV2
Java API Example
ConcurrentMerge merge = new ConcurrentMerge();
merge.setResultType(ConcurrentMergeResultType.RULE_PROCESSED_DELTAV2);
merge.extractAll(ancestorFile, inputFiles, resultFile);
Configuring Custom Rules
Advanced rule configuration allows you to define XPath-based conditions for additional auto-resolution. Rules are specified in an XML configuration file:
<rules xmlns="http://www.deltaxml.com/ns/merge/rules">
<rule>
<condition>@deltaxml:edit-type = 'add' and not(contains(@deltaxml:deltaV2, '!='))</condition>
<action>accept</action>
</rule>
</rules>
Pass the rules file to the API using the setRulesFile() method or the RulesFile command-line parameter.