Search in sources :

Example 16 with Relation

use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.

the class AddRelationRowCommandTest method setup.

@Before
public void setup() {
    this.relation = new Relation();
    this.row = new List();
    this.uiModelRow = new DMNGridRow();
    this.uiModel = new BaseGridData();
    this.uiModel.appendColumn(uiRowNumberColumn);
    this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector);
    makeCommand(0);
    doReturn(ruleManager).when(handler).getRuleManager();
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiModelColumn).getIndex();
}
Also used : RelationUIModelMapper(org.kie.workbench.common.dmn.client.editors.expressions.types.relation.RelationUIModelMapper) Relation(org.kie.workbench.common.dmn.api.definition.v1_1.Relation) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) List(org.kie.workbench.common.dmn.api.definition.v1_1.List) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Before(org.junit.Before)

Example 17 with Relation

use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.

the class DeleteRelationRowCommandTest method setup.

@Before
public void setup() {
    this.relation = new Relation();
    this.relation.getRow().add(new List());
    this.uiModel = new BaseGridData();
    this.uiModel.appendRow(new DMNGridRow());
    this.uiModel.appendColumn(uiRowNumberColumn);
    this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector);
    makeCommand(0);
    doReturn(ruleManager).when(handler).getRuleManager();
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiModelColumn).getIndex();
}
Also used : RelationUIModelMapper(org.kie.workbench.common.dmn.client.editors.expressions.types.relation.RelationUIModelMapper) Relation(org.kie.workbench.common.dmn.api.definition.v1_1.Relation) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) List(org.kie.workbench.common.dmn.api.definition.v1_1.List) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Before(org.junit.Before)

Example 18 with Relation

use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.

the class MoveColumnsCommandTest method setup.

@Before
public void setup() {
    this.relation = new Relation();
    this.uiModel = new DMNGridData();
    doReturn(ruleManager).when(handler).getRuleManager();
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiModelColumn1).getIndex();
    doReturn(2).when(uiModelColumn2).getIndex();
    addRelationColumn(II1);
    addRelationColumn(II2);
    addRelationRow(II1);
    addRelationRow(II2);
    addUiModelColumn(uiRowNumberColumn);
    addUiModelColumn(uiModelColumn1);
    addUiModelColumn(uiModelColumn2);
    addUiModelRow(0);
    addUiModelRow(1);
}
Also used : Relation(org.kie.workbench.common.dmn.api.definition.v1_1.Relation) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) Before(org.junit.Before)

Example 19 with Relation

use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.

the class MoveRowsCommandTest method setup.

@Before
public void setup() {
    this.relation = new Relation();
    this.uiModel = new DMNGridData();
    doReturn(ruleManager).when(handler).getRuleManager();
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiModelColumn1).getIndex();
    addRelationColumn(II1);
    addRelationColumn(II2);
    addRelationRow(II1);
    addRelationRow(II2);
    addUiModelColumn(uiRowNumberColumn);
    addUiModelColumn(uiModelColumn1);
    addUiModelRow(0);
    addUiModelRow(1);
}
Also used : Relation(org.kie.workbench.common.dmn.api.definition.v1_1.Relation) DMNGridData(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData) Before(org.junit.Before)

Example 20 with Relation

use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project webcert by sklintyg.

the class IntygRelationHelperImplTest method buildRelation.

private Relation buildRelation(String fromIntygId, String toIntygId) {
    Relation r = new Relation();
    IntygId from = new IntygId();
    from.setExtension(fromIntygId);
    IntygId to = new IntygId();
    to.setExtension(toIntygId);
    r.setFranIntygsId(from);
    r.setTillIntygsId(to);
    TypAvRelation typ = new TypAvRelation();
    typ.setCode(RelationKod.ERSATT.value());
    r.setTyp(typ);
    r.setSkapad(LocalDateTime.now());
    return r;
}
Also used : WebcertCertificateRelation(se.inera.intyg.webcert.common.model.WebcertCertificateRelation) TypAvRelation(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvRelation) Relation(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation) TypAvRelation(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvRelation) IntygId(se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)

Aggregations

InformationItem (org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)18 Test (org.junit.Test)12 Relation (org.kie.workbench.common.dmn.api.definition.v1_1.Relation)12 Before (org.junit.Before)7 List (org.kie.workbench.common.dmn.api.definition.v1_1.List)5 LiteralExpression (org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression)5 RelationUIModelMapper (org.kie.workbench.common.dmn.client.editors.expressions.types.relation.RelationUIModelMapper)4 BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)4 DMNGridData (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData)3 DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)3 Relation (se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation)3 WebcertCertificateRelation (se.inera.intyg.webcert.common.model.WebcertCertificateRelation)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 InformationItem (org.kie.dmn.model.v1_1.InformationItem)2 Relation (org.kie.dmn.model.v1_1.Relation)2 Expression (org.kie.workbench.common.dmn.api.definition.v1_1.Expression)2 Matchers.anyString (org.mockito.Matchers.anyString)2 BaseGridCellValue (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue)2