use of org.kie.dmn.model.v1_1.Relation in project kie-wb-common by kiegroup.
the class RelationPropertyConverter method wbFromDMN.
public static Relation wbFromDMN(final org.kie.dmn.model.v1_1.Relation dmn) {
Id id = new Id(dmn.getId());
Description description = new Description(dmn.getDescription());
QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
List<org.kie.dmn.model.v1_1.InformationItem> column = dmn.getColumn();
List<org.kie.dmn.model.v1_1.List> row = dmn.getRow();
List<InformationItem> convertedColumn = column.stream().map(InformationItemPropertyConverter::wbFromDMN).collect(Collectors.toList());
List<org.kie.workbench.common.dmn.api.definition.v1_1.List> convertedRow = row.stream().map(ListPropertyConverter::wbFromDMN).collect(Collectors.toList());
Relation result = new Relation(id, description, typeRef, convertedColumn, convertedRow);
return result;
}
use of org.kie.dmn.model.v1_1.Relation in project webcert by sklintyg.
the class IntygRelationHelperImpl method decorateIntygListWithRelations.
@Override
public void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList) {
ListRelationsForCertificateResponseType response = getRelationsFromIntygstjanst(fullIntygItemList.stream().map(ListIntygEntry::getIntygId).collect(Collectors.toList()));
if (response != null) {
// Very ugly, iterate over both lists, find matches and create relation(s) on the ListIntygEntries.
for (IntygRelations ir : response.getIntygRelation()) {
for (ListIntygEntry lie : fullIntygItemList) {
if (lie.getIntygId().equals(ir.getIntygsId().getExtension())) {
// Create a Relations instance to hold relations.
lie.setRelations(new Relations());
// Iterate over all relations for this particular intyg
for (Relation r : ir.getRelation()) {
applyRelation(lie.getIntygId(), lie.getRelations(), r);
}
}
}
}
}
// account.
for (ListIntygEntry lie : fullIntygItemList) {
Relations relations = certificateRelationService.getRelations(lie.getIntygId());
mergeRelations(lie.getRelations(), relations);
}
}
use of org.kie.dmn.model.v1_1.Relation in project webcert by sklintyg.
the class IntygRelationHelperImpl method getRelationsForIntyg.
@Override
public Relations getRelationsForIntyg(String intygId) {
Relations certificateRelations = new Relations();
ListRelationsForCertificateResponseType response = getRelationsFromIntygstjanst(intygId);
// Iterate over all relations fetched from IT, split them up into parent and child relation(s)
response.getIntygRelation().stream().flatMap(ir -> ir.getRelation().stream()).forEach(r -> applyRelation(intygId, certificateRelations, r));
// Enrich with any relations present only in Webcert (e.g. for utkast etc.)
Relations webcertRelations = certificateRelationService.getRelations(intygId);
mergeRelations(certificateRelations, webcertRelations);
return certificateRelations;
}
use of org.kie.dmn.model.v1_1.Relation in project drools by kiegroup.
the class RelationConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
Relation r = (Relation) parent;
for (InformationItem c : r.getColumn()) {
writeChildrenNode(writer, context, c, COLUMN);
}
for (org.kie.dmn.model.api.List row : r.getRow()) {
writeChildrenNode(writer, context, row, ROW);
}
}
Aggregations