use of org.camunda.bpm.dmn.engine.impl.spi.hitpolicy.DmnHitPolicyHandler in project camunda-engine-dmn by camunda.
the class DmnDecisionTableTransformHandler method getHitPolicyHandler.
protected DmnHitPolicyHandler getHitPolicyHandler(DmnElementTransformContext context, DecisionTable decisionTable, DmnDecisionTableImpl dmnDecisionTable) {
HitPolicy hitPolicy = decisionTable.getHitPolicy();
if (hitPolicy == null) {
// use default hit policy
hitPolicy = HitPolicy.UNIQUE;
}
BuiltinAggregator aggregation = decisionTable.getAggregation();
DmnHitPolicyHandler hitPolicyHandler = context.getHitPolicyHandlerRegistry().getHandler(hitPolicy, aggregation);
if (hitPolicyHandler != null) {
return hitPolicyHandler;
} else {
throw LOG.hitPolicyNotSupported(dmnDecisionTable, hitPolicy, aggregation);
}
}
use of org.camunda.bpm.dmn.engine.impl.spi.hitpolicy.DmnHitPolicyHandler in project camunda-engine-dmn by camunda.
the class DmnDecisionTableEvaluationListenerTest method setDecisionTableHitPolicy.
// helper
public void setDecisionTableHitPolicy(HitPolicy hitPolicy, BuiltinAggregator aggregator) {
DmnHitPolicyHandler handler = hitPolicyHandlerRegistry.getHandler(hitPolicy, aggregator);
assertThat(handler).isNotNull();
DmnDecisionTableImpl decisionTable = (DmnDecisionTableImpl) this.decision.getDecisionLogic();
decisionTable.setHitPolicyHandler(handler);
}
Aggregations