flowable/flowable-engine · error · FlowableObjectNotFoundException

Process definition with id " + propertyValue + " does not…

Error message

Process definition with id " + propertyValue + " does not exist

What it means

ProcessDefinitionFormType.convertFormValueToModelValue resolves a form property value to a ProcessDefinition using the default engine's repository service. If no process definition exists with the given id, it throws FlowableObjectNotFoundException('Process definition with id <id> does not exist'). This guards form rendering/submission against stale or bogus process definition references.

Solutions

  1. Verify the process definition id exists via RepositoryService.createProcessDefinitionQuery().list()
  2. If the definition was redeployed, resolve the latest version by key instead of storing the versioned id
  3. Ensure ProcessEngines.getDefaultProcessEngine() points at the engine where the definition is deployed
  4. Correct the stored form value to reference an existing definition id

Example fix

// before
String defId = storedFormValue; // stale id from a previous deployment
Object def = formType.convertFormValueToModelValue(defId);
// after
ProcessDefinition def = repositoryService.createProcessDefinitionQuery()
    .processDefinitionKey(defKey).latestVersion().singleResult();
if (def == null) throw new IllegalArgumentException("No deployed definition for key " + defKey);
Defensive patterns

Strategy: validation

Validate before calling

ProcessDefinition pd = ProcessEngines.getDefaultProcessEngine()
    .getRepositoryService().createProcessDefinitionQuery()
    .processDefinitionId(propertyValue).singleResult();
if (pd == null) {
    // resolve by key + latest version, or reject the form value before use
    pd = ProcessEngines.getDefaultProcessEngine().getRepositoryService()
        .createProcessDefinitionQuery().latestVersion().singleResult();
}

Try / catch

try {
    Object modelValue = formType.convertFormValueToModelValue(propertyValue);
} catch (FlowableObjectNotFoundException e) {
    logger.error("Form references unknown process definition '{}'; redeploy or refresh form data", propertyValue, e);
    throw e;
}

Prevention

When it happens

Trigger: Calling convertFormValueToModelValue(propertyValue) on a 'process definition' form type with an id that does not match any deployed process definition (query returns singleResult() == null).

Common situations: Forms saved against a process definition that was later redeployed (new definition id/version); copying form values between environments with different deployments; typos in process definition ids; querying the wrong engine (getDefaultProcessEngine vs the actual engine name).

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-rest/src/main/java/org/flowable/rest/form/ProcessDefinitionFormType.java:43

 */
public class ProcessDefinitionFormType extends AbstractFormType {

    private static final long serialVersionUID = 1L;

    public static final String TYPE_NAME = "processDefinition";

    @Override
    public String getName() {
        return TYPE_NAME;
    }

    @Override
    public Object convertFormValueToModelValue(String propertyValue) {
        if (propertyValue != null) {
            ProcessDefinition processDefinition = ProcessEngines.getDefaultProcessEngine().getRepositoryService().createProcessDefinitionQuery().processDefinitionId(propertyValue).singleResult();

            if (processDefinition == null) {
                throw new FlowableObjectNotFoundException("Process definition with id " + propertyValue + " does not exist", ProcessDefinitionEntity.class);
            }

            return processDefinition;
        }
        return null;
    }

    @Override
    public String convertModelValueToFormValue(Object modelValue) {
        if (modelValue == null) {
            return null;
        }
        if (!(modelValue instanceof ProcessDefinition)) {
            throw new FlowableIllegalArgumentException("This form type only support process definitions, but is " + modelValue.getClass());
        }
        return ((ProcessDefinition) modelValue).getId();
    }
}

View on GitHub (pinned to d6d39ce1c6)