use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation in project voltdb by VoltDB.
the class VoltDBOsmSink method process.
/**
* {@inheritDoc}
*/
public void process(RelationContainer relationContainer) {
Relation relation;
int memberSequenceId;
relation = relationContainer.getEntity();
try {
client.callProcedure(new InsertCallback(), INS_RELATIONS_PROC, relation.getId(), relation.getVersion(), relation.getUser().getId(), relation.getTimestamp(), relation.getChangesetId());
} catch (NoConnectionsException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
memberSequenceId = 0;
for (RelationMember member : relation.getMembers()) {
try {
client.callProcedure(new InsertCallback(), INS_RELATIONS_MEMBER_PROC, relation.getId(), member.getMemberId(), member.getMemberType().ordinal(), member.getMemberRole(), memberSequenceId);
} catch (NoConnectionsException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
memberSequenceId++;
}
for (Tag tag : relation.getTags()) {
try {
client.callProcedure(new InsertCallback(), INS_RELATION_TAGS_PROC, relation.getId(), tag.getKey(), tag.getValue());
} catch (NoConnectionsException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation 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 se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation 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;
}
use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation in project kie-wb-common by kiegroup.
the class RelationUIModelMapperTest method setup.
@Before
public void setup() {
this.uiModel = new BaseGridData();
this.uiModel.appendRow(new DMNGridRow());
this.uiModel.appendRow(new DMNGridRow());
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiRelationColumn1);
this.uiModel.appendColumn(uiRelationColumn2);
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiRelationColumn1).getIndex();
doReturn(2).when(uiRelationColumn2).getIndex();
this.relation = new Relation();
this.relation.getColumn().add(new InformationItem());
this.relation.getColumn().add(new InformationItem());
this.relation.getRow().add(new List() {
{
getExpression().add(new LiteralExpression() {
{
setText("le(1,0)");
}
});
getExpression().add(new LiteralExpression() {
{
setText("le(2,0)");
}
});
}
});
this.relation.getRow().add(new List() {
{
getExpression().add(new LiteralExpression() {
{
setText("le(1,1)");
}
});
getExpression().add(new LiteralExpression() {
{
setText("le(2,1)");
}
});
}
});
this.mapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector);
this.cellValueSupplier = Optional::empty;
}
use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation in project kie-wb-common by kiegroup.
the class AddRelationColumnCommandTest method setup.
@Before
public void setup() {
this.relation = new Relation();
this.informationItem = new InformationItem();
this.uiModel = new BaseGridData();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector);
makeCommand(1);
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiModelColumn).getIndex();
}
Aggregations