flowable/flowable-engine · error · PvmException

no behavior specified in

Error message

no behavior specified in ${activity}

What it means

PvmException thrown by AtomicOperationActivityExecute when the activity about to be executed has no ActivityBehavior set. Every activity the runtime actually executes must carry behavior (the code implementing what the activity does). An activity with no behavior cannot perform any work, so the engine fails fast.

Solutions

  1. Call activity.setActivityBehavior(new SomeBehavior(...)) on the activity before it is executed.
  2. For BPMN-parsed models, ensure the parser registers behaviors for all element types in the model.
  3. Remove the empty activity from the model if it was not intended to execute.

Example fix

// before
ActivityImpl act = scope.createActivity("manualTask");
// no behavior set -> runtime fails
// after
ActivityImpl act = scope.createActivity("manualTask");
act.setActivityBehavior(new TaskDefinitionBehavior(taskDefinition));
Defensive patterns

Strategy: validation

Validate before calling

ActivityBehavior b = activity.getActivityBehavior();
if (b == null) {
  throw new IllegalArgumentException("activity '" + activity.getId() + "' has no ActivityBehavior assigned");
}

Try / catch

try {
  execution.executeActivity(activity);
} catch (PvmException e) {
  if (e.getMessage() != null && e.getMessage().contains("no behavior specified")) {
    log.error("Missing behavior on activity: " + e.getMessage());
  }
  throw e;
}

Prevention

When it happens

Trigger: Reaching an activity during execution whose ActivityBehavior is null — e.g. a programmatically created ActivityImpl (new ActivityImpl(...)) that never got setActivityBehavior(...), or a model import that skipped behavior assignment.

Common situations: Hand-built PVM definitions used for tests/tools, custom BPMN parsers that forget to map an element type to its behavior, or manually modifying a deployed model.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/runtime/AtomicOperationActivityExecute.java:46

/**
 * @author Tom Baeyens
 */
public class AtomicOperationActivityExecute implements AtomicOperation {

    private static final Logger LOGGER = LoggerFactory.getLogger(AtomicOperationActivityExecute.class);

    @Override
    public boolean isAsync(InterpretableExecution execution) {
        return false;
    }

    @Override
    public void execute(InterpretableExecution execution) {
        ActivityImpl activity = (ActivityImpl) execution.getActivity();

        ActivityBehavior activityBehavior = activity.getActivityBehavior();
        if (activityBehavior == null) {
            throw new PvmException("no behavior specified in " + activity);
        }

        LOGGER.debug("{} executes {}: {}", execution, activity, activityBehavior.getClass().getName());

        try {
            if (Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
                Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                        ActivitiEventBuilder.createActivityEvent(FlowableEngineEventType.ACTIVITY_STARTED,
                                execution.getActivity().getId(),
                                (String) execution.getActivity().getProperty("name"),
                                execution.getId(),
                                execution.getProcessInstanceId(),
                                execution.getProcessDefinitionId(),
                                (String) activity.getProperties().get("type"),
                                activity.getActivityBehavior().getClass().getCanonicalName()),
                        EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);
            }

View on GitHub (pinned to d6d39ce1c6)