com.github.frtu.kotlin.transition.HandoffImpl.kt Maven / Gradle / Ivy
package com.github.frtu.kotlin.transition
import com.github.frtu.kotlin.action.execution.TypedAction
import com.github.frtu.kotlin.action.execution.transition.ActionTransitionImpl
import com.github.frtu.kotlin.action.management.ActionId
import com.github.frtu.kotlin.action.management.ActionMetadata
/**
* Handoff input is a class that return an `ActionMetadata`
*/
open class HandoffImpl(
parameterJsonSchema: String,
nextAction: ACTION,
id: ActionId = ActionId("handoff-to-${nextAction.id}"),
description: String = "Transfer to '${nextAction.id}' if the user wants ${nextAction.description}",
) : TypedAction, Handoff, ActionTransitionImpl(
parameterJsonSchema = parameterJsonSchema,
nextAction = nextAction,
id = id,
description = description,
) {
override suspend fun execute(parameter: INPUT): ACTION = nextAction
}