use of org.kie.workbench.common.stunner.core.rule.violations.DockingRuleViolation in project kie-wb-common by kiegroup.
the class DockingEvaluationHandler method evaluate.
@Override
public RuleViolations evaluate(final CanDock rule, final DockingContext context) {
final DefaultRuleViolations results = new DefaultRuleViolations();
final boolean present = context.getCandidateRoles().stream().filter(cr -> rule.getAllowedRoles().contains(cr)).findAny().isPresent();
if (!present) {
results.addViolation(new DockingRuleViolation(rule.getRole(), context.getCandidateRoles().toString()));
}
return results;
}
Aggregations