use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools by kiegroup.
the class GuidedDecisionTableUpgradeHelper1 method makeNewColumn.
private ConditionCol52 makeNewColumn(ConditionCol c) {
ConditionCol52 nc = new ConditionCol52();
nc.setConstraintValueType(c.constraintValueType);
nc.setDefaultValue(new DTCellValue52(c.defaultValue));
nc.setFactField(c.factField);
nc.setFieldType(DataType.TYPE_STRING);
nc.setHeader(c.header);
nc.setHideColumn(c.hideColumn);
nc.setOperator(c.operator);
nc.setValueList(c.valueList);
nc.setWidth(c.width);
return nc;
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools by kiegroup.
the class GuidedDecisionTableUpgradeHelper1 method makeNewColumn.
private ActionSetFieldCol52 makeNewColumn(ActionSetFieldCol c) {
ActionSetFieldCol52 nc = new ActionSetFieldCol52();
nc.setBoundName(c.boundName);
nc.setDefaultValue(new DTCellValue52(c.defaultValue));
nc.setFactField(c.factField);
nc.setHeader(c.header);
nc.setHideColumn(c.hideColumn);
nc.setType(c.type);
nc.setUpdate(c.update);
nc.setValueList(c.valueList);
nc.setWidth(c.width);
return nc;
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools by kiegroup.
the class GuidedDecisionTableUpgradeHelper1 method makeNewColumn.
private ActionInsertFactCol52 makeNewColumn(ActionInsertFactCol c) {
ActionInsertFactCol52 nc = new ActionInsertFactCol52();
nc.setBoundName(c.boundName);
nc.setDefaultValue(new DTCellValue52(c.defaultValue));
nc.setFactField(c.factField);
nc.setFactType(c.factType);
nc.setHeader(c.header);
nc.setHideColumn(c.hideColumn);
nc.setType(c.type);
nc.setValueList(c.valueList);
nc.setWidth(c.width);
return nc;
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools by kiegroup.
the class GuidedDecisionTableUpgradeHelper1 method makeNewColumn.
private ActionCol52 makeNewColumn(ActionCol c) {
if (c instanceof ActionInsertFactCol) {
return makeNewColumn((ActionInsertFactCol) c);
} else if (c instanceof ActionRetractFactCol) {
return makeNewColumn((ActionRetractFactCol) c);
} else if (c instanceof ActionSetFieldCol) {
return makeNewColumn((ActionSetFieldCol) c);
}
ActionCol52 nc = new ActionCol52();
nc.setDefaultValue(new DTCellValue52(c.defaultValue));
nc.setHeader(c.header);
nc.setHideColumn(c.hideColumn);
nc.setWidth(c.width);
return nc;
}
use of org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52 in project drools by kiegroup.
the class GuidedDecisionTableUpgradeHelper3 method upgrade.
/**
* Convert the Default Values in the Decision Table model
*
* @param source
* @return The new DTModel
*/
public GuidedDecisionTable52 upgrade(GuidedDecisionTable52 source) {
final GuidedDecisionTable52 destination = source;
for (BaseColumn column : source.getExpandedColumns()) {
DTColumnConfig52 dtColumn = null;
if (column instanceof MetadataCol52) {
dtColumn = (DTColumnConfig52) column;
} else if (column instanceof AttributeCol52) {
dtColumn = (DTColumnConfig52) column;
} else if (column instanceof ConditionCol52) {
dtColumn = (DTColumnConfig52) column;
} else if (column instanceof ActionCol52) {
dtColumn = (DTColumnConfig52) column;
}
if (dtColumn instanceof LimitedEntryCol) {
dtColumn = null;
}
if (dtColumn instanceof BRLVariableColumn) {
dtColumn = null;
}
if (dtColumn != null) {
final String legacyDefaultValue = dtColumn.defaultValue;
if (legacyDefaultValue != null) {
dtColumn.setDefaultValue(new DTCellValue52(legacyDefaultValue));
dtColumn.defaultValue = null;
}
}
}
return destination;
}
Aggregations