use of org.kie.dmn.model.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class InformationItemPropertyConverter method wbFromDMN.
public static InformationItem wbFromDMN(final org.kie.dmn.model.v1_1.InformationItem dmn) {
if (dmn == null) {
return null;
}
Id id = new Id(dmn.getId());
Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
Name name = new Name(dmn.getName());
QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
InformationItem result = new InformationItem(id, description, name, typeRef);
return result;
}
use of org.kie.dmn.model.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class InputDataConverter method nodeFromDMN.
@Override
public Node<View<InputData>, ?> nodeFromDMN(final org.kie.dmn.model.v1_1.InputData dmn) {
@SuppressWarnings("unchecked") Node<View<InputData>, ?> node = (Node<View<InputData>, ?>) factoryManager.newElement(dmn.getId(), InputData.class).asNode();
Id id = new Id(dmn.getId());
Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
Name name = new Name(dmn.getName());
InformationItem informationItem = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable());
InputData inputData = new InputData(id, description, name, informationItem, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet());
node.getContent().setDefinition(inputData);
return node;
}
use of org.kie.dmn.model.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class PMMLFunctionEditorDefinition method getModelClass.
@Override
public Optional<Context> getModelClass() {
final Context context = new Context();
final ContextEntry documentEntry = new ContextEntry();
final InformationItem documentEntryVariable = new InformationItem();
documentEntryVariable.setName(new Name(VARIABLE_DOCUMENT));
documentEntry.setVariable(documentEntryVariable);
documentEntry.setExpression(new LiteralExpression());
context.getContextEntry().add(documentEntry);
final ContextEntry modelEntry = new ContextEntry();
final InformationItem modelEntryVariable = new InformationItem();
modelEntryVariable.setName(new Name(VARIABLE_MODEL));
modelEntry.setVariable(modelEntryVariable);
modelEntry.setExpression(new LiteralExpression());
context.getContextEntry().add(modelEntry);
return Optional.of(context);
}
use of org.kie.dmn.model.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class RelationEditorDefinition method getModelClass.
@Override
public Optional<Relation> getModelClass() {
final Relation relation = new Relation();
final InformationItem column = new InformationItem();
final org.kie.workbench.common.dmn.api.definition.v1_1.List row = new org.kie.workbench.common.dmn.api.definition.v1_1.List();
row.getExpression().add(new LiteralExpression());
relation.getColumn().add(column);
relation.getRow().add(row);
return Optional.of(relation);
}
use of org.kie.dmn.model.v1_1.InformationItem in project kie-wb-common by kiegroup.
the class RelationPropertyConverter method dmnFromWB.
public static org.kie.dmn.model.v1_1.Relation dmnFromWB(final Relation wb) {
org.kie.dmn.model.v1_1.Relation result = new org.kie.dmn.model.v1_1.Relation();
result.setId(wb.getId().getValue());
result.setDescription(wb.getDescription().getValue());
QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef);
for (InformationItem iitem : wb.getColumn()) {
org.kie.dmn.model.v1_1.InformationItem iitemConverted = InformationItemPropertyConverter.dmnFromWB(iitem);
result.getColumn().add(iitemConverted);
}
for (org.kie.workbench.common.dmn.api.definition.v1_1.List list : wb.getRow()) {
org.kie.dmn.model.v1_1.List listConverted = ListPropertyConverter.dmnFromWB(list);
result.getRow().add(listConverted);
}
return result;
}
Aggregations