{"record":{"id":"5591aae90d4adc31","repo":"elsa-workflows/elsa-core","slug":"an-namespaceprefix-bindingelementname-element-declares-no","errorCode":null,"errorMessage":"An <{NamespacePrefix}:{BindingElementName}> element declares no '{ActivityTypeAttributeName}', so there is nothing to build.","messagePattern":"An <(.+?):(.+?)> element declares no '(.+?)', so there is nothing to build\\.","errorType":"exception","errorClass":"BpmnBindingException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Bpmn.Interchange/Binding/BpmnActivityBindingFormat.cs","lineNumber":191,"sourceCode":"            .OrderBy(input => input.Name, StringComparer.Ordinal)\n            .Select(input => new BpmnExtensionElement(InputQName, [Attribute(InputNameAttributeName, input.Name)], null, activitySerializer.Serialize(input.Value!)))\n            .ToList();\n\n        return new(BindingQName, [Attribute(ActivityTypeAttributeName, activity.Type)], inputs);\n    }\n\n    /// <summary>\n    /// The activity a binding element declares, built through Elsa's own activity serializer so that it is\n    /// indistinguishable from the same activity loaded out of a stored workflow definition.\n    /// </summary>\n    /// <exception cref=\"BpmnBindingException\">\n    /// The element is malformed, names an activity type nothing registered, or names an input the activity type does\n    /// not declare.\n    /// </exception>\n    public IActivity Read(BpmnExtensionElement element)\n    {\n        var activityType = AttributeOf(element, ActivityTypeAttributeName)\n                           ?? throw new BpmnBindingException($\"An <{NamespacePrefix}:{BindingElementName}> element declares no '{ActivityTypeAttributeName}', so there is nothing to build.\");\n\n        var activityJson = new JsonObject\n        {\n            [\"type\"] = activityType\n        };\n\n        // Every name seen so far, in the order the document declares them, so a second <elsa:input> with the same\n        // name is refused rather than silently overwriting activityJson[name] and leaving the earlier one's\n        // configuration invisible.\n        var seenInputNames = new List<string>();\n        var seenInputNameSet = new HashSet<string>(StringComparer.Ordinal);\n\n        foreach (var input in element.Children.Where(child => child.Name == InputQName))\n        {\n            var name = AttributeOf(input, InputNameAttributeName)\n                       ?? throw new BpmnBindingException($\"An <{NamespacePrefix}:{InputElementName}> element of the '{activityType}' binding declares no '{InputNameAttributeName}'.\");\n\n            if (!seenInputNameSet.Add(name))","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Bpmn.Interchange/Binding/BpmnActivityBindingFormat.cs#L173-L209","documentation":"BpmnActivityBindingFormat.Read parses an Elsa extension element in a BPMN model and requires the 'activity-type' attribute to know which Elsa activity to construct. When the element has no such attribute there is nothing to build, so it throws BpmnBindingException. This is a fail-fast validation of malformed BPMN interchange payloads.","triggerScenarios":"Importing/parsing a BPMN document whose extension element (e.g., <elsa:activity-binding>) lacks the activity-type attribute — BpmnBindingFormat.Read hits AttributeOf(element, ActivityTypeAttributeName) returning null.","commonSituations":"Hand-authored or tool-exported BPMN where the custom extension attributes were stripped or misspelled (wrong namespace prefix, wrong attribute name); XML copy-paste between diagrams; an exporter version that predates the attribute convention.","solutions":["Add the missing activity-type attribute (the one named by ActivityTypeAttributeName under the Elsa namespace) to the element.","Validate the BPMN file against the expected Elsa interchange schema before import.","Check the element's namespace prefix matches the configured NamespacePrefix so attributes resolve.","Regenerate/export the diagram from the original authoring tool rather than hand-editing XML."],"exampleFix":"// before\n<elsa:activity-binding>\n  <elsa:input name=\"Message\" value=\"Hello\" />\n</elsa:activity-binding>\n\n// after\n<elsa:activity-binding activity-type=\"Elsa.Http:WriteHttpResponse\">\n  <elsa:input name=\"Content\" value=\"Hello\" />\n</elsa:activity-binding>","handlingStrategy":"validation","validationCode":"foreach (var el in bpmnDoc.Descendants().Where(e => e.Name.LocalName == \"activity-binding\"))\n    if (el.Attributes().All(a => a.Name.LocalName != \"activity-type\"))\n        throw new InvalidOperationException($\"Element {el.Name.LocalName} at line {((IXmlLineInfo)el).LineNumber} is missing 'activity-type'.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    var activity = bindingFormat.Read(element);\n}\ncatch (BpmnBindingException ex)\n{\n    logger.LogError(ex, \"Malformed BPMN activity binding at {ElementName}\", element.Name);\n}","preventionTips":["Validate BPMN files against the Elsa interchange schema before import.","Never hand-edit extension elements; export from the authoring tool.","Keep the Elsa namespace prefix consistent with the configured NamespacePrefix."],"tags":["bpmn","xml","validation","interchange"],"backgroundTag":"schema-validation-failed","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"}