{"record":{"id":"3579e8a36b5d5988","repo":"elsa-workflows/elsa-core","slug":"bpmn-element-element-elementid-element-elementtype-of","errorCode":null,"errorMessage":"BPMN element '{element.ElementId}' ({element.ElementType}) of process '{definition.ProcessId}' carries an <{BpmnActivityBindingFormat.NamespacePrefix}:{BpmnActivityBindingFormat.BindingElementName}> element, but its work is not an unbound task, so nothing would ever run it. Only a task the document describes without implementing takes an authored activity binding.","messagePattern":"BPMN element '(.+?)' \\((.+?)\\) of process '(.+?)' carries an <(.+?):(.+?)> element, but its work is not an unbound task, so nothing would ever run it\\. Only a task the document describes without implementing takes an authored activity binding\\.","errorType":"exception","errorClass":"BpmnBindingException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Bpmn.Interchange/Binding/BpmnWorkBinder.cs","lineNumber":166,"sourceCode":"\n        consumed.Add(unbound.ElementId);\n\n        return format.Read(declaration);\n    }\n\n    /// <summary>\n    /// Refuses an <c>elsa:activityBinding</c> on an element that has no unbound task to bind.\n    /// </summary>\n    /// <remarks>\n    /// Six of the seven kinds bind on their own and never consult a declaration, so one written on a timer, a\n    /// subprocess or a gateway configures nothing. Ignoring it is the quiet answer: the author sees their expression in\n    /// the file, the process runs, and the activity they configured never executes. Refusing says so.\n    /// </remarks>\n    private static void RefuseUnusedDeclarations(BpmnProcessDefinition definition, ISet<string> consumed)\n    {\n        foreach (var element in definition.Elements.Where(element => BpmnActivityBindingFormat.Find(element.Extensions) is not null && !consumed.Contains(element.ElementId)))\n        {\n            throw new BpmnBindingException(\n                $\"BPMN element '{element.ElementId}' ({element.ElementType}) of process '{definition.ProcessId}' carries an <{BpmnActivityBindingFormat.NamespacePrefix}:{BpmnActivityBindingFormat.BindingElementName}> element, but its work is not an unbound task, so nothing would ever run it. \"\n                + \"Only a task the document describes without implementing takes an authored activity binding.\");\n        }\n    }\n\n    private static TimeSpan IsoDurationOf(BpmnWorkBinding.TimerWait timer)\n    {\n        try\n        {\n            return XmlConvert.ToTimeSpan(timer.IsoDuration);\n        }\n        catch (Exception exception) when (exception is FormatException or OverflowException or ArgumentNullException)\n        {\n            throw new BpmnBindingException($\"BPMN element '{timer.ElementId}' declares the timer duration '{timer.IsoDuration}', which is not an ISO-8601 duration Elsa can wait for.\");\n        }\n    }\n\n    private static string CalledElementOf(BpmnWorkBinding.CallProcess call) =>","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Bpmn.Interchange/Binding/BpmnWorkBinder.cs#L148-L184","documentation":"An <elsa:binding> declaration was found on a BPMN element whose work is not an unbound task (e.g. a call activity or timer event). Such elements have their own BPMN-defined behavior, so the authored binding would never execute; the binder refuses the import to make this explicit.","triggerScenarios":"BpmnWorkBinder.RefuseUnusedDeclarations (called by BindScope) finds an element that carries an <elsa:binding> extension but whose ElementId was never added to the consumed set — i.e. no UnboundTask path consumed it.","commonSituations":"Copy-pasting a binding from a task onto a call activity or gateway; adding bindings to every element 'just in case'; a modeler change that turned a task into a call activity while keeping the old binding.","solutions":["Delete the <elsa:binding> element from the named element — its behavior is defined by BPMN, not by an authored activity.","If an authored activity is truly wanted, change the element back to a plain task (unbound) and keep the binding.","Double-check element IDs: the binding may have been pasted onto the wrong element."],"exampleFix":"// before\n<bpmn:callActivity id=\"Call1\">\n  <bpmn:extensionElements><elsa:binding activityType=\"SendEmail\" /></bpmn:extensionElements>\n</bpmn:callActivity>\n// after\n<bpmn:callActivity id=\"Call1\" calledElement=\"OtherProcess\" />","handlingStrategy":"validation","validationCode":"foreach (var el in doc.Descendants().Where(e => e.Name.LocalName == \"callActivity\" || e.Name.LocalName.Contains(\"Event\")))\n{\n    var binding = el.Element(\"extensionElements\")?.Elements().FirstOrDefault(x => x.Name.LocalName == \"binding\");\n    if (binding != null) Console.WriteLine($\"Element {el.Attribute(\"id\")?.Value} carries an elsa:binding but is not an unbound task.\");\n}","typeGuard":null,"tryCatchPattern":"try { await importer.ImportAsync(bpmn); }\ncatch (BpmnBindingException ex) when (ex.Message.Contains(\"its work is not an unbound task\"))\n{\n    logger.LogError(ex, \"Remove the elsa:binding from the element; only unbound tasks take bindings.\");\n}","preventionTips":["Only place <elsa:binding> on plain tasks the BPMN does not implement itself","Do not blanket-copy bindings across elements","Review BPMN diffs for bindings attached to call activities, events, or gateways"],"tags":["bpmn","unused-binding","validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}