Interface ProcessJobProvider

All Superinterfaces:
PluginProvider

public interface ProcessJobProvider extends PluginProvider
A PluginProvider that defines a unit of executable async work for a ProcessEvent.

The provider runs against a single ProcessEvent — it receives the current step's inputs and returns success or failure, plus optional nextOpts that get forwarded to the next step in the chain. The provider defines what the step does. MorpheusProcessService, ApplianceJobService, and PluginProcessJobService handle scheduling, dispatch, and progression.

When the plugin loads, Morpheus syncs the provider's metadata into a ProcessJobType domain row. The provider's PluginProvider.getCode() becomes the identifier across the system: it is the ProcessJobType.code and the value stored in ProcessEvent.jobName.

Since:
1.4.0
  • Method Details

    • getDescription

      String getDescription()
      A description of this process job provider. Used when syncing provider metadata into the ProcessJobType domain row.
      Returns:
      human-readable description of what this process job does
    • execute

      Execute the process step.
      Parameters:
      request - contains the processEventId and the current step's merged opts
      Returns:
      success with optional ProcessJobExecutionResponse.nextOpts to forward to the next step, or failure to trigger retry/onFail handling
    • onFail

      default ServiceResponse onFail(ProcessJobExecutionRequest request)
      Called when a step fails terminally (retries exhausted or not retryable). Use for cleanup of side effects from this step. Exceptions are logged but do not change the outcome — the step is already failed. Not called on cancel.
      Parameters:
      request - the same request that was passed to execute(ProcessJobExecutionRequest)
      Returns:
      a ServiceResponse (success/failure is logged but does not affect the outcome)
    • isRetryable

      default Boolean isRetryable()
      Whether this step should be automatically retried on failure.
      Returns:
      true if retryable, false otherwise. Default is false.
    • getRetryCount

      default Integer getRetryCount()
      The maximum number of automatic retry attempts before the step fails terminally.
      Returns:
      retry count. Default is 5.
    • getRetryDelaySeconds

      default Integer getRetryDelaySeconds()
      The delay in seconds between automatic retry attempts.
      Returns:
      delay in seconds. Default is 10.
    • isCancelable

      default Boolean isCancelable()
      Whether this step can be canceled by a user. Canceling sets a flag on the process event; the plugin is responsible for checking the canceled flag during execution.
      Returns:
      true if cancelable, false otherwise. Default is false.
    • getOptionTypes

      default List<OptionType> getOptionTypes()
      Option types that define configurable inputs for this step. These are rendered in the retry dialog so users can modify inputs before manually retrying a failed step.
      Returns:
      list of OptionType definitions. Default is an empty list.