Skip to main content



      Home
Home » Eclipse Projects » BPMN 2.0 Modeler » namespace prefixes
namespace prefixes [message #1008053] Fri, 08 February 2013 11:23 Go to next message
Eclipse UserFriend
Hi.

I'd like to know why when I add an attribute "agoratestproperty" on JBPM5.5.5 project it generates an XML like this:
 <process id="com.sample.bpmn" tns:version="1" tns:packageName="defaultPackage" tns:adHoc="false" tns:agoratestproperty="Mingua" name="New Processasdasdda" isExecutable="true" processType="Private">
    <startEvent id="StartEvent_1" name="StartProcess"/>
    <task id="Task_1" name="Task 1"/>
    <userTask id="UserTask_1" name="User Task 1"/>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1" name="New Processasdasdda">
    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="com.sample.bpmn">


and when I do the samething in runtime.test, example or myown plugin, it generates something like:
 <bpmn2:process id="process_11111111" mym:agoraTEST="0" name="Default Process">
    <bpmn2:startEvent id="StartEvent_1">
      <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:sequenceFlow id="SequenceFlow_1" sourceRef="StartEvent_1" targetRef="EndEvent_1"/>
    <bpmn2:endEvent id="EndEvent_1">
      <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
    </bpmn2:endEvent>
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="_X7KDsHH_EeKutMD7P1p4vw" name="Default Process Diagram">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="mym:process_11111111">


The outpu differ on references: In BPMNDI.bpmnElement it puts the prefix (2nd case :"mym") and in JBPMN extensions it doesn't put the prefix. Someone can tell me we, Is it about metamodel? A searched on classes but I can't figure it out, I really need to purge those prefixes from my extension.


Thanks
rui
Re: namespace prefixes [message #1008331 is a reply to message #1008053] Mon, 11 February 2013 18:05 Go to previous messageGo to next message
Eclipse UserFriend
Hi Rui,

I'm not sure why this would cause you problems, but you could create a default XML namespace in the <definitions> root element, like this:

xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"

If you absolutely must, you can override the createDocumentRoot() method in Bpmn2ModelerFactory like this:

	
    @Override
    public DocumentRoot createDocumentRoot() {
        DocumentRootImpl documentRoot = new Bpmn2ModelerDocumentRootImpl() {

	    public Map<String, String> getXMLNSPrefixMap() {
	        if (xMLNSPrefixMap == null) {
	            xMLNSPrefixMap = super.getXMLNSPrefixMap();
	            xMLNSPrefixMap.map().put("", Bpmn2Package.eNS_URI);
                }
        };
        return documentRoot;
    }



However, this means that your extension model's DocumentRoot MUST extend the BPMN2 metamodel DocumentRoot class, and your extension model resource factory MUST extend Bpmn2ModelerFactory.

Let me know if you run into problems.

Cheers!
Bob
Re: namespace prefixes [message #1008501 is a reply to message #1008331] Tue, 12 February 2013 13:18 Go to previous message
Eclipse UserFriend
Thanks Robert.!
Previous Topic:Release 0.2.2 now available
Next Topic:Full custom tab
Goto Forum:
  


Current Time: Tue Jul 08 01:18:53 EDT 2025

Powered by FUDForum. Page generated in 0.04544 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top