cancel
Showing results for 
Search instead for 
Did you mean: 

programatic creation of bpmn.xml

newactivitiuser
Champ in-the-making
Champ in-the-making
Hi,

I am very new to activiti and using 5.10 version. My project needs bpmn20.xml files to be created programmatically. My approach is to populate activity-bpmn model and then generate xml from it.
So when I use maven to generate classes from activiti-bpmn-extensions-5.10.xsd I am getting several errors as pasted below. I can modify the names of conflicting property using xjb but when i will generate xml back from models that would be a problem as it will not be adhering to xsd. Please help me.

[ERROR] Error while parsing schema(s).Location [ file:/Users/uojha/cca/git-repo3/cca/cca/cca-bpmn-model/src/main/resources/META-INF/xsd/activiti-bpmn-extensions-5.10.xsd{257,60}].
com.sun.istack.SAXParseException2: Property "Expression" is already defined. Use <jaxbSmiley Tongueroperty> to resolve this conflict.
   at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:86)
   at com.sun.tools.xjc.reader.ModelChecker.checkPropertyCollision(ModelChecker.java:112)
   at com.sun.tools.xjc.reader.ModelChecker.check(ModelChecker.java:98)
   at com.sun.tools.xjc.reader.ModelChecker.check(ModelChecker.java:71)
   at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:193)
   at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:120)
   at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:416)
   at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:172)
   at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:118)
   at org.jvnet.mjiip.v_2_2.XJC22Mojo.loadModel(XJC22Mojo.java:45)
   at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:35)
   at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:22)
   at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:271)
   at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:140)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)


   at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR] Error while parsing schema(s).Location [ file:/Users/uojha/cca/git-repo3/cca/cca/cca-bpmn-model/src/main/resources/META-INF/xsd/activiti-bpmn-extensions-5.10.xsd{87,64}].
com.sun.istack.SAXParseException2: Property "Value" is already defined. Use <jaxbSmiley Tongueroperty> to resolve this conflict.
   at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:86)
   at com.sun.tools.xjc.reader.ModelChecker.checkPropertyCollision(ModelChecker.java:112)
   at com.sun.tools.xjc.reader.ModelChecker.check(ModelChecker.java:98)
   at com.sun.tools.xjc.reader.ModelChecker.check(ModelChecker.java:71)
   at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:193)
   at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:120)
   at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:416)
   at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:172)
   at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:118)
   at org.jvnet.mjiip.v_2_2.XJC22Mojo.loadModel(XJC22Mojo.java:45)
   at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:35)
   at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:22)
   at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:271)
   at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:140)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
3 REPLIES 3

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I think you better (or at least also) ask this in a jaxb forum…

frederikherema1
Star Contributor
Star Contributor
As of last month, there is a project that has the BPMN model and Activiti extensions built-in into a POJO-model that allows generating XML from it and the other way around (XML -> POJO).

See https://github.com/Activiti/Activiti/tree/master/modules/activiti-bpmn-converter, it's used in the designer and KIS modeler will probably be used in the engine itself when time allows it…

nchan
Champ in-the-making
Champ in-the-making
Great to see this initiative. This is going to open doors for projects looking for auto generation of the activiti bpmn from java model and the other way around ! Nice work frederikheremans. Iam hoping to use it soon for one of my project.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.