Interface CompleteJobCommandStep1

All Superinterfaces:
CommandWithCommunicationApiStep<CompleteJobCommandStep1>, CommandWithVariables<CompleteJobCommandStep1>, FinalCommandStep<CompleteJobResponse>, JobCallbackFinalCommandStep<CompleteJobResponse>
All Known Implementing Classes:
CompleteJobCommandImpl

  • Method Details

    • variables

      CompleteJobCommandStep1 variables(String variables)
      Set the variables to complete the job with.
      Specified by:
      variables in interface CommandWithVariables<CompleteJobCommandStep1>
      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

      CompleteJobCommandStep1 variables(Object variables)
      Set the variables to complete the job with.
      Specified by:
      variables in interface CommandWithVariables<CompleteJobCommandStep1>
      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.
    • variables

      CompleteJobCommandStep1 variables(InputStream variables)
      Set the variables to complete the job with.
      Specified by:
      variables in interface CommandWithVariables<CompleteJobCommandStep1>
      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

      CompleteJobCommandStep1 variables(Map<String,Object> variables)
      Set the variables to complete the job with.
      Specified by:
      variables in interface CommandWithVariables<CompleteJobCommandStep1>
      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.
    • variable

      CompleteJobCommandStep1 variable(String key, Object value)
      Set a single variable to complete the job with.
      Specified by:
      variable in interface CommandWithVariables<CompleteJobCommandStep1>
      Parameters:
      key - the key of the variable as string
      value - 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

      Initializes the job result to allow followup actions to be configured.
      Returns:
      the builder for this command.
    • withLeaseToken

      CompleteJobCommandStep1 withLeaseToken(String leaseToken)
      Sets the lease token identifying the job's activation, fencing this command against a superseded activation of the same job. Obtain it from ActivatedJob#getLeaseToken().

      For a leased job, the matching token must be supplied to prove the command comes from the worker that holds the current lease; a command with no token is rejected. A command carrying a stale token is likewise rejected, fencing the job against a superseded activation (e.g. after the job timed out or failed and was re-activated by another worker). A job that was activated without a lease requires no token.

      When this command is created from an activated job (e.g. newCompleteCommand(activatedJob)) the job's lease token is carried automatically, so this method is only needed when building the command from a job key.

      Parameters:
      leaseToken - the opaque lease token the worker received when the job was activated
      Returns:
      the builder for this command. Call FinalCommandStep.send() to complete the command and send it to the broker.
    • withBusinessId

      CompleteJobCommandStep1 withBusinessId(String businessId)
      Assigns the given business id to the job's root process instance as part of completing the job, letting a worker derive the identifier from work it just performed.

      The assignment is single and irreversible and is only accepted while business id uniqueness is disabled. Only artifacts created after the assignment carry the business id; already-existing ones are not enriched. Completing with a business id that differs from one already assigned rejects the whole completion, leaving the job open; re-sending the identical business id is an idempotent no-op.

      Passing null leaves the business id unset (no assignment is requested). A blank business id is rejected with an IllegalArgumentException.

      Parameters:
      businessId - the business id to assign to the root process instance
      Returns:
      the builder for this command. Call FinalCommandStep.send() to complete the command and send it to the broker.
      Throws:
      IllegalArgumentException - if businessId is blank