Package io.zeebe.client.impl.command
Class ThrowErrorCommandImpl
- java.lang.Object
-
- io.zeebe.client.impl.command.ThrowErrorCommandImpl
-
- All Implemented Interfaces:
FinalCommandStep<Void>
,ThrowErrorCommandStep1
,ThrowErrorCommandStep1.ThrowErrorCommandStep2
public final class ThrowErrorCommandImpl extends Object implements ThrowErrorCommandStep1, ThrowErrorCommandStep1.ThrowErrorCommandStep2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.zeebe.client.api.command.ThrowErrorCommandStep1
ThrowErrorCommandStep1.ThrowErrorCommandStep2
-
-
Constructor Summary
Constructors Constructor Description ThrowErrorCommandImpl(GatewayGrpc.GatewayStub asyncStub, long key, Duration requestTimeout, Predicate<Throwable> retryPredicate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThrowErrorCommandStep1.ThrowErrorCommandStep2
errorCode(String errorCode)
Set the errorCode for the error.ThrowErrorCommandStep1.ThrowErrorCommandStep2
errorMessage(String errorMsg)
Provide an error message describing the reason for the non-technical error.FinalCommandStep<Void>
requestTimeout(Duration requestTimeout)
Sets the request timeout for the command.ZeebeFuture<Void>
send()
Sends the command to the Zeebe broker.
-
-
-
Constructor Detail
-
ThrowErrorCommandImpl
public ThrowErrorCommandImpl(GatewayGrpc.GatewayStub asyncStub, long key, Duration requestTimeout, Predicate<Throwable> retryPredicate)
-
-
Method Detail
-
errorCode
public ThrowErrorCommandStep1.ThrowErrorCommandStep2 errorCode(String errorCode)
Description copied from interface:ThrowErrorCommandStep1
Set the errorCode for the error.If the errorCode can't be matched to an error catch event in the workflow, an incident will be created.
- Specified by:
errorCode
in interfaceThrowErrorCommandStep1
- Parameters:
errorCode
- the errorCode that will be matched against an error catch event- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
errorMessage
public ThrowErrorCommandStep1.ThrowErrorCommandStep2 errorMessage(String errorMsg)
Description copied from interface:ThrowErrorCommandStep1.ThrowErrorCommandStep2
Provide an error message describing the reason for the non-technical error. If the error is not caught by an error catch event, this message will be a part of the raised incident.- Specified by:
errorMessage
in interfaceThrowErrorCommandStep1.ThrowErrorCommandStep2
- Parameters:
errorMsg
- error message- Returns:
- the builder for this command. Call
FinalCommandStep.send()
to complete the command and send it to the broker.
-
requestTimeout
public FinalCommandStep<Void> requestTimeout(Duration requestTimeout)
Description copied from interface:FinalCommandStep
Sets the request timeout for the command. The default request timeout can be configured usingZeebeClientBuilder.defaultRequestTimeout(Duration)
.- Specified by:
requestTimeout
in interfaceFinalCommandStep<Void>
- Parameters:
requestTimeout
- the request timeout- Returns:
- the configured command
-
send
public ZeebeFuture<Void> send()
Description copied from interface:FinalCommandStep
Sends the command to the Zeebe broker. This operation is asynchronous. In case of success, the future returns the event that was generated by the Zeebe broker in response to the command.Call
ZeebeFuture.join()
to wait until the response is available.Future<JobEvent> future = command.send(); JobEvent event = future.join();
- Specified by:
send
in interfaceFinalCommandStep<Void>
- Returns:
- a future tracking state of success/failure of the command.
-
-