Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » namespace prefixes
namespace prefixes [message #1008053] Fri, 08 February 2013 16:23 Go to next message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
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 23:05 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 625
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

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 18:18 Go to previous message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
Thanks Robert.!
Previous Topic:Full custom tab
Next Topic:Disable model property extension
Goto Forum:
  


Current Time: Fri Dec 19 10:10:46 GMT 2014

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

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