Search in sources :

Example 1 with ChangeInitiative

use of org.finos.waltz.model.change_initiative.ChangeInitiative in project waltz by khartec.

the class FlowDiagramService method makeForChangeInitiative.

private Long makeForChangeInitiative(EntityReference ref, String userId, String providedTitle) {
    ChangeInitiative changeInitiative = changeInitiativeDao.getById(ref.id());
    String title = isEmpty(providedTitle) ? changeInitiative.name() + " flows" : providedTitle;
    return mkNewFlowDiagram(title, userId, newArrayList(mkDiagramEntity(changeInitiative)), emptyList());
}
Also used : ChangeInitiative(org.finos.waltz.model.change_initiative.ChangeInitiative)

Example 2 with ChangeInitiative

use of org.finos.waltz.model.change_initiative.ChangeInitiative in project waltz by khartec.

the class ChangeInitiativeSearchDao method search.

@Override
public List<ChangeInitiative> search(EntitySearchOptions options) {
    List<String> terms = SearchUtilities.mkTerms(options.searchQuery());
    if (terms.isEmpty()) {
        return emptyList();
    }
    Condition nameCondition = JooqUtilities.mkBasicTermSearch(CHANGE_INITIATIVE.NAME, terms);
    List<ChangeInitiative> ciViaName = dsl.select(CHANGE_INITIATIVE.fields()).from(CHANGE_INITIATIVE).where(nameCondition).orderBy(CHANGE_INITIATIVE.NAME).limit(options.limit()).fetch(ChangeInitiativeDao.TO_DOMAIN_MAPPER);
    List<ChangeInitiative> ciViaFullText = searcher.searchFullText(dsl, options);
    return new ArrayList<>(orderedUnion(ciViaName, ciViaFullText));
}
Also used : Condition(org.jooq.Condition) ChangeInitiative(org.finos.waltz.model.change_initiative.ChangeInitiative) ArrayList(java.util.ArrayList)

Aggregations

ChangeInitiative (org.finos.waltz.model.change_initiative.ChangeInitiative)2 ArrayList (java.util.ArrayList)1 Condition (org.jooq.Condition)1