-
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.
- Loading branch information
Showing
53 changed files
with
1,183 additions
and
245 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
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
35 changes: 35 additions & 0 deletions
35
...main/kotlin/dev/bpmcrafters/processengineapi/adapter/commons/task/CompositeTaskHandler.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,35 @@ | ||
package dev.bpmcrafters.processengineapi.adapter.commons.task | ||
|
||
import dev.bpmcrafters.processengineapi.task.TaskHandler | ||
import dev.bpmcrafters.processengineapi.task.TaskInformation | ||
|
||
/** | ||
* Composite task handler. | ||
* @since 0.1.2 | ||
* @param handlers handlers to include. | ||
*/ | ||
class CompositeTaskHandler( | ||
private val handlers: MutableList<TaskHandler> = mutableListOf(), | ||
) : TaskHandler { | ||
/** | ||
* Adds handler. | ||
* @param handler handler to add. | ||
*/ | ||
fun addHandler(handler: TaskHandler) { | ||
handlers.add(handler) | ||
} | ||
|
||
/** | ||
* Creates a new composite task handler out of current adding the given task handler. | ||
* @param handler handler to add. | ||
* @return composite handler. | ||
*/ | ||
fun withHandler(handler: TaskHandler): CompositeTaskHandler { | ||
return CompositeTaskHandler(handlers.plus(handler).toMutableList()) | ||
} | ||
|
||
override fun accept(taskInformation: TaskInformation, payload: Map<String, Any>) { | ||
handlers.forEach { it.accept(taskInformation, payload) } | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
.../dev/bpmcrafters/processengineapi/adapter/commons/task/CompositeTaskTerminationHandler.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,34 @@ | ||
package dev.bpmcrafters.processengineapi.adapter.commons.task | ||
|
||
import dev.bpmcrafters.processengineapi.task.TaskTerminationHandler | ||
|
||
/** | ||
* Composite task termination handler. | ||
* @since 0.1.2 | ||
* @param handlers handlers to include. | ||
*/ | ||
class CompositeTaskTerminationHandler( | ||
private val handlers: MutableList<TaskTerminationHandler> = mutableListOf(), | ||
) : TaskTerminationHandler { | ||
|
||
/** | ||
* Creates a new composite task termination handler out of current adding the given task termination handler. | ||
* @param handler handler to add. | ||
* @return composite handler. | ||
*/ | ||
fun withHandler(handler: TaskTerminationHandler): CompositeTaskTerminationHandler { | ||
return CompositeTaskTerminationHandler(handlers.plus(handler).toMutableList()) | ||
} | ||
|
||
/** | ||
* Adds handler. | ||
* @param handler handler to add. | ||
*/ | ||
fun addHandler(handler: TaskTerminationHandler) { | ||
this.handlers.add(handler) | ||
} | ||
|
||
override fun accept(taskId: String) { | ||
handlers.forEach { it.accept(taskId) } | ||
} | ||
} |
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
Oops, something went wrong.