Interface TaskRule<R>

Type Parameters:
R - The result type of the task.

public interface TaskRule<R>
A rule that validates the result of a task before accepting its completion.

Add rules to a Task definition with Task.rules(java.lang.Class<? extends akka.javasdk.agent.task.TaskRule<R>>, java.lang.Class<? extends akka.javasdk.agent.task.TaskRule<R>>...). When the task is completed, each rule's onComplete(R) method is called with the deserialized result. If any rule returns TaskRule.Result.Rejected, the task is failed instead of completed.

Implementations must have a public no-arg constructor.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    onComplete(R result)
    Evaluate the task result before accepting completion.