Package kalix.javasdk.workflowentity
Interface WorkflowEntity.Effect.Builder<S>
- Type Parameters:
S- The type of the state for this entity.
- Enclosing interface:
- WorkflowEntity.Effect<T>
public static interface WorkflowEntity.Effect.Builder<S>
Construct the effect that is returned by the command handler or a step transition.
The effect describes next processing actions, such as updating state, transition to another step and sending a reply.
-
Method Summary
Modifier and TypeMethodDescriptionend()Finish the workflow execution.Create an error reply.Create an error reply.pause()Pause the workflow execution and wait for an external input, e.g.<R> WorkflowEntity.Effect<R>reply(R replyMessage) Create a message reply.<R> WorkflowEntity.Effect<R>Reply after for exampleupdateState.transitionTo(String stepName) Set the step that should be executed.transitionTo(String stepName, I input) Set the step that should be executed.updateState(S newState)
-
Method Details
-
updateState
-
pause
Pause the workflow execution and wait for an external input, e.g. via command handler. -
transitionTo
@ApiMayChange <I> WorkflowEntity.Effect.TransitionalEffect<Void> transitionTo(String stepName, I input) Set the step that should be executed.- Parameters:
stepName- The step name that should be executed.input- The input param for the step.
-
transitionTo
Set the step that should be executed.- Parameters:
stepName- The step name that should be executed.
-
end
Finish the workflow execution. -
reply
Create a message reply.- Type Parameters:
R- The type of the message that must be returned by this call.- Parameters:
replyMessage- The payload of the reply.- Returns:
- A message reply.
-
reply
Reply after for exampleupdateState.- Type Parameters:
R- The type of the message that must be returned by this call.- Parameters:
message- The payload of the reply.metadata- The metadata for the message.- Returns:
- A message reply.
-
error
Create an error reply.- Type Parameters:
R- The type of the message that must be returned by this call.- Parameters:
description- The description of the error.- Returns:
- An error reply.
-
error
Create an error reply.- Type Parameters:
R- The type of the message that must be returned by this call.- Parameters:
description- The description of the error.statusCode- A custom gRPC status code.- Returns:
- An error reply.
-