use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPlugin method isNewFactPattern.
boolean isNewFactPattern() {
final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel());
final List<String> variables = brlRuleModel.getLHSPatternVariables();
return !variables.stream().anyMatch(b -> b.equals(patternWrapper().getBoundName()));
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPlugin method getPatterns.
@Override
public Set<PatternWrapper> getPatterns() {
final Set<PatternWrapper> patterns = new HashSet<>();
if (isNewColumn() || !isNewFactPattern()) {
final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel());
final List<String> variables = brlRuleModel.getLHSPatternVariables();
variables.forEach(var -> {
final String factType = brlRuleModel.getLHSBoundFact(var).getFactType();
final boolean isNegated = brlRuleModel.getLHSBoundFact(var).isNegated();
patterns.add(new PatternWrapper(factType, var, isNegated));
});
}
if (isNewColumn() || isNewFactPattern()) {
final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel());
final List<String> variables = brlRuleModel.getRHSBoundFacts();
variables.forEach(var -> {
final String factType = brlRuleModel.getRHSBoundFact(var).getFactType();
patterns.add(new PatternWrapper(factType, var));
});
}
return patterns;
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionSetFactPlugin method newPatternWrapper.
PatternWrapper newPatternWrapper(final ActionWrapper actionWrapper) {
final String boundName = actionWrapper.getBoundName();
final String factType = actionWrapper.getFactType();
final PatternWrapper defaultWrapper = new PatternWrapper(factType, boundName, false);
return getPatterns().stream().filter(wrapper -> wrapper.getBoundName().equals(boundName)).findFirst().orElse(defaultWrapper);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPlugin method newPatternWrapper.
PatternWrapper newPatternWrapper(final ActionWorkItemWrapper actionWrapper) {
final String boundName = actionWrapper.getBoundName();
final String factType = actionWrapper.getFactType();
final PatternWrapper defaultWrapper = new PatternWrapper(factType, boundName, false);
return getPatterns().stream().filter(wrapper -> wrapper.getBoundName().equals(boundName)).findFirst().orElse(defaultWrapper);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPlugin method getPatterns.
@Override
public Set<PatternWrapper> getPatterns() {
final Set<PatternWrapper> patterns = new HashSet<>();
final BRLRuleModel brlRuleModel = makeBRLRuleModel();
final List<String> variables = brlRuleModel.getLHSPatternVariables();
variables.forEach(var -> {
final Pattern52 pattern = getPresenter().getModel().getConditionPattern(var);
if (!(pattern instanceof FactPatternPattern52Adaptor)) {
final String factType = brlRuleModel.getLHSBoundFact(var).getFactType();
final boolean isNegated = brlRuleModel.getLHSBoundFact(var).isNegated();
patterns.add(new PatternWrapper(factType, var, isNegated));
}
});
return patterns;
}
Aggregations