use of org.drools.workbench.models.guided.dtable.shared.model.BRLActionVariableColumn in project drools-wb by kiegroup.
the class SubHeaderBuilder method build.
public void build(final NotificationReporter notificationReporter) {
final List<BaseColumn> expandedColumns = dtable.getExpandedColumns();
for (; sourceColumnIndex < expandedColumns.size(); sourceColumnIndex++) {
final BaseColumn baseColumn = expandedColumns.get(sourceColumnIndex);
if (Skipper.shouldSkip(notificationReporter, baseColumn)) {
// Ignore and do not add to count
continue;
} else if (baseColumn instanceof AttributeCol52) {
addAttribute((AttributeCol52) baseColumn);
} else if (baseColumn instanceof MetadataCol52) {
addMetadata((MetadataCol52) baseColumn);
} else if (baseColumn instanceof BRLConditionVariableColumn) {
final BRLConditionColumn brlColumn = dtable.getBRLColumn((BRLConditionVariableColumn) baseColumn);
addBRLConditionColumn(brlColumn);
sourceColumnIndex = sourceColumnIndex + brlColumn.getChildColumns().size() - 1;
} else if (baseColumn instanceof BRLActionVariableColumn) {
final BRLActionColumn brlColumn = dtable.getBRLColumn((BRLActionVariableColumn) baseColumn);
addBRLActionColumn(brlColumn);
sourceColumnIndex = sourceColumnIndex + brlColumn.getChildColumns().size() - 1;
} else if (baseColumn instanceof ConditionCol52) {
addCondition((ConditionCol52) baseColumn);
} else if (baseColumn instanceof ActionCol52) {
addAction((ActionCol52) baseColumn);
} else if (baseColumn instanceof DescriptionCol52) {
// This is actually a column, but header is not written down in XLS
} else {
throw new IllegalArgumentException("TODO REMOTE THIS");
}
incrementTargetIndex();
}
}
use of org.drools.workbench.models.guided.dtable.shared.model.BRLActionVariableColumn in project drools-wb by kiegroup.
the class BRLActionColumnPluginChildColumnUpdateTest method getBrlActionColumnWithTemplateValues.
private BRLActionColumn getBrlActionColumnWithTemplateValues() {
final BRLActionColumn brlActionColumn = new BRLActionColumn();
final ActionInsertFact actionInsertFact = new ActionInsertFact("Person");
actionInsertFact.setBoundName("$a");
final ActionFieldValue afv1 = new ActionFieldValue("name", "$default", DataType.TYPE_STRING);
afv1.setNature(FieldNatureType.TYPE_TEMPLATE);
actionInsertFact.addFieldValue(afv1);
final ActionFieldValue afv2 = new ActionFieldValue("age", "$default1", DataType.TYPE_STRING);
afv2.setNature(FieldNatureType.TYPE_TEMPLATE);
actionInsertFact.addFieldValue(afv2);
brlActionColumn.getDefinition().add(actionInsertFact);
brlActionColumn.getChildColumns().add(new BRLActionVariableColumn("$default", BRLActionVariableColumn.FIELD_VAR_NAME));
brlActionColumn.getChildColumns().add(new BRLActionVariableColumn("$default1", BRLActionVariableColumn.FIELD_VAR_NAME));
return brlActionColumn;
}
Aggregations