Search in sources :

Example 1 with ActionInsertFactFieldsDefinedEvent

use of org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.events.ActionInsertFactFieldsDefinedEvent in project drools-wb by kiegroup.

the class ActionInsertFactFieldsPage method isComplete.

@Override
public void isComplete(final Callback<Boolean> callback) {
    // Do all Patterns have unique bindings?
    final boolean arePatternBindingsUnique = getValidator().arePatternBindingsUnique();
    // Signal duplicates to other pages
    final DuplicatePatternsEvent event = new DuplicatePatternsEvent(arePatternBindingsUnique);
    duplicatePatternsEvent.fire(event);
    // Are all Actions defined?
    boolean areActionInsertFieldsDefined = true;
    for (List<ActionInsertFactCol52> actions : patternToActionsMap.values()) {
        for (ActionInsertFactCol52 a : actions) {
            if (!getValidator().isActionValid(a)) {
                areActionInsertFieldsDefined = false;
                break;
            }
        }
    }
    // Signal Action Insert Fact Fields to other pages
    final ActionInsertFactFieldsDefinedEvent eventFactFields = new ActionInsertFactFieldsDefinedEvent(areActionInsertFieldsDefined);
    actionInsertFactFieldsDefinedEvent.fire(eventFactFields);
    callback.callback(arePatternBindingsUnique && areActionInsertFieldsDefined);
}
Also used : ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) ActionInsertFactFieldsDefinedEvent(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.events.ActionInsertFactFieldsDefinedEvent) DuplicatePatternsEvent(org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.events.DuplicatePatternsEvent)

Aggregations

ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)1 ActionInsertFactFieldsDefinedEvent (org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.events.ActionInsertFactFieldsDefinedEvent)1 DuplicatePatternsEvent (org.drools.workbench.screens.guided.dtable.client.wizard.table.pages.events.DuplicatePatternsEvent)1