{"record":{"id":"d97892f1aee5caf1","repo":"flowable/flowable-engine","slug":"invalid-attribute-value-for-activityref-no-acti","errorCode":null,"errorMessage":"Invalid attribute value for 'activityRef': no activity with id '{}' in current scope {}","messagePattern":"Invalid attribute value for 'activityRef': no activity with id '(.+?)' in current scope (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/CompensateEventDefinitionParseHandler.java","lineNumber":44,"sourceCode":"/**\n * @author Joram Barrez\n */\npublic class CompensateEventDefinitionParseHandler extends AbstractBpmnParseHandler<CompensateEventDefinition> {\n\n    private static final Logger LOGGER = LoggerFactory.getLogger(CompensateEventDefinitionParseHandler.class);\n\n    @Override\n    public Class<? extends BaseElement> getHandledType() {\n        return CompensateEventDefinition.class;\n    }\n\n    @Override\n    protected void executeParse(BpmnParse bpmnParse, CompensateEventDefinition eventDefinition) {\n\n        ScopeImpl scope = bpmnParse.getCurrentScope();\n        if (StringUtils.isNotEmpty(eventDefinition.getActivityRef())) {\n            if (scope.findActivity(eventDefinition.getActivityRef()) == null) {\n                LOGGER.warn(\"Invalid attribute value for 'activityRef': no activity with id '{}' in current scope {}\", eventDefinition.getActivityRef(), scope.getId());\n            }\n        }\n\n        org.activiti.engine.impl.bpmn.parser.CompensateEventDefinition compensateEventDefinition = new org.activiti.engine.impl.bpmn.parser.CompensateEventDefinition();\n        compensateEventDefinition.setActivityRef(eventDefinition.getActivityRef());\n        compensateEventDefinition.setWaitForCompletion(eventDefinition.isWaitForCompletion());\n\n        ActivityImpl activity = bpmnParse.getCurrentActivity();\n        if (bpmnParse.getCurrentFlowElement() instanceof ThrowEvent) {\n\n            activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createIntermediateThrowCompensationEventActivityBehavior((ThrowEvent) bpmnParse.getCurrentFlowElement(), compensateEventDefinition));\n\n        } else if (bpmnParse.getCurrentFlowElement() instanceof BoundaryEvent) {\n\n            BoundaryEvent boundaryEvent = (BoundaryEvent) bpmnParse.getCurrentFlowElement();\n            boolean interrupting = boundaryEvent.isCancelActivity();\n\n            activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createBoundaryEventActivityBehavior(boundaryEvent, interrupting, activity));","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/handler/CompensateEventDefinitionParseHandler.java#L26-L62","documentation":"During BPMN XML parsing, a compensate event definition specifies an activityRef whose id does not resolve to any activity in the current scope. Flowable (Activiti 5 compatibility engine) logs this warning instead of failing the parse; the compensateEventDefinition is still created, but the compensation target will not resolve at runtime. It signals a broken or misplaced compensation reference in the process model.","triggerScenarios":"executeParse of a CompensateEventDefinition when StringUtils.isNotEmpty(activityRef) and scope.findActivity(activityRef) returns null — i.e. the referenced id is misspelled, lives in a different (sub)process scope, or the element was removed.","commonSituations":"Hand-edited or generated BPMN XML with a stale activityRef; refactoring element ids in the modeler without updating the compensation boundary event; referencing an activity inside a nested subprocess from an outer-scope compensate event.","solutions":["Fix the activityRef attribute in the BPMN XML to match the id of an activity in the same scope","Remove the activityRef attribute to broadcast compensation to all activities in scope instead of one target","Verify the referenced element exists in the same subprocess/transaction scope and re-deploy the process definition"],"exampleFix":"// before\n<intermediateThrowEvent id=\"comp\"><compensateEventDefinition activityRef=\"taskOld\" /></intermediateThrowEvent>\n// after\n<intermediateThrowEvent id=\"comp\"><compensateEventDefinition activityRef=\"taskRenamed\" /></intermediateThrowEvent>","handlingStrategy":"validation","validationCode":"// pre-deploy check\nfor (EventDefinition ed : collectCompensateEventDefinitions(bpmnModel)) {\n    String ref = ed.getActivityRef();\n    if (ref != null && bpmnModel.getFlowElement(ref, true) == null) {\n        throw new IllegalArgumentException(\"activityRef '\" + ref + \"' not found in model\");\n    }\n}","typeGuard":"function hasValidActivityRef(model, ref) { return typeof ref === 'string' && ref.length > 0 && model.getFlowElement(ref, true) != null; }","tryCatchPattern":null,"preventionTips":["Keep element ids stable; use modeler refactor/rename so compensation refs update together","Validate BPMN with the schema/engine validation API before deployment","Keep compensation targets in the same subprocess scope as the compensate event"],"tags":["bpmn","parsing","compensation","process-definition"],"backgroundTag":"resource-not-found","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"}