Zeebe C# Client 2.7.0
C# Client to communicate with an Zeebe Gateway
Loading...
Searching...
No Matches
Zeebe.Client.IZeebeClient Interface Reference

The client to communicate with a Zeebe gateway/cluster. More...

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

Public Member Functions

IJobWorkerBuilderStep1 NewWorker ()
 Registers a new job worker for jobs of a given type.
 
IActivateJobsCommandStep1 NewActivateJobsCommand ()
 Command to activate multiple jobs of a given type.
 
IUpdateRetriesCommandStep1 NewUpdateRetriesCommand (long jobKey)
 Command to update the retries of a job.
 
IUpdateJobTimeoutCommandStep1 NewUpdateJobTimeoutCommand (long jobKey)
 Command to update the timeout of a job.
 
IDeployResourceCommandStep1 NewDeployCommand ()
 Command to deploy new resources, i.e. BPMN process models and DMN decision models.
 
IEvaluateDecisionCommandStep1 NewEvaluateDecisionCommand ()
 Command to evaluate a decision.
 
ICreateProcessInstanceCommandStep1 NewCreateProcessInstanceCommand ()
 Command to create/start a new instance of a process.
 
ICancelProcessInstanceCommandStep1 NewCancelInstanceCommand (long processInstanceKey)
 Command to cancel a process instance.
 
ISetVariablesCommandStep1 NewSetVariablesCommand (long elementInstanceKey)
 Command to update the variables of a process instance.
 
IResolveIncidentCommandStep1 NewResolveIncidentCommand (long incidentKey)
 Command to resolve an existing incident.
 
IPublishMessageCommandStep1 NewPublishMessageCommand ()
 Command to publish a message which can be correlated to a process instance.
 
IModifyProcessInstanceCommandStep1 NewModifyProcessInstanceCommand (long processInstanceKey)
 Command to modify a process instance.
 
ITopologyRequestStep1 TopologyRequest ()
 Request the current cluster topology. Can be used to inspect which brokers are available at which endpoint and which broker is the leader of which partition.
 
- Public Member Functions inherited from Zeebe.Client.Api.Worker.IJobClient
ICompleteJobCommandStep1 NewCompleteJobCommand (long jobKey)
 Command to complete a job.
 
ICompleteJobCommandStep1 NewCompleteJobCommand (IJob activatedJob)
 Command to complete a job.
 
IFailJobCommandStep1 NewFailCommand (long jobKey)
 Command to mark a job as failed.
 
IThrowErrorCommandStep1 NewThrowErrorCommand (long jobKey)
 Command to report a business error (i.e. non-technical) that occurs while processing a job.
 

Detailed Description

The client to communicate with a Zeebe gateway/cluster.

Member Function Documentation

◆ NewActivateJobsCommand()

IActivateJobsCommandStep1 Zeebe.Client.IZeebeClient.NewActivateJobsCommand ( )

Command to activate multiple jobs of a given type.

zeebeClient
.NewActivateJobsCommand()
.JobType("payment")
.maxJobsToActivate(10)
.WorkerName("paymentWorker")
.Timeout(TimeSpan.FromMinutes(10))
.Send();

The command will try to use maxJobsToActivate for given jobType. If less then the requested maxJobsToActivate jobs of the jobType are available for activation the returned list will have fewer elements.

Returns
a builder for the command

◆ NewCancelInstanceCommand()

ICancelProcessInstanceCommandStep1 Zeebe.Client.IZeebeClient.NewCancelInstanceCommand ( long  processInstanceKey)

Command to cancel a process instance.

zeebeClient
.NewCancelInstanceCommand(processInstanceKey)
.Send();
Parameters
processInstanceKeyprocessInstanceKey the key which identifies the corresponding process instance
Returns
a builder for the command

◆ NewCreateProcessInstanceCommand()

ICreateProcessInstanceCommandStep1 Zeebe.Client.IZeebeClient.NewCreateProcessInstanceCommand ( )

Command to create/start a new instance of a process.

zeebeClient
.NewCreateInstanceCommand()
.BpmnProcessId("my-process")
.LatestVersion()
.Variables(json)
.Send();
Returns
a builder for the command

◆ NewDeployCommand()

IDeployResourceCommandStep1 Zeebe.Client.IZeebeClient.NewDeployCommand ( )

Command to deploy new resources, i.e. BPMN process models and DMN decision models.

zeebeClient
.NewDeployResourceCommand()
.AddResourceFile("~/wf/process1.bpmn")
.AddResourceFile("~/wf/process2.bpmn")
.AddResourceFile("~/dmn/decision.dmn")
.Send();
Returns
a builder for the deploy command

