use of org.finos.waltz.data.GenericSelector in project waltz by khartec.
the class FlowClassificationRuleService method findClassificationRules.
public Set<FlowClassificationRule> findClassificationRules(IdSelectionOptions options) {
Condition customSelectionCriteria;
switch(options.entityReference().kind()) {
case ORG_UNIT:
GenericSelector orgUnitSelector = genericSelectorFactory.apply(options);
customSelectionCriteria = Tables.FLOW_CLASSIFICATION_RULE.PARENT_ID.in(orgUnitSelector.selector()).and(FlowClassificationRuleDao.SUPPLIER_APP.KIND.notIn(options.filters().omitApplicationKinds()));
break;
case DATA_TYPE:
GenericSelector dataTypeSelector = genericSelectorFactory.apply(options);
customSelectionCriteria = Tables.FLOW_CLASSIFICATION_RULE.DATA_TYPE_ID.in(dataTypeSelector.selector()).and(FlowClassificationRuleDao.SUPPLIER_APP.KIND.notIn(options.filters().omitApplicationKinds()));
break;
case APP_GROUP:
case FLOW_DIAGRAM:
case MEASURABLE:
case PERSON:
customSelectionCriteria = mkConsumerSelectionCondition(options);
break;
default:
throw new UnsupportedOperationException("Cannot calculate flow classification rules for ref" + options.entityReference());
}
return flowClassificationRuleDao.findClassificationRules(customSelectionCriteria);
}
use of org.finos.waltz.data.GenericSelector in project waltz by khartec.
the class FlowClassificationRuleService method findDiscouragedSources.
public List<DiscouragedSource> findDiscouragedSources(IdSelectionOptions options) {
Condition customSelectionCriteria;
switch(options.entityReference().kind()) {
case DATA_TYPE:
GenericSelector dataTypeSelector = genericSelectorFactory.apply(options);
customSelectionCriteria = LOGICAL_FLOW_DECORATOR.DECORATOR_ENTITY_ID.in(dataTypeSelector.selector()).and(FlowClassificationRuleDao.SUPPLIER_APP.KIND.notIn(options.filters().omitApplicationKinds()));
break;
case ORG_UNIT:
GenericSelector orgUnitSelector = genericSelectorFactory.apply(options);
customSelectionCriteria = FlowClassificationRuleDao.CONSUMER_APP.ORGANISATIONAL_UNIT_ID.in(orgUnitSelector.selector()).and(FlowClassificationRuleDao.SUPPLIER_APP.KIND.notIn(options.filters().omitApplicationKinds()));
break;
case APP_GROUP:
case FLOW_DIAGRAM:
case MEASURABLE:
case PERSON:
customSelectionCriteria = mkConsumerSelectionCondition(options);
break;
default:
throw new UnsupportedOperationException("Cannot calculate discouraged sources for ref" + options.entityReference());
}
return flowClassificationRuleDao.findDiscouragedSourcesBySelector(customSelectionCriteria);
}
use of org.finos.waltz.data.GenericSelector in project waltz by khartec.
the class FlowDiagramEntityService method deleteForEntitySelector.
public int deleteForEntitySelector(IdSelectionOptions options) {
checkNotNull(options, "options cannot be null");
GenericSelector selector = genericSelectorFactory.apply(options);
return flowDiagramEntityDao.deleteForGenericEntitySelector(selector);
}
Aggregations