Skip to content

Commit 106ee0c

Browse files
committed
fixed build
1 parent 19cfcb1 commit 106ee0c

File tree

3 files changed

+37
-34
lines changed

3 files changed

+37
-34
lines changed

client/src/main/java/com/microsoft/durabletask/TaskOrchestrationContext.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ default void signalEntity(@Nonnull EntityInstanceId entityId, @Nonnull String op
660660
*
661661
* @param entityId the unique identifier of the target entity
662662
* @param operationName the name of the operation to invoke on the entity
663+
* @return a {@link Task} that completes when the entity operation completes
663664
*/
664665
default Task<Void> callEntity(@Nonnull EntityInstanceId entityId, @Nonnull String operationName) {
665666
return this.callEntity(entityId, operationName, null, Void.class);
@@ -671,6 +672,7 @@ default Task<Void> callEntity(@Nonnull EntityInstanceId entityId, @Nonnull Strin
671672
* @param entityId the unique identifier of the target entity
672673
* @param operationName the name of the operation to invoke on the entity
673674
* @param input the serializable input to pass to the entity operation, or {@code null}
675+
* @return a {@link Task} that completes when the entity operation completes
674676
*/
675677
default Task<Void> callEntity(@Nonnull EntityInstanceId entityId, @Nonnull String operationName, @Nullable Object input) {
676678
return this.callEntity(entityId, operationName, input, Void.class);

client/src/main/java/com/microsoft/durabletask/TaskOrchestrationEntityFeature.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public abstract <TResult> Task<TResult> callEntity(
3737
* @param input the operation input, or {@code null}
3838
* @param returnType the expected return type
3939
* @param options the call options, or {@code null}
40+
* @param returnType the expected class type of the entity operation output
4041
* @param <TResult> the result type
4142
* @return a task that completes with the operation result
4243
*/

client/src/test/java/com/microsoft/durabletask/TaskOrchestrationEntityEventTest.java

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void signalEntity_producesSendEntityMessageAction() {
253253
executionStarted(orchestratorName, "null"));
254254
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
255255

256-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
256+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
257257

258258
// Should have two actions: sendEntityMessage (signal) and completeOrchestration
259259
Collection<OrchestratorAction> actions = result.getActions();
@@ -291,7 +291,7 @@ void getEntities_signalEntity_producesSendEntityMessageAction() {
291291
executionStarted(orchestratorName, "null"));
292292
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
293293

294-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
294+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
295295

296296
boolean hasSignal = false;
297297
for (OrchestratorAction action : result.getActions()) {
@@ -329,7 +329,7 @@ void signalEntity_replayPassesNonDeterminismCheck() {
329329
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
330330

331331
// This should NOT throw a NonDeterministicOrchestratorException
332-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
332+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
333333

334334
// Should still have the complete action
335335
boolean hasComplete = false;
@@ -361,7 +361,7 @@ void callEntity_producesActionAndWaitsForResponse() {
361361
executionStarted(orchestratorName, "null"));
362362
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
363363

364-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
364+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
365365

366366
// Should have the sendEntityMessage (call) action
367367
boolean hasCall = false;
@@ -402,7 +402,7 @@ void entities_callEntity_producesActionAndWaitsForResponse() {
402402
executionStarted(orchestratorName, "null"));
403403
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
404404

405-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
405+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
406406

407407
boolean hasCall = false;
408408
boolean hasComplete = false;
@@ -445,7 +445,7 @@ void callEntity_completesWhenResponseArrives() {
445445
executionStarted(orchestratorName, "null"));
446446
List<HistoryEvent> newEvents1 = Collections.singletonList(orchestratorCompleted());
447447

448-
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1);
448+
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1, null);
449449

450450
// Extract the requestId from the call action
451451
String requestId = null;
@@ -472,7 +472,7 @@ void callEntity_completesWhenResponseArrives() {
472472
entityOperationCompletedEvent(requestId, "42"),
473473
orchestratorCompleted());
474474

475-
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2);
475+
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2, null);
476476

477477
// Should now have a complete action with value 42
478478
boolean hasComplete = false;
@@ -507,7 +507,7 @@ void callEntity_failedResponse_completesExceptionally() {
507507
executionStarted(orchestratorName, "null"));
508508
List<HistoryEvent> newEvents1 = Collections.singletonList(orchestratorCompleted());
509509

510-
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1);
510+
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1, null);
511511

512512
String requestId = null;
513513
for (OrchestratorAction action : result1.getActions()) {
@@ -537,7 +537,7 @@ void callEntity_failedResponse_completesExceptionally() {
537537
entityOperationFailedEvent(requestId, "java.lang.RuntimeException", "Entity error!"),
538538
orchestratorCompleted());
539539

540-
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2);
540+
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2, null);
541541

