Is there any BPMN 2.0 Parser for .NET?

前端 未结 2 673
猫巷女王i
猫巷女王i 2021-02-06 08:49

In general, I am searching for a way to Model business processes. I found UML and BPMN quite often as an answer to this. Now I want to check this models with a Program. There i

2条回答
  •  时光取名叫无心
    2021-02-06 09:26

    It seems that there is corently no BPMN 2.0 Parser for .NET, but with the xsd.exe, that is Part of the Microsoft SDK, it is possible to create one by your own, not only for BPMN. How to do it:

    • Download the 5 xsd Files from the omg: http://www.omg.org/spec/BPMN/2.0/ and place them in the same folder.
    • run the xsd.exe with four parameters: xsd.exe DC.xsd DI.xsd BPMNDI.xsd BPMN20.xsd /classes

    The fifth file will be added by the Application. Be sure to have the correct order of the xsd. Otherwise it won't work.

    On my Maschine the Call looks like this:

    "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\xsd.exe" "C:\Users\me\DC.xsd" "C:\Users\me\DI.xsd" "C:\Users\me\BPMNDI.xsd" "C:\Users\me\BPMN20.xsd" /classes

    As a result you will receive a BPMN20.cs with all classes in there. You can even change the output language (default is C#). Just run xsd.exe without a parameter to see all options.

    To use it in .Net, be sure to add System.Xml as a Assembly, then you can get the Object like this:

    var serialzer = new XmlSerializer(typeof(tDefinitions));
    var XmlStream = new StreamReader("bpmn.xml");
    var document= (tDefinitions) serialzer.Deserialize(XmlStream);
    

提交回复
热议问题