Skip to main content



      Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Namespace prefix in definitions
Namespace prefix in definitions [message #1753526] Tue, 07 February 2017 08:08 Go to next message
Eclipse UserFriend
Hi,

looks like I mastered BPMN2 so far and its really powerful. Now, im faced with a hopefully small problem, if you know where you have to dig in:

            
org.eclipse.bpmn2.Process simpleProcess = factory.createProcess();

ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl describeAttribute = (EAttributeImpl) metadata.demandFeature("http://www.mydomain.com/bpmn", "describes", false, false);
SimpleFeatureMapEntry describeEntry = new SimpleFeatureMapEntry(describeAttribute, "myValue");
simpleProcess.getAnyAttribute().add(describeEntry);


The persisted BPMN file contains now (deleted namespace declarations being not needed for the topic):

<bpmn2:definitions ...  xmlns:bpmn="http://www.mydomain.com/bpmn" ... >
  <bpmn2:process ... bpmn:describes="myValue" ... >


Now, my question:

How can I change the prefix, which seems to be derived from the URL being used for the schema location? The result should look like the following:

<bpmn2:definitions ...  xmlns:myown="http://www.mydomain.com/bpmn" ... >
  <bpmn2:process ... myown:describes="myValue" ... >


Thanks a lot in advance,
Bert




Re: Namespace prefix in definitions [message #1753547 is a reply to message #1753526] Tue, 07 February 2017 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Hi Bert,

Have a look at org.eclipse.bpmn2.util.Bpmn2ResourceImpl, specifically its implementation of XmlHelperImpl (the inner class named BpmnXmlHelper.) The XML Helper maintains a map of namespace prefix to namespace which might be where you want to insert/change the NS prefix of your "http://www.mydomain.com/bpmn"

HTH
Bob
Re: Namespace prefix in definitions [message #1753921 is a reply to message #1753547] Sun, 12 February 2017 16:17 Go to previous message
Eclipse UserFriend
Hi Bob,

thanks for your reply. Unfortunately, I'm running into a couple of problems:

Building the 1.3.0-SNAPSHOT was not working with the recent Maven release, found out 3.0.x is needed for compilation.
The problem with signing the jars was ok (commenting out the related plugins).
Building source jars (mvn source:jar) was not possible, do not know why? Its needed to understand how the BpmnXmlHelper is working with the debugger.

INFO] ------------------------------------------------------------------------
[INFO] Building BPMN 2.0 Metamodel 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:findbugs-maven-plugin:2.3.2-SNAPSHOT: Plugin org.codehaus.mojo:findbugs-maven-plugin:2.3.2-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:findbugs-maven-plugin:jar:2.3.2-SNAPSHOT
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from http://snapshots.repository.codehaus.org/ was cached in the local repository, resolution will not be reattempted until the update interval of codehaus.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to codehaus.snapshots (http://snapshots.repository.codehaus.org/): snapshots.repository.codehaus.org
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://snapshots.repository.codehaus.org/ was cached in the local repository, resolution will not be reattempted until the update interval of codehaus.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to codehaus.snapshots (http://snapshots.repository.codehaus.org/): snapshots.repository.codehaus.org
[WARNING] Failure to transfer org.apache.maven.plugins:maven-source-plugin/maven-metadata.xml from http://snapshots.repository.codehaus.org/ was cached in the local repository, resolution will not be reattempted until the update interval of codehaus.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins:maven-source-plugin/maven-metadata.xml from/to codehaus.snapshots (http://snapshots.repository.codehaus.org/): snapshots.repository.codehaus.org
[INFO] 
[INFO] >>> maven-source-plugin:3.0.1:jar (default-cli) @ bpmn2-parent >>>
[INFO] 
[INFO] <<< maven-source-plugin:3.0.1:jar (default-cli) @ bpmn2-parent <<<
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:jar (default-cli) @ bpmn2-parent ---
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building BPMN 2.0 Metamodel - Core 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:findbugs-maven-plugin:2.3.2-SNAPSHOT: Plugin org.codehaus.mojo:findbugs-maven-plugin:2.3.2-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:findbugs-maven-plugin:jar:2.3.2-SNAPSHOT
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from http://snapshots.repository.codehaus.org/ was cached in the local repository, resolution will not be reattempted until the update interval of codehaus.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to codehaus.snapshots (http://snapshots.repository.codehaus.org/): snapshots.repository.codehaus.org
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://snapshots.repository.codehaus.org/ was cached in the local repository, resolution will not be reattempted until the update interval of codehaus.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to codehaus.snapshots (http://snapshots.repository.codehaus.org/): snapshots.repository.codehaus.org
[WARNING] Failure to transfer org.apache.maven.plugins:maven-source-plugin/maven-metadata.xml from http://snapshots.repository.codehaus.org/ was cached in the local repository, resolution will not be reattempted until the update interval of codehaus.snapshots has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins:maven-source-plugin/maven-metadata.xml from/to codehaus.snapshots (http://snapshots.repository.codehaus.org/): snapshots.repository.codehaus.org
[INFO] 
[INFO] >>> maven-source-plugin:3.0.1:jar (default-cli) @ org.eclipse.bpmn2 >>>
[INFO] 
[INFO] --- tycho-packaging-plugin:0.16.0:build-qualifier (default-build-qualifier) @ org.eclipse.bpmn2 ---
[INFO] 
[INFO] --- tycho-packaging-plugin:0.16.0:validate-id (default-validate-id) @ org.eclipse.bpmn2 ---
[INFO] 
[INFO] --- tycho-packaging-plugin:0.16.0:validate-version (default-validate-version) @ org.eclipse.bpmn2 ---
[INFO] 
[INFO] <<< maven-source-plugin:3.0.1:jar (default-cli) @ org.eclipse.bpmn2 <<<
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:jar (default-cli) @ org.eclipse.bpmn2 ---
[INFO]                                                                         


Any help to create source jars and how the BpmnXmlHelper is working are welcome.

TIA,
Bert
Previous Topic:Extending ResourceRole
Next Topic:PropertyExtension
Goto Forum:
  


Current Time: Thu May 15 13:01:55 EDT 2025

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

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

Back to the top