|
38 | 38 | */ |
39 | 39 | public interface ActivityCompletionClient { |
40 | 40 |
|
| 41 | + /** |
| 42 | + * Completes the activity execution successfully. |
| 43 | + * |
| 44 | + * @param taskToken token of the activity attempt to complete |
| 45 | + * @param result of the activity execution |
| 46 | + */ |
41 | 47 | <R> void complete(byte[] taskToken, R result) throws ActivityCompletionException; |
42 | 48 |
|
| 49 | + /** |
| 50 | + * Completes the activity execution successfully. |
| 51 | + * |
| 52 | + * @param workflowId id of the workflow that started the activity |
| 53 | + * @param runId optional run id of the workflow that started the activity |
| 54 | + * @param activityId id of the activity |
| 55 | + * @param result of the activity execution |
| 56 | + */ |
43 | 57 | <R> void complete(String workflowId, Optional<String> runId, String activityId, R result) |
44 | 58 | throws ActivityCompletionException; |
45 | 59 |
|
| 60 | + /** |
| 61 | + * Completes the activity execution with failure. |
| 62 | + * |
| 63 | + * @param taskToken token of the activity attempt to complete |
| 64 | + * @param result the exception to be used as a failure details object |
| 65 | + */ |
46 | 66 | void completeExceptionally(byte[] taskToken, Exception result) throws ActivityCompletionException; |
47 | 67 |
|
| 68 | + /** |
| 69 | + * Completes the activity execution with failure. |
| 70 | + * |
| 71 | + * @param workflowId id of the workflow that started the activity |
| 72 | + * @param runId optional run id of the workflow that started the activity |
| 73 | + * @param activityId id of the activity |
| 74 | + * @param result the exception to be used as a failure details object |
| 75 | + */ |
48 | 76 | void completeExceptionally( |
49 | 77 | String workflowId, Optional<String> runId, String activityId, Exception result) |
50 | 78 | throws ActivityCompletionException; |
51 | 79 |
|
| 80 | + /** |
| 81 | + * Confirms successful cancellation to the server. |
| 82 | + * |
| 83 | + * @param taskToken token of the activity attempt |
| 84 | + * @param details details to record with the cancellation |
| 85 | + */ |
52 | 86 | <V> void reportCancellation(byte[] taskToken, V details) throws ActivityCompletionException; |
53 | 87 |
|
| 88 | + /** |
| 89 | + * Confirms successful cancellation to the server. |
| 90 | + * |
| 91 | + * @param workflowId id of the workflow that started the activity |
| 92 | + * @param runId optional run id of the workflow that started the activity |
| 93 | + * @param activityId id of the activity |
| 94 | + * @param details details to record with the cancellation |
| 95 | + */ |
54 | 96 | <V> void reportCancellation( |
55 | 97 | String workflowId, Optional<String> runId, String activityId, V details) |
56 | 98 | throws ActivityCompletionException; |
57 | 99 |
|
| 100 | + /** |
| 101 | + * Records a heartbeat for an activity. |
| 102 | + * |
| 103 | + * @param taskToken token of the activity attempt |
| 104 | + * @param details details to record with the heartbeat |
| 105 | + * @throws ActivityCompletionException if activity should stop executing |
| 106 | + */ |
58 | 107 | <V> void heartbeat(byte[] taskToken, V details) throws ActivityCompletionException; |
59 | 108 |
|
60 | 109 | /** |
| 110 | + * Records a heartbeat for an activity. |
| 111 | + * |
| 112 | + * @param workflowId id of the workflow that started the activity |
| 113 | + * @param runId optional run id of the workflow that started the activity |
| 114 | + * @param activityId id of the activity |
| 115 | + * @param details details to record with the heartbeat |
61 | 116 | * @throws ActivityCompletionException if activity should stop executing |
62 | 117 | */ |
63 | 118 | <V> void heartbeat(String workflowId, Optional<String> runId, String activityId, V details) |
|
0 commit comments