◆ NewEvaluateDecisionCommand()

IEvaluateDecisionCommandStep1 Zeebe.Client.IZeebeClient.NewEvaluateDecisionCommand ( )

Command to evaluate a decision.

zeebeClient
.NewEvaluateDecisionCommand()
.DecisionKey("my-decision")
.Variables(json)
.Send();
Returns
a builder for the deploy command

◆ NewModifyProcessInstanceCommand()

IModifyProcessInstanceCommandStep1 Zeebe.Client.IZeebeClient.NewModifyProcessInstanceCommand ( long  processInstanceKey)

Command to modify a process instance.

zeebeClient
.NewModifyProcessInstanceCommand(processInstanceKey)
.ActivateElement("element1")
.And()
.ActivateElement("element2")
.WithVariables(globalScopedVariables)
.WithVariables(localScopedVariables, "element2")
.And()
.TerminateElement("element3")
.SendWithRetry();
Parameters
processInstanceKeyThe key which identifies the corresponding process instance.
Returns
a builder for the command.

◆ NewPublishMessageCommand()

IPublishMessageCommandStep1 Zeebe.Client.IZeebeClient.NewPublishMessageCommand ( )

Command to publish a message which can be correlated to a process instance.

zeebeClient
.NewPublishMessageCommand()
.MessageName("order canceled")
.CorrelationKey(orderId)
.Variables(json)
.Send();
Returns
a builder for the command

◆ NewResolveIncidentCommand()

IResolveIncidentCommandStep1 Zeebe.Client.IZeebeClient.NewResolveIncidentCommand ( long  incidentKey)

Command to resolve an existing incident.

zeebeClient
.NewResolveIncidentCommand(incidentKey)
.Send();
Parameters
incidentKeyincidentKey the key of the corresponding incident
Returns
the builder for the command

◆ NewSetVariablesCommand()

ISetVariablesCommandStep1 Zeebe.Client.IZeebeClient.NewSetVariablesCommand ( long  elementInstanceKey)

Command to update the variables of a process instance.

zeebeClient
.NewSetVariablesCommand(elementInstanceKey)
.Variables(json)
.Send();
Parameters
elementInstanceKeythe key of the element instance to set the variables for
Returns
a builder for the command

◆ NewUpdateJobTimeoutCommand()

IUpdateJobTimeoutCommandStep1 Zeebe.Client.IZeebeClient.NewUpdateJobTimeoutCommand ( long  jobKey)

Command to update the timeout of a job.

long jobKey = ..;
zeebeClient
.NewUpdateJobTimeoutCommand(jobKey)
.Timeout(new TimeSpan(0, 0, 0, 10))
.Send();

If the job's timeout is zero, the job will be directly retried.

Parameters
jobKeythe key of the job to update
Returns
a builder for the command

◆ NewUpdateRetriesCommand()

IUpdateRetriesCommandStep1 Zeebe.Client.IZeebeClient.NewUpdateRetriesCommand ( long  jobKey)

Command to update the retries of a job.

long jobKey = ..;
zeebeClient
.NewUpdateRetriesCommand(jobKey)
.Retries(3)
.Send();

If the given retries are greater than zero then this job will be picked up again by a job subscription and a related incident will be marked as resolved.

Parameters
jobKeythe key of the job to update
Returns
a builder for the command

◆ NewWorker()

IJobWorkerBuilderStep1 Zeebe.Client.IZeebeClient.NewWorker ( )

Registers a new job worker for jobs of a given type.

After registration, the broker activates available jobs and assigns them to this worker. It then publishes them to the client. The given worker is called for every received job, works on them and eventually completes them.

using(IJobWorker worker = zeebeClient
.NewWorker()
.jobType("payment")
.handler(paymentHandler)
.open())
{
...
}
Represents an job worker that performs jobs of a certain type. While a registration is open,...
Definition IJobWorker.cs:25

Example JobHandler implementation:

var handler = (client, job) =>
{
String json = job.Variables;
// modify variables
client
.CompleteCommand(job.Key)
.Variables(json)
.Send();
};

The handler must be thread-safe.

Returns
a builder for the worker registration

◆ TopologyRequest()

ITopologyRequestStep1 Zeebe.Client.IZeebeClient.TopologyRequest ( )

Request the current cluster topology. Can be used to inspect which brokers are available at which endpoint and which broker is the leader of which partition.

ITopology response = await ZeebeClient.TopologyRequest().Send();
IList{IBrokerInfo} brokers = response.Brokers;
Returns
the request where you must call IFinalCommandStep<T>.Send

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