{"record":{"id":"ff453f03e5d092a8","repo":"flowable/flowable-engine","slug":"destinationactivityid-is-null","errorCode":null,"errorMessage":"destinationActivityId is null","messagePattern":"destinationActivityId is null","errorType":"exception","errorClass":"PvmException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/ProcessDefinitionBuilder.java","lineNumber":80,"sourceCode":"        processElement = scopeStack.peek();\n\n        transition = null;\n\n        return this;\n    }\n\n    public ProcessDefinitionBuilder initial() {\n        processDefinition.setInitial(getActivity());\n        return this;\n    }\n\n    public ProcessDefinitionBuilder startTransition(String destinationActivityId) {\n        return startTransition(destinationActivityId, null);\n    }\n\n    public ProcessDefinitionBuilder startTransition(String destinationActivityId, String transitionId) {\n        if (destinationActivityId == null) {\n            throw new PvmException(\"destinationActivityId is null\");\n        }\n        ActivityImpl activity = getActivity();\n        transition = activity.createOutgoingTransition(transitionId);\n        unresolvedTransitions.add(new Object[]{transition, destinationActivityId});\n        processElement = transition;\n        return this;\n    }\n\n    public ProcessDefinitionBuilder endTransition() {\n        processElement = scopeStack.peek();\n        transition = null;\n        return this;\n    }\n\n    public ProcessDefinitionBuilder transition(String destinationActivityId) {\n        return transition(destinationActivityId, null);\n    }\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/ProcessDefinitionBuilder.java#L62-L98","documentation":"PvmException thrown by ProcessDefinitionBuilder.startTransition when the destination activity id argument is null. The builder records transitions whose destinations are resolved at build time by id, so a null id is invalid input that cannot be resolved later. It is a fail-fast argument validation to catch malformed process-definition construction early.","triggerScenarios":"Calling startTransition(null) or startTransition(null, someTransitionId) while building a PVM process definition programmatically.","commonSituations":"Programmatic process model construction where the destination id comes from a variable, map lookup, or parsed model that evaluated to null (e.g. missing targetRef in a converted BPMN model).","solutions":["Pass a non-null destination activity id that matches an activity created via startActivity(...) on the same builder.","Validate the id (e.g. from BPMN targetRef) before calling startTransition and skip or fail the transition creation if it is missing.","Fix the upstream model/parse step that produced a null id."],"exampleFix":"// before\nbuilder.startTransition(taskDef.getDestinationId()); // may be null\n// after\nif (taskDef.getDestinationId() != null) {\n  builder.startTransition(taskDef.getDestinationId());\n} else {\n  throw new IllegalArgumentException(\"transition target missing for \" + taskDef.getId());\n}","handlingStrategy":"validation","validationCode":"if (destinationActivityId == null) {\n  throw new IllegalArgumentException(\"destinationActivityId must be provided before startTransition()\");\n}\nbuilder.startTransition(destinationActivityId);","typeGuard":"boolean hasDestination = destinationActivityId != null && !destinationActivityId.trim().isEmpty();","tryCatchPattern":null,"preventionTips":["Never build transitions from unvalidated model fields like targetRef.","Assert non-null ids at the boundary where BPMN data is converted into builder calls."],"tags":["java","pvm","null-argument","process-definition-builder"],"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"}