Class JobClientImpl
- All Implemented Interfaces:
JobClient
-
Constructor Summary
ConstructorDescriptionJobClientImpl
(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration config, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate) -
Method Summary
Modifier and TypeMethodDescriptionnewCompleteCommand
(long jobKey) Command to complete a job.Command to complete a job.newFailCommand
(long jobKey) Command to mark a job as failed.Command to mark a job as failed.newThrowErrorCommand
(long jobKey) Command to report a business error (i.e.Command to report a business error (i.e.
-
Constructor Details
-
JobClientImpl
public JobClientImpl(GatewayGrpc.GatewayStub asyncStub, ZeebeClientConfiguration config, JsonMapper jsonMapper, Predicate<Throwable> retryPredicate)
-
-
Method Details
-
newCompleteCommand
Description copied from interface:JobClient
Command to complete a job.long jobKey = ..; jobClient .newCompleteCommand(jobKey) .variables(json) .send();
If the job is linked to a process instance then this command will complete the related activity and continue the flow.
- Specified by:
newCompleteCommand
in interfaceJobClient
- Parameters:
jobKey
- the key which identifies the job- Returns:
- a builder for the command
-
newCompleteCommand
Description copied from interface:JobClient
Command to complete a job.ActivatedJob job = ..; jobClient .newCompleteCommand(job) .variables(json) .send();
If the job is linked to a process instance then this command will complete the related activity and continue the flow.
- Specified by:
newCompleteCommand
in interfaceJobClient
- Parameters:
job
- the activated job- Returns:
- a builder for the command
-
newFailCommand
Description copied from interface:JobClient
Command to mark a job as failed.long jobKey = ..; jobClient .newFailCommand(jobKey) .retries(3) .send();
If the given retries are greater than zero then this job will be picked up again by a job subscription. Otherwise, an incident is created for this job.
- Specified by:
newFailCommand
in interfaceJobClient
- Parameters:
jobKey
- the key which identifies the job- Returns:
- a builder for the command
-
newFailCommand
Description copied from interface:JobClient
Command to mark a job as failed.ActivatedJob job = ..; jobClient .newFailCommand(job) .retries(3) .send();
If the given retries are greater than zero then this job will be picked up again by a job subscription. Otherwise, an incident is created for this job.
- Specified by:
newFailCommand
in interfaceJobClient
- Parameters:
job
- the activated job- Returns:
- a builder for the command
-
newThrowErrorCommand
Description copied from interface:JobClient
Command to report a business error (i.e. non-technical) that occurs while processing a job.long jobKey = ...; String code = ...; jobClient .newThrowErrorCommand(jobKey) .errorCode(code) .send();
The error is handled in the process by an error catch event. If there is no error catch event with the specified errorCode then an incident will be raised instead.
- Specified by:
newThrowErrorCommand
in interfaceJobClient
- Parameters:
jobKey
- the key which identifies the job- Returns:
- a builder for the command
-
newThrowErrorCommand
Description copied from interface:JobClient
Command to report a business error (i.e. non-technical) that occurs while processing a job.ActivatedJob job = ...; String code = ...; jobClient .newThrowErrorCommand(job) .errorCode(code) .send();
The error is handled in the process by an error catch event. If there is no error catch event with the specified errorCode then an incident will be raised instead.
- Specified by:
newThrowErrorCommand
in interfaceJobClient
- Parameters:
job
- the activated job- Returns:
- a builder for the command
-