Skip to content

Commit ceb0603

Browse files
committed
Getting if matched correctly
1 parent 555c8bd commit ceb0603

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/SPInteractions.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@ private void matchPatient(
9797
if (interactionEnvelop.contentType() != BATCH_INTERACTION) {
9898
return;
9999
}
100+
100101
final var completableFuture = Ask.matchInteraction(system, backEnd, key, interactionEnvelop).toCompletableFuture();
101102
try {
102103
final var reply = completableFuture.get(65, TimeUnit.SECONDS);
103-
if (reply.linkInfo() == null) {
104+
if (!reply.matched()) {
104105
LOGGER.error("BACK END RESPONSE(ERROR)");
105106
}
106107
} catch (InterruptedException | ExecutionException | TimeoutException ex) {

JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/backend/BackEnd.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -238,17 +238,16 @@ private Behavior<Request> asyncMatchInteractionHandler(final AsyncMatchInteracti
238238
return Behaviors.same();
239239
});
240240
}
241-
// to-do: Consider if LinkInfo is nevessary
242241
final var linkInfo =
243242
LinkerDWH.matchInteraction(libMPI,
244243
req.batchInteraction.interaction(),
245244
null,
246245
AppConfig.LINKER_MATCH_THRESHOLD,
247246
req.batchInteraction.stan());
248-
if (linkInfo.isLeft()) {
249-
req.replyTo.tell(new AsyncMatchInteractionResponse(linkInfo.getLeft()));
247+
if (linkInfo.isRight()) {
248+
req.replyTo.tell(new AsyncMatchInteractionResponse(true));
250249
} else {
251-
req.replyTo.tell(new AsyncMatchInteractionResponse(null));
250+
req.replyTo.tell(new AsyncMatchInteractionResponse(false));
252251
}
253252
return Behaviors.withTimers(timers -> {
254253
timers.startSingleTimer(SINGLE_TIMER_TIMEOUT_KEY, TeaTimeRequest.INSTANCE, Duration.ofSeconds(10));
@@ -389,7 +388,7 @@ public record AsyncMatchInteractionRequest(
389388
InteractionEnvelop batchInteraction) implements Request {
390389
}
391390

392-
public record AsyncMatchInteractionResponse(LinkInfo linkInfo) implements Response {
391+
public record AsyncMatchInteractionResponse(Boolean matched) implements Response {
393392
}
394393

395394
public record RunStartStopHooksRequest(

0 commit comments

Comments
 (0)