flowable/flowable-engine · error · FlowableIllegalArgumentException

jobId and job is null

Error message

jobId and job is null

What it means

MoveSuspendedJobToExecutableJobCmd.execute() requires a suspended jobId and throws FlowableIllegalArgumentException with message 'jobId and job is null' when it is null. It moves a job from the suspended-job table back to the executable table, which requires a valid id. It can be reached indirectly via activity-behavior execution paths (executeActivityBehavior).

Solutions

  1. Null-check the suspended job id before invoking the move.
  2. Verify the expression/variable that supplies the job id in custom behaviors resolves to a real id.
  3. Fix the wrapper/API caller that forwards null ids.

Example fix

// before
managementService.moveSuspendedJobToExecutableJob(suspendedJobId);
// after
if (suspendedJobId != null) {
    managementService.moveSuspendedJobToExecutableJob(suspendedJobId);
}
Defensive patterns

Strategy: validation

Validate before calling

if (suspendedJobId == null || suspendedJobId.isEmpty()) throw new IllegalArgumentException("suspended jobId required");

Type guard

boolean resumable = suspendedJob != null && suspendedJob.getId() != null;

Try / catch

try { managementService.moveSuspendedJobToExecutableJob(id); } catch (FlowableIllegalArgumentException e) { log.error("Invalid suspended job id: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Calling ManagementService.moveSuspendedJobToExecutableJob(jobId) with a null jobId, or the command being executed through suspend/resume activity behavior without an id.

Common situations: Resuming suspended jobs programmatically where the id variable was never populated; process definitions or custom behaviors referencing a job id expression that evaluates to null.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/90992b4be69465db. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-job-service/src/main/java/org/flowable/job/service/impl/cmd/MoveSuspendedJobToExecutableJobCmd.java:44

 * @author martin.grofcik
 */
public class MoveSuspendedJobToExecutableJobCmd implements Command<Job>, Serializable {

    private static final long serialVersionUID = 1L;

    protected String jobId;
    protected JobServiceConfiguration jobServiceConfiguration;

    public MoveSuspendedJobToExecutableJobCmd(String jobId, JobServiceConfiguration jobServiceConfiguration) {
        this.jobId = jobId;
        this.jobServiceConfiguration = jobServiceConfiguration;
    }

    @Override
    public Job execute(CommandContext commandContext) {

        if (jobId == null) {
            throw new FlowableIllegalArgumentException("jobId and job is null");
        }

        SuspendedJobEntity job = jobServiceConfiguration.getSuspendedJobEntityManager().findById(jobId);
        if (job == null) {
            throw new JobNotFoundException(jobId);
        }
        return jobServiceConfiguration.getJobService().activateSuspendedJob(job);
    }

    public String getJobId() {
        return jobId;
    }

}

View on GitHub (pinned to d6d39ce1c6)