Package io.camunda.client.api.command
Interface CompleteJobCommandStep1
- All Superinterfaces:
CommandWithCommunicationApiStep<CompleteJobCommandStep1>,FinalCommandStep<CompleteJobResponse>
- All Known Implementing Classes:
CompleteJobCommandImpl
public interface CompleteJobCommandStep1
extends CommandWithCommunicationApiStep<CompleteJobCommandStep1>, FinalCommandStep<CompleteJobResponse>
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface -
Method Summary
Modifier and TypeMethodDescriptionSet a single variable to complete the job with.variables(InputStream variables) Set the variables to complete the job with.Set the variables to complete the job with.Set the variables to complete the job with.Set the variables to complete the job with.Initializes the job result to allow corrections or a denial to be configured.withResult(CompleteJobResult jobResult) Sets the result of the completed job, allowing the worker to apply corrections to user task attributes or explicitly deny the user task lifecycle transition.withResult(UnaryOperator<CompleteJobResult> jobResultModifier) Modifies the result of the completed job using a lambda expression, allowing the worker to dynamically apply corrections to user task attributes or explicitly deny the user task lifecycle transition.Methods inherited from interface io.camunda.client.api.command.CommandWithCommunicationApiStep
useGrpc, useRestMethods inherited from interface io.camunda.client.api.command.FinalCommandStep
requestTimeout, send
-
Method Details
-
variables
Set the variables to complete the job with.- Parameters:
variables- the variables (JSON) as stream- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
variables
Set the variables to complete the job with.- Parameters:
variables- the variables (JSON) as String- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
variables
Set the variables to complete the job with.- Parameters:
variables- the variables as map- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
variables
Set the variables to complete the job with.- Parameters:
variables- the variables as object- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
variable
Set a single variable to complete the job with.- Parameters:
key- the key of the variable as stringvalue- the value of the variable as object- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
withResult
CompleteJobCommandStep1.CompleteJobCommandStep2 withResult()Initializes the job result to allow corrections or a denial to be configured.This method is used to apply changes to user task attributes (such as
assignee,priority,dueDate, and so on) or explicitly deny a user task lifecycle transition.Example usage:
client.newCompleteJobCommand(jobKey) .withResult() .correctAssignee("john_doe") // dynamically reassigns the task to 'john_doe' .correctPriority(84) // adjusts the priority of the task .correctDueDate("2024-11-22T11:44:55.0000Z") // sets a new due date .send();- Returns:
- the builder for this command.
-
withResult
Sets the result of the completed job, allowing the worker to apply corrections to user task attributes or explicitly deny the user task lifecycle transition.The
CompleteJobResultobject provides a flexible way to:- Correct user task attributes such as
assignee,dueDate,priority, and more. - Deny the lifecycle transition associated with the user task.
final CompleteJobResult jobResult = new CompleteJobResult() .correctAssignee("newAssignee") // dynamically assigns the task .correctPriority(42); // updates the task priority client.newCompleteJobCommand(jobKey) .withResult(jobResult) .send();- Parameters:
jobResult- the result of the job, containing corrections and/or a denial flag.- Returns:
- the builder for this command. Call
FinalCommandStep.send()to finalize the command and send it to the broker.
- Correct user task attributes such as
-
withResult
Modifies the result of the completed job using a lambda expression, allowing the worker to dynamically apply corrections to user task attributes or explicitly deny the user task lifecycle transition.This is a convenience method for
withResult(CompleteJobResult), allowing modifications to be applied directly via a functional interface rather than constructing theCompleteJobResultmanually, enabling:- Correcting user task attributes such as
assignee,dueDate,priority, and more. - Denying the lifecycle transition associated with the user task.
The lambda expression receives the current
CompleteJobResult, which can be modified as needed. If no result has been set yet, a defaultCompleteJobResultis provided for modification.client.newCompleteJobCommand(jobKey) .withResult(r -> r.deny(true)) .send();- Parameters:
jobResultModifier- a function to modify theCompleteJobResult.- Returns:
- the builder for this command. Call
FinalCommandStep.send()to finalize the command and send it to the broker.
- Correcting user task attributes such as
-