542542
boolean hasComplete = false;
543543
for (OrchestratorAction action : result2.getActions()) {
@@ -579,7 +579,7 @@ void callEntity_completesViaEventRaised_triggerBindingPath() {
579579
executionStarted(orchestratorName, "null"));
580580
List<HistoryEvent> newEvents1 = Collections.singletonList(orchestratorCompleted());
581581

582-
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1);
582+
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1, null);
583583

584584
String requestId = null;
585585
for (OrchestratorAction action : result1.getActions()) {
@@ -607,7 +607,7 @@ void callEntity_completesViaEventRaised_triggerBindingPath() {
607607
eventRaisedEvent(requestId, responseJson), // ResponseMessage JSON wrapper
608608
orchestratorCompleted());
609609

610-
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2);
610+
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2, null);
611611

612612
boolean hasComplete = false;
613613
for (OrchestratorAction action : result2.getActions()) {
@@ -636,7 +636,7 @@ void callEntity_stringResultViaEventRaised_triggerBindingPath() {
636636
orchestratorStarted(),
637637
executionStarted(orchestratorName, "null"));
638638
List<HistoryEvent> newEvents1 = Collections.singletonList(orchestratorCompleted());
639-
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1);
639+
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1, null);
640640

641641
String requestId = null;
642642
for (OrchestratorAction action : result1.getActions()) {
@@ -664,7 +664,7 @@ void callEntity_stringResultViaEventRaised_triggerBindingPath() {
664664
eventRaisedEvent(requestId, responseJson),
665665
orchestratorCompleted());
666666

667-
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2);
667+
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2, null);
668668

669669
boolean hasComplete = false;
670670
for (OrchestratorAction action : result2.getActions()) {
@@ -694,7 +694,7 @@ void callEntity_nullResultViaEventRaised_triggerBindingPath() {
694694
orchestratorStarted(),
695695
executionStarted(orchestratorName, "null"));
696696
List<HistoryEvent> newEvents1 = Collections.singletonList(orchestratorCompleted());
697-
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1);
697+
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1, null);
698698

699699
String requestId = null;
700700
for (OrchestratorAction action : result1.getActions()) {
@@ -721,7 +721,7 @@ void callEntity_nullResultViaEventRaised_triggerBindingPath() {
721721
eventRaisedEvent(requestId, responseJson),
722722
orchestratorCompleted());
723723

724-
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2);
724+
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2, null);
725725

726726
boolean hasComplete = false;
727727
for (OrchestratorAction action : result2.getActions()) {
@@ -754,7 +754,7 @@ void callEntity_failedViaEventRaised_withFailureDetails_triggerBindingPath() {
754754
orchestratorStarted(),
755755
executionStarted(orchestratorName, "null"));
756756
List<HistoryEvent> newEvents1 = Collections.singletonList(orchestratorCompleted());
757-
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1);
757+
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1, null);
758758

759759
String requestId = null;
760760
for (OrchestratorAction action : result1.getActions()) {
@@ -785,7 +785,7 @@ void callEntity_failedViaEventRaised_withFailureDetails_triggerBindingPath() {
785785
eventRaisedEvent(requestId, responseJson),
786786
orchestratorCompleted());
787787

788-
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2);
788+
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2, null);
789789

790790
boolean hasComplete = false;
791791
for (OrchestratorAction action : result2.getActions()) {
@@ -819,7 +819,7 @@ void callEntity_failedViaEventRaised_simpleError_triggerBindingPath() {
819819
orchestratorStarted(),
820820
executionStarted(orchestratorName, "null"));
821821
List<HistoryEvent> newEvents1 = Collections.singletonList(orchestratorCompleted());
822-
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1);
822+
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1, null);
823823

824824
String requestId = null;
825825
for (OrchestratorAction action : result1.getActions()) {
@@ -850,7 +850,7 @@ void callEntity_failedViaEventRaised_simpleError_triggerBindingPath() {
850850
eventRaisedEvent(requestId, responseJson),
851851
orchestratorCompleted());
852852

853-
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2);
853+
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2, null);
854854

855855
boolean hasComplete = false;
856856
for (OrchestratorAction action : result2.getActions()) {
@@ -887,7 +887,7 @@ void eventSent_doesNotCrash() {
887887
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
888888

889889
// This should NOT throw (EVENTSENT is a no-op)
890-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
890+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
891891

892892
boolean hasComplete = false;
893893
for (OrchestratorAction action : result.getActions()) {
@@ -922,7 +922,7 @@ void entityOperationSignaled_nonDeterminism_throwsException() {
922922
// The orchestrator already completed, so when the non-determinism is detected,
923923
// context.fail() throws IllegalStateException ("already completed")
924924
assertThrows(IllegalStateException.class, () ->
925-
executor.execute(pastEvents, newEvents));
925+
executor.execute(pastEvents, newEvents, null));
926926
}
927927

928928
@Test
@@ -943,7 +943,7 @@ void entityOperationCalled_nonDeterminism_throwsException() {
943943
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
944944

945945
assertThrows(IllegalStateException.class, () ->
946-
executor.execute(pastEvents, newEvents));
946+
executor.execute(pastEvents, newEvents, null));
947947
}
948948

949949
@Test
@@ -964,7 +964,7 @@ void entityLockRequested_nonDeterminism_throwsException() {
964964
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
965965

966966
assertThrows(IllegalStateException.class, () ->
967-
executor.execute(pastEvents, newEvents));
967+
executor.execute(pastEvents, newEvents, null));
968968
}
969969

