-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For C8, also close the job on unsubscribe for a task. (+ Added C8 Use…
…r Task tests)
- Loading branch information
1 parent
6f1e4cf
commit aaaad8c
Showing
15 changed files
with
256 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...in/kotlin/dev/bpmcrafters/processengineapi/adapter/c8/task/SubscribingUserTaskDelivery.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package dev.bpmcrafters.processengineapi.adapter.c8.task | ||
|
||
import dev.bpmcrafters.processengineapi.task.TaskSubscription | ||
|
||
/** | ||
* Common interface for user task delivery. | ||
*/ | ||
interface SubscribingUserTaskDelivery { | ||
fun unsubscribe(taskSubscription: TaskSubscription) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
...ev/bpmcrafters/processengineapi/adapter/c8/task/subscription/C8TaskSubscriptionApiImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
package dev.bpmcrafters.processengineapi.adapter.c8.task.subscription | ||
|
||
import dev.bpmcrafters.processengineapi.Empty | ||
import dev.bpmcrafters.processengineapi.MetaInfo | ||
import dev.bpmcrafters.processengineapi.MetaInfoAware | ||
import dev.bpmcrafters.processengineapi.adapter.c8.task.SubscribingUserTaskDelivery | ||
import dev.bpmcrafters.processengineapi.adapter.commons.task.AbstractTaskSubscriptionApiImpl | ||
import dev.bpmcrafters.processengineapi.adapter.commons.task.SubscriptionRepository | ||
import dev.bpmcrafters.processengineapi.task.UnsubscribeFromTaskCmd | ||
import java.util.concurrent.CompletableFuture | ||
import java.util.concurrent.Future | ||
|
||
class C8TaskSubscriptionApiImpl( | ||
subscriptionRepository: SubscriptionRepository | ||
subscriptionRepository: SubscriptionRepository, | ||
private val subscribingUserTaskDelivery: SubscribingUserTaskDelivery? | ||
) : AbstractTaskSubscriptionApiImpl( | ||
subscriptionRepository = subscriptionRepository | ||
) { | ||
|
||
override fun meta(instance: MetaInfoAware): MetaInfo { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override fun unsubscribe(cmd: UnsubscribeFromTaskCmd): Future<Empty> { | ||
super.unsubscribe(cmd) | ||
// For subscribing delivery, we also have to close the job | ||
subscribingUserTaskDelivery?.unsubscribe(cmd.subscription) | ||
return CompletableFuture.completedFuture(Empty) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.