use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class LimitedEntryDropDownManager method getCurrentValueMap.
@Override
public Map<String, String> getCurrentValueMap(Context context) {
Map<String, String> currentValueMap = new HashMap<String, String>();
final Pattern52 basePattern = context.getBasePattern();
final BaseColumn baseColumn = context.getBaseColumn();
// Get values for all Constraints or Actions on the same pattern as the baseColumn
if (baseColumn instanceof ConditionCol52 && basePattern != null) {
for (ConditionCol52 cc : basePattern.getChildColumns()) {
if (cc instanceof LimitedEntryCol) {
currentValueMap.put(cc.getFactField(), getValue((LimitedEntryCol) cc));
}
}
} else if (baseColumn instanceof ActionSetFieldCol52) {
ActionSetFieldCol52 baseActionColumn = (ActionSetFieldCol52) baseColumn;
final String binding = baseActionColumn.getBoundName();
for (ActionCol52 ac : this.model.getActionCols()) {
if (ac instanceof ActionSetFieldCol52) {
final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac;
if (asf.getBoundName().equals(binding)) {
if (asf instanceof LimitedEntryCol) {
currentValueMap.put(asf.getFactField(), getValue((LimitedEntryCol) asf));
}
}
}
}
} else if (baseColumn instanceof ActionInsertFactCol52) {
ActionInsertFactCol52 baseActionColumn = (ActionInsertFactCol52) baseColumn;
final String binding = baseActionColumn.getBoundName();
for (ActionCol52 ac : this.model.getActionCols()) {
if (ac instanceof ActionInsertFactCol52) {
final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac;
if (aif.getBoundName().equals(binding)) {
if (aif instanceof LimitedEntryCol) {
currentValueMap.put(aif.getFactField(), getValue((LimitedEntryCol) aif));
}
}
}
}
}
return currentValueMap;
}
use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class DefaultValueDropDownManager method getCurrentValueMap.
@Override
public Map<String, String> getCurrentValueMap(Context context) {
Map<String, String> currentValueMap = new HashMap<String, String>();
final Pattern52 basePattern = context.getBasePattern();
final BaseColumn baseColumn = context.getBaseColumn();
// Get values for all Constraints or Actions on the same pattern as the baseColumn
if (baseColumn instanceof ConditionCol52) {
for (ConditionCol52 cc : basePattern.getChildColumns()) {
currentValueMap.put(cc.getFactField(), getValue(cc));
}
} else if (baseColumn instanceof ActionSetFieldCol52) {
ActionSetFieldCol52 baseActionColumn = (ActionSetFieldCol52) baseColumn;
final String binding = baseActionColumn.getBoundName();
for (ActionCol52 ac : this.model.getActionCols()) {
if (ac instanceof ActionSetFieldCol52) {
final ActionSetFieldCol52 asf = (ActionSetFieldCol52) ac;
if (asf.getBoundName().equals(binding)) {
currentValueMap.put(asf.getFactField(), getValue(asf));
}
}
}
} else if (baseColumn instanceof ActionInsertFactCol52) {
ActionInsertFactCol52 baseActionColumn = (ActionInsertFactCol52) baseColumn;
final String binding = baseActionColumn.getBoundName();
for (ActionCol52 ac : this.model.getActionCols()) {
if (ac instanceof ActionInsertFactCol52) {
final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac;
if (aif.getBoundName().equals(binding)) {
currentValueMap.put(aif.getFactField(), getValue(aif));
}
}
}
}
return currentValueMap;
}
use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class ValueOptionsPage method newCEPWindowOperatorsDropdown.
private CEPWindowOperatorsDropdown newCEPWindowOperatorsDropdown() {
final Pattern52 editingPattern = editingPattern();
return new CEPWindowOperatorsDropdown(editingPattern, false) {
{
addValueChangeHandler(event -> {
final CEPWindow cepWindow = editingPattern.getWindow();
final String operator = event.getValue().getValue();
cepWindow.setOperator(operator);
});
}
};
}
use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class ColumnManagementView method renderColumns.
public void renderColumns(final Map<String, List<BaseColumn>> columnGroups) {
clear();
for (String groupLabel : columnGroups.keySet()) {
final VerticalPanel columnGroup = new VerticalPanel();
final HorizontalPanel columnGroupHeader = new HorizontalPanel();
final VerticalPanel columnGroupColumns = new VerticalPanel();
columnGroupHeader.add(new Label(groupLabel));
columnGroup.add(columnGroupHeader);
columnGroup.add(columnGroupColumns);
add(columnGroup);
for (final BaseColumn column : columnGroups.get(groupLabel)) {
if (column instanceof ActionCol52) {
columnGroupColumns.add(renderColumn((ActionCol52) column));
} else if (column instanceof BRLConditionColumn) {
columnGroupColumns.add(renderColumn((BRLConditionColumn) column));
} else if (column instanceof Pattern52) {
renderColumn((Pattern52) column).forEach(columnGroupColumns::add);
}
}
}
}
use of org.drools.workbench.models.guided.dtable.shared.model.Pattern52 in project drools-wb by kiegroup.
the class ConditionColumnConverter method getPatternHeader.
private String getPatternHeader(final BaseColumn column) {
final Pattern52 pattern = model.getPattern((ConditionCol52) column);
final StringBuilder sb = new StringBuilder();
if (pattern.isNegated()) {
sb.append("not ");
} else if (!(pattern.getBoundName() == null || pattern.getBoundName().isEmpty())) {
sb.append(pattern.getBoundName()).append(" : ");
}
sb.append(pattern.getFactType());
return sb.toString();
}
Aggregations