dhaker
February 26, 2018, 4:44pm
1
Hey Team,
I’m using a custom descriptor in order to extend the Task element and add a new attribut called RankOrder it’s working fine and the bpmn xml is well generated.
{
"name": "customDescriptor",
"uri": "http://customDescriptor",
"prefix": "custdesc",
"xml": {
"tagAlias": "lowerCase"
},
"associations": [],
"types": [
{
"name": "RankOrder",
"extends": [ "bpmn:Task" ],
"properties": [
{
"name": "rankorder",
"isAttr": true,
"type": "String"
}
]
}
]
}
My issue here, the new attribut is displayed as below with colon (custdesc:rankorder), which poses a problem when trying to parse the xml in the backend (based on .Net) it seems that the “:” is allowed only for the node element and not for its attribute names (Xml specification ).
<bpmn:task id="Task_0ne4plj" name="In Progress" custdesc:rankorder="1">
and i get this exception:
The ':' character, hexadecimal value 0x3A, cannot be included in a name
is there any indication how to generate the attribut without colon as below:
<bpmn:task id="Task_0ne4plj" name="In Progress" rankorder="1">
thanks and regards,
nikku
February 27, 2018, 7:50am
2
Did you check your document against an online XML validator ?
I don’t know about the specifics of .Net
but prefixing attributes with a namespace is definitely valid XML.
1 Like
dhaker
February 27, 2018, 9:46pm
3
The document was validated with no errors, but i could not parse it in the backend.
thank you
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:custdesc_1="http://enformlabs.com/schema/bpmn/customDescriptor" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:custdesc="http://enformlabs.com/schema/bpmn/custdesc" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="Process_1" isExecutable="false">
<bpmn:startEvent id="StartElement" name="Start" custdesc_1:showreorderbutton="false" custdesc_1:classname="list-header-not-started" custdesc_1:rankorder="1" custdesc_1:isfreeflow="false" custdesc_1:istaskstate="false" custdesc_1:isstartstate="true" custdesc_1:isendstate="false" custdesc_1:assignedto="">
<bpmn:outgoing>SequenceFlow_03vnwy6</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1npa5ke" name="Transition" custdesc_1:rankorder="2" custdesc_1:isfreeflow="false" custdesc_1:istaskstate="true" custdesc_1:isstartstate="false" custdesc_1:isendstate="false" custdesc_1:assignedto="" custdesc_1:classname="list-header-transition" custdesc_1:showreorderbutton="true">
<bpmn:incoming>SequenceFlow_03vnwy6</bpmn:incoming>
</bpmn:task>
<bpmn:sequenceFlow id="SequenceFlow_03vnwy6" sourceRef="StartElement" targetRef="Task_1npa5ke" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNShape id="StartShape" bpmnElement="StartElement">
<dc:Bounds x="301" y="175" width="100" height="40" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_1npa5ke_di" bpmnElement="Task_1npa5ke">
<dc:Bounds x="453" y="175" width="100" height="40" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_03vnwy6_di" bpmnElement="SequenceFlow_03vnwy6">
<di:waypoint xsi:type="dc:Point" x="401" y="195" />
<di:waypoint xsi:type="dc:Point" x="453" y="195" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
nikku
February 28, 2018, 9:13am
4
The fact that you could not parse it indicates an issue on the back-end side of things.
I recommend you to investigate this, rather than trying to find a workaround via the toolkit.
1 Like
nikku
February 28, 2018, 9:16am
5
Looking at the XML, the prefix might be wrong, too.
You got both customdesc
and customdesc_1
in the BPMN 2.0 document. Assigning the wrong namespace may cause issues during validation in the backend.
1 Like
dhaker
February 28, 2018, 10:13am
6
Ok thank you nikku, good catch i will check that.