Interface CompleteJobCommandStep1.CompleteJobCommandStep2
- All Superinterfaces:
FinalCommandStep<CompleteJobResponse>
- All Known Implementing Classes:
CompleteJobCommandImpl
- Enclosing interface:
CompleteJobCommandStep1
-
Method Summary
Modifier and TypeMethodDescriptioncorrect(JobResultCorrections corrections) Applies corrections to the user task attributes.correct(UnaryOperator<JobResultCorrections> corrections) Dynamically applies corrections to the user task attributes using a lambda expression.correctAssignee(String assignee) Correct the assignee of the task.correctCandidateGroups(List<String> candidateGroups) Correct the candidate groups of the task.correctCandidateUsers(List<String> candidateUsers) Correct the candidate users of the task.correctDueDate(String dueDate) Correct the due date of the task.correctFollowUpDate(String followUpDate) Correct the follow up date of the task.correctPriority(Integer priority) Correct the priority of the task.deny(boolean isDenied) Indicates whether the worker denies the work, i.e. explicitly doesn't approve it.Marks the completion of configuring the result of the job.Methods inherited from interface io.camunda.client.api.command.FinalCommandStep
requestTimeout, send
-
Method Details
-
deny
Indicates whether the worker denies the work, i.e. explicitly doesn't approve it. For example, a user task listener can deny the completion of a task by setting this flag to true. In this example, the completion of a task is represented by a job that the worker can complete as denied. As a result, the completion request is rejected and the task remains active. Defaults tofalse.Example usage:
client.newCompleteJobCommand(jobKey) .withResult() .deny(true) .send();- Parameters:
isDenied- indicates if the worker has denied the reason for the job- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
correct
Applies corrections to the user task attributes.This method allows the worker to modify key attributes of the user task (such as
assignee,candidateGroups, and so on)Example usage:
final JobResultCorrections corrections = new JobResultCorrections() .assignee("john_doe") // reassigns the task to 'john_doe' .priority(80) // sets a high priority .dueDate("2024-01-01T12:00:00Z") // updates the due date .candidateGroups(List.of("sales")) // allows the 'sales' group to claim the task .candidateUsers(List.of("alice")); // allows 'alice' to claim the task client.newCompleteJobCommand(jobKey) .withResult() .correct(corrections) .send();- Parameters:
corrections- the corrections to apply to the user task.- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
correct
CompleteJobCommandStep1.CompleteJobCommandStep2 correct(UnaryOperator<JobResultCorrections> corrections) Dynamically applies corrections to the user task attributes using a lambda expression.This method is a functional alternative to
correct(JobResultCorrections). It allows the worker to modify key user task attributes (such asassignee,dueDate,priority, and so on) directly via a lambda expression. The lambda receives the currentJobResultCorrectionsinstance, which can be updated as needed. If no corrections have been set yet, a defaultJobResultCorrectionsinstance is provided.Example usage:
client.newCompleteJobCommand(jobKey) .withResult() .correct(corrections -> corrections .assignee("john_doe") // dynamically reassigns the task to 'john_doe' .priority(80) // adjusts the priority of the task .dueDate("2024-01-01T12:00:00Z") // updates the due date .candidateGroups(List.of("sales")) // allows the 'sales' group to claim the task .candidateUsers(List.of("alice"))) // allows 'alice' to claim the task .send();- Parameters:
corrections- a lambda expression to modify theJobResultCorrections.- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
correctAssignee
Correct the assignee of the task.- Parameters:
assignee- assignee of the task- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
correctDueDate
Correct the due date of the task.- Parameters:
dueDate- due date of the task- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
correctFollowUpDate
Correct the follow up date of the task.- Parameters:
followUpDate- follow up date of the task- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
correctCandidateUsers
Correct the candidate users of the task.- Parameters:
candidateUsers- candidate users of the task- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
correctCandidateGroups
CompleteJobCommandStep1.CompleteJobCommandStep2 correctCandidateGroups(List<String> candidateGroups) Correct the candidate groups of the task.- Parameters:
candidateGroups- candidate groups of the task- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
correctPriority
Correct the priority of the task.- Parameters:
priority- priority of the task- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-
resultDone
CompleteJobCommandStep1 resultDone()Marks the completion of configuring the result of the job.This method is optional and can be used to indicate that the result configuration (such as corrections or denial) is complete. It allows calling methods unrelated to the job result.
Calling this method has no effect on the final command sent to the broker. It is provided for readability and organizational clarity in method chaining.
Example usage:
client.newCompleteJobCommand(jobKey) .withResult() .correctAssignee("john_doe") .resultDone() // explicitly marks the end of result configuration .variable("we_can", "still_set_vars") .send();- Returns:
- the builder for this command. Call
FinalCommandStep.send()to complete the command and send it to the broker.
-