flowable/flowable-engine · error · FlowableCdiException

No execution associated. Call businessProcess.associateExecu

Error message

No execution associated. Call businessProcess.associateExecutionById() or businessProcess.startTask() first.

What it means

assertAssociated() enforces that a CDI-managed Execution is associated with the conversation before operations like triggerExecution run. Without a prior associateExecutionById() or startTask(), the engine has no execution to signal, so it throws FlowableCdiException.

Source

Thrown at modules/flowable-cdi/src/main/java/org/flowable/cdi/BusinessProcess.java:504

    /**
     * Returns the {@link ProcessInstance} currently associated or 'null'
     *
     * @throws FlowableCdiException if no {@link Execution} is associated. Use {@link #isAssociated()} to check whether an association exists.
     */
    public ProcessInstance getProcessInstance() {
        Execution execution = getExecution();
        if (execution != null && !(execution.getProcessInstanceId().equals(execution.getId()))) {
            return processEngine.getRuntimeService().createProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId()).singleResult();
        }
        return (ProcessInstance) execution;
    }

    // internal implementation
    // //////////////////////////////////////////////////////////

    protected void assertAssociated() {
        if (associationManager.getExecution() == null) {
            throw new FlowableCdiException("No execution associated. Call businessProcess.associateExecutionById() or businessProcess.startTask() first.");
        }
    }

    protected void assertTaskAssociated() {
        if (associationManager.getTask() == null) {
            throw new FlowableCdiException("No task associated. Call businessProcess.startTask() first.");
        }
    }

    protected Map<String, Object> getCachedVariables() {
        return associationManager.getCachedVariables();
    }

    protected Map<String, Object> getAndClearCachedVariables() {
        Map<String, Object> beanStore = getCachedVariables();
        Map<String, Object> copy = new HashMap<>(beanStore);
        beanStore.clear();
        return copy;

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Call businessProcess.associateExecutionById(executionId) (or startTask) before triggerExecution in the same conversation.
  2. Store the process instance id in the CDI conversation and re-associate on conversation restore.
  3. Catch FlowableCdiException and re-derive/restart context when the association cannot be recovered.

Example fix

// before
businessProcess.triggerExecution(); // no association
// after
businessProcess.associateExecutionById(processInstanceId);
businessProcess.triggerExecution();
Defensive patterns

Strategy: try-catch

Validate before calling

if (!businessProcess.isAssociated()) {
  businessProcess.associateExecutionById(savedProcessInstanceId);
}

Type guard

boolean executionAssociated() {
  return businessProcess.isAssociated();
}

Try / catch

try {
  businessProcess.triggerExecution();
} catch (FlowableCdiException e) {
  // no association: re-associate from stored id or fail gracefully
}

Prevention

When it happens

Trigger: Calling businessProcess.triggerExecution(...) (or other execution-scoped operations) in a conversation where neither startTask nor associateExecutionById was called, or after the association was cleared (e.g. end of process).

Common situations: Resuming a CDI conversation after a redeploy/restart losing the association; forgetting the bootstrap call in a JSF bean action; the associated process instance completed meanwhile.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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