For some part of my project i need to create my bpmn file in c#. I've been told that i can use xsd to generate classes and fill xml with the help of these classes.
First i found out that xsd can generated from .genmodel file. After i had xsd, i wanted to use Microsoft's xsd tool to generate classes. The xsd file is huge and i don't want to create it manually. But xsd tool throws stackoverflow exception. Some say that it throws that because circular references but i don't know how to find them, like i said the file is big.
I appreciate if you express your ideas of how to generate my bpmn(xml) from c# application and/or how to handle xsd file and exception.
Sorry, I can't comment on a tool with which I'm not familiar. But as I said, I doubt something good will come out of a tool processing ecore.xsd; I doubt it makes sense to try to produce generated classes for the entire Ecore model.
No, I have no idea what to suggest, but BPMN is a complex model and I doubt trying to create instances of it based on generated class for the XSD for it will ever be a sensible approach. No doubt trying to create the XML using the C# equivalent of DOM is not so helpful either, but if your instances are to be simple, that might be simpler.
IMHO modeling as exemplified by UML/Ecore is vastly superior to ad hoc XML with a retrofit of XSD to try to add some integrity.
XSD to Ecore is a useful route to promote legacy designs into an intermediate integrity prior to a refactoring.
Ecore to XSD is useful as a way to satisfy your "must have an XSD" contractual requirement.
Struggling to make Ecore to XSD work completely is likely to be more time consuming than using an M2T tool to generate C# structural class code direct from Ecore. (I assume that your XSD to C# is just simple structure rather than the rich GenModel behaviour of Ecore to Java).