Class ThrowErrorCommandImpl
java.lang.Object
io.camunda.zeebe.client.impl.command.CommandWithVariables<ThrowErrorCommandStep1.ThrowErrorCommandStep2>
io.camunda.zeebe.client.impl.command.ThrowErrorCommandImpl
- All Implemented Interfaces:
FinalCommandStep<Void>
,ThrowErrorCommandStep1
,ThrowErrorCommandStep1.ThrowErrorCommandStep2
public final class ThrowErrorCommandImpl
extends CommandWithVariables<ThrowErrorCommandStep1.ThrowErrorCommandStep2>
implements ThrowErrorCommandStep1, ThrowErrorCommandStep1.ThrowErrorCommandStep2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.client.api.command.ThrowErrorCommandStep1
ThrowErrorCommandStep1.ThrowErrorCommandStep2
-
Field Summary
Fields inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
objectMapper
-
Constructor Summary
ConstructorDescriptionThrowErrorCommandImpl
(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, long key, Duration requestTimeout, Predicate<Throwable> retryPredicate) -
Method Summary
Modifier and TypeMethodDescriptionSet the errorCode for the error.errorMessage
(String errorMsg) Provide an error message describing the reason for the non-technical error.requestTimeout
(Duration requestTimeout) Sets the request timeout for the command.send()
Sends the command to the Zeebe broker.setVariablesInternal
(String variables) Methods inherited from class io.camunda.zeebe.client.impl.command.CommandWithVariables
variables, variables, variables, variables
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.camunda.zeebe.client.api.command.ThrowErrorCommandStep1.ThrowErrorCommandStep2
variables, variables, variables, variables
-
Constructor Details
-
ThrowErrorCommandImpl
public ThrowErrorCommandImpl(GatewayGrpc.GatewayStub asyncStub, JsonMapper jsonMapper, long key, Duration requestTimeout, Predicate<Throwable> retryPredicate)
-
-
Method Details
-
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 process, 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
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.
-
setVariablesInternal
- Specified by:
setVariablesInternal
in classCommandWithVariables<ThrowErrorCommandStep1.ThrowErrorCommandStep2>
-
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
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.
-