{"record":{"id":"8b8cec53ce759a19","repo":"flowable/flowable-engine","slug":"transition-is-null","errorCode":null,"errorMessage":"transition is null","messagePattern":"transition is null","errorType":"exception","errorClass":"PvmException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/runtime/ExecutionImpl.java","lineNumber":590,"sourceCode":"            throw e;\n        } catch (Exception e) {\n            throw new PvmException(\"couldn't process signal '\" + signalName + \"' on activity '\" + activity.getId() + \"': \" + e.getMessage(), e);\n        }\n    }\n\n    @Override\n    public void take(PvmTransition transition, boolean fireActivityCompletedEvent) {\n        // No event firing on executionlevel impl\n        take(transition);\n    }\n\n    @Override\n    public void take(PvmTransition transition) {\n        if (this.transition != null) {\n            throw new PvmException(\"already taking a transition\");\n        }\n        if (transition == null) {\n            throw new PvmException(\"transition is null\");\n        }\n        setTransition((TransitionImpl) transition);\n        performOperation(AtomicOperation.TRANSITION_NOTIFY_LISTENER_END);\n    }\n\n    @Override\n    public void executeActivity(PvmActivity activity) {\n        setActivity((ActivityImpl) activity);\n        performOperation(AtomicOperation.ACTIVITY_START);\n    }\n\n    @Override\n    public List<ActivityExecution> findInactiveConcurrentExecutions(PvmActivity activity) {\n        List<ActivityExecution> inactiveConcurrentExecutionsInActivity = new ArrayList<>();\n        List<ActivityExecution> otherConcurrentExecutions = new ArrayList<>();\n        if (isConcurrent()) {\n            List<? extends ActivityExecution> concurrentExecutions = getParent().getExecutions();\n            for (ActivityExecution concurrentExecution : concurrentExecutions) {","sourceCodeStart":572,"sourceCodeEnd":608,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/runtime/ExecutionImpl.java#L572-L608","documentation":"A straightforward argument-validation PvmException: ExecutionImpl.take(transition) was invoked with a null PvmTransition. The engine requires an explicit outgoing transition to move the execution forward. Thrown before any state is mutated, so the execution remains unchanged.","triggerScenarios":"Calling execution.take(null) directly from custom code or a custom ActivityBehavior; computing outgoing transitions dynamically (e.g. getOutgoingFlows().get(i)) when the collection is empty or the lookup returns null.","commonSituations":"Custom gateway/decision behaviors selecting a transition by name that doesn't exist on the activity; process XML missing the expected sequence flow so the resolved transition is null; programmatic model building where a flow was never attached.","solutions":["Null-check the transition before calling take() and throw a descriptive error","Verify the process definition actually contains the outgoing sequence flow being selected","Fix transition-selection logic (match by flow id/name) to fall back to a default flow","If building the model programmatically, ensure the TransitionImpl was added to the activity before use"],"exampleFix":"// before\nPvmTransition t = activity.getOutgoingFlows().get(0);\nexecution.take(t); // NPE / PvmException if none\n// after\nList<PvmTransition> flows = activity.getOutgoingFlows();\nif (flows.isEmpty()) throw new ActivitiException(\"no outgoing flow for \" + activity.getId());\nexecution.take(flows.get(0));","handlingStrategy":"validation","validationCode":"PvmTransition t = activity.getOutgoingFlows().stream()\n    .filter(f -> name.equals(f.getId())).findFirst().orElse(null);\nif (t == null) throw new ActivitiException(\"no outgoing flow named \" + name);\nexecution.take(t);","typeGuard":"boolean hasOutgoing(PvmActivity a) { return a != null && !a.getOutgoingFlows().isEmpty(); }","tryCatchPattern":"try {\n  execution.take(t);\n} catch (PvmException e) {\n  // transition was null — fix transition selection\n}","preventionTips":["Null-check transitions resolved by name/id before take()","Ensure process XML defines all referenced sequence flows","Default to a fallback flow when dynamic selection fails"],"tags":["process-engine","null-argument","transition"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}