970970
@Test
@@ -985,7 +985,7 @@ void entityUnlockSent_nonDeterminism_throwsException() {
985985
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
986986

987987
assertThrows(IllegalStateException.class, () ->
988-
executor.execute(pastEvents, newEvents));
988+
executor.execute(pastEvents, newEvents, null));
989989
}
990990

991991
// endregion
@@ -1009,7 +1009,7 @@ void signalEntity_withScheduledTime_setsScheduledTimeOnAction() {
10091009
executionStarted(orchestratorName, "null"));
10101010
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
10111011

1012-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
1012+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
10131013

10141014
boolean hasScheduledSignal = false;
10151015
for (OrchestratorAction action : result.getActions()) {
@@ -1041,7 +1041,7 @@ void signalEntity_withNullOptions_noScheduledTime() {
10411041
executionStarted(orchestratorName, "null"));
10421042
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
10431043

1044-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
1044+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
10451045

10461046
for (OrchestratorAction action : result.getActions()) {
10471047
if (action.hasSendEntityMessage() && action.getSendEntityMessage().hasEntityOperationSignaled()) {
@@ -1067,7 +1067,7 @@ void callEntity_withOptions_producesAction() {
10671067
executionStarted(orchestratorName, "null"));
10681068
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
10691069

1070-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
1070+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
10711071

10721072
boolean hasCall = false;
10731073
for (OrchestratorAction action : result.getActions()) {
@@ -1097,7 +1097,7 @@ void callEntity_withTimeout_producesCallAndTimerActions() {
10971097
executionStarted(orchestratorName, "null"));
10981098
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
10991099

1100-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
1100+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
11011101

11021102
boolean hasCall = false;
11031103
boolean hasTimer = false;
@@ -1129,7 +1129,7 @@ void callEntity_withoutTimeout_producesNoTimerAction() {
11291129
executionStarted(orchestratorName, "null"));
11301130
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
11311131

1132-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
1132+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
11331133

11341134
boolean hasCall = false;
11351135
boolean hasTimer = false;
@@ -1165,7 +1165,7 @@ void callEntity_withZeroTimeout_cancelledImmediately() {
11651165
executionStarted(orchestratorName, "null"));
11661166
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
11671167

1168-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
1168+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
11691169

11701170
boolean hasComplete = false;
11711171
for (OrchestratorAction action : result.getActions()) {
@@ -1199,7 +1199,7 @@ void getLockedEntities_insideCriticalSection_returnsLockedIds() {
11991199
executionStarted(orchestratorName, "null"));
12001200
List<HistoryEvent> newEvents1 = Collections.singletonList(orchestratorCompleted());
12011201

1202-
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1);
1202+
TaskOrchestratorResult result1 = executor.execute(pastEvents1, newEvents1, null);
12031203

12041204
// Extract the criticalSectionId from the lock request action
12051205
String criticalSectionId = null;
@@ -1222,7 +1222,7 @@ void getLockedEntities_insideCriticalSection_returnsLockedIds() {
12221222
entityLockGrantedEvent(criticalSectionId),
12231223
orchestratorCompleted());
12241224

1225-
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2);
1225+
TaskOrchestratorResult result2 = executor.execute(pastEvents2, newEvents2, null);
12261226

12271227
boolean hasComplete = false;
12281228
for (OrchestratorAction action : result2.getActions()) {
@@ -1248,7 +1248,7 @@ void getLockedEntities_outsideCriticalSection_returnsEmpty() {
12481248
executionStarted(orchestratorName, "null"));
12491249
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
12501250

1251-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
1251+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
12521252

12531253
boolean hasComplete = false;
12541254
for (OrchestratorAction action : result.getActions()) {
@@ -1276,7 +1276,7 @@ void lockEntities_varargs_producesLockAction() {
12761276
executionStarted(orchestratorName, "null"));
12771277
List<HistoryEvent> newEvents = Collections.singletonList(orchestratorCompleted());
12781278

1279-
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents);
1279+
TaskOrchestratorResult result = executor.execute(pastEvents, newEvents, null);
12801280

12811281
boolean hasLockRequest = false;
12821282
for (OrchestratorAction action : result.getActions()) {

0 commit comments

Comments
 (0)