Zeebe C# Client 2.5.0
C# Client to communicate with an Zeebe Gateway
Loading...
Searching...
No Matches
Zeebe.Client.Api.Worker.IJobClient Interface Reference

A client with access to all job-related operation:

More...

Inheritance diagram for Zeebe.Client.Api.Worker.IJobClient:
Zeebe.Client.IZeebeClient

Public Member Functions

ICompleteJobCommandStep1 NewCompleteJobCommand (long jobKey)
 Command to complete a job. More...
 
ICompleteJobCommandStep1 NewCompleteJobCommand (IJob activatedJob)
 Command to complete a job. More...
 
IFailJobCommandStep1 NewFailCommand (long jobKey)
 Command to mark a job as failed. More...
 
IThrowErrorCommandStep1 NewThrowErrorCommand (long jobKey)
 Command to report a business error (i.e. non-technical) that occurs while processing a job. More...
 

Detailed Description

A client with access to all job-related operation:

  • complete a job
  • mark a job as failed
  • update the retries of a job

Member Function Documentation

◆ NewCompleteJobCommand() [1/2]

ICompleteJobCommandStep1 Zeebe.Client.Api.Worker.IJobClient.NewCompleteJobCommand ( IJob  activatedJob)

Command to complete a job.

IJob activatedJob = ..;
jobClient
.NewCompleteJobCommand(activatedJob)
.Variables(json)
.Send();
Definition: IJob.cs:21
string Variables
JSON-formatted variables
Definition: IJob.cs:60

The job is linked to a process instance, which means this command will complete the related activity and continue the flow.

Parameters
activatedJobthe job, which should be completed
Returns
a builder for the command

◆ NewCompleteJobCommand() [2/2]

ICompleteJobCommandStep1 Zeebe.Client.Api.Worker.IJobClient.NewCompleteJobCommand ( long  jobKey)

Command to complete a job.

long jobKey = ..;
jobClient
.NewCompleteJobCommand(jobKey)
.Variables(json)
.Send();

The job is linked to a process instance, which means this command will complete the related activity and continue the flow.

Parameters
jobKeythe key which identifies the job
Returns
a builder for the command

◆ NewFailCommand()

IFailJobCommandStep1 Zeebe.Client.Api.Worker.IJobClient.NewFailCommand ( long  jobKey)

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 worker. Otherwise, an incident is created for this job.

Parameters
jobKeythe key which identifies the job
Returns
a builder for the command

◆ NewThrowErrorCommand()

IThrowErrorCommandStep1 Zeebe.Client.Api.Worker.IJobClient.NewThrowErrorCommand ( long  jobKey)

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)
.ErrorMessage("Business error message")
.Send();
Parameters
jobKeythe key which identifies the job
Returns
a builder for the command

The documentation for this interface was generated from the following file: