Extension point AdjustMergeQualificationModel

Since 8.1.0.05

The extension point AdjustMergeQualificationModel is used to adjust a QualificationModel. Can be used to change the ActionType for specific entities and fields.

The class has to be a class implementing the interface com.heiler.ppm.merge.core.extpoints.MergeQualificationModelAdjuster. The contributed implementation is called before starting a merge or versioning process.

For details, please check the JavaDoc of the extension point and the interface.

Example

The example shows an implementation that exclude ArticlePriceType from merge and versioning processes.

public class CustomMergeQualificationModelAdjuster implements MergeQualificationModelAdjuster
{
 
public CustomMergeQualificationModelAdjuster()
{
}
 
@Override
public void adjust( QualificationModel qualificationModel, InitiatorModule initiatorModule )
{
excludeEntityTypeFromMerge( qualificationModel, "ArticlePriceType" ); //$NON-NLS-1$
}
 
private void excludeEntityTypeFromMerge( QualificationModel qualificationModel, String entityType )
{
Stream< QualificationElement > childrenStream = Arrays.asList( qualificationModel.getRootElement()
.getChildren( false ) )
.stream();
childrenStream.filter( EntityQualificationElement.class::isInstance )
.map( EntityQualificationElement.class::cast )
.filter( x -> {
 
return x.getEntity()
.getEntityType()
.getIdentifier()
.equals( entityType );
} )
.forEach( entityQualificationElement -> {
entityQualificationElement.setActionType( new ActionType( "NO_MERGE" ), new NullProgressMonitor(), //$NON-NLS-1$
true );
} );
}
 
}