问题描述
通常,我正在寻找一种对业务流程进行建模的方法.我经常找到UML和BPMN作为对此的答案.现在,我想用一个程序来检查这个模型.只有一个UML规范,这些元素的外观,而不是如何保存这些不同的模型.这就是为什么我仔细查看BPMN的原因. BPMN 2.0规范是对象管理组.
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 is only an UML specification HOW this elements should look like, not how this different models should be saved. Thats why I looked closer at BPMN. There is a BPMN 2.0 specification be the Object Management Group.
我下载了BPMN编辑器并开始使用此表示法.现在,我想开始编写一个程序来检查此BPMN 2.0文件(更确切地说,它们是xml文件).是否有与此BPMN一起使用的.NET Framework和/或实现?我只是不想为此编写自己的扩展XML解析器.
I downloaded a BPMN editor and start to play with this notation. Now I want to start to write a program that checks this BPMN 2.0 files (more precisely they are xml files). Is there any .NET Framework and/or Implementation that work with this BPMN ? I just don't want to write my own extended XML Parser for this.
如果没有:可以使用哪些其他模型对此类模型进行程序检查?
If not: What other Models can be used to do a programmatic check on this kind of models ?
关于检查:我想搜索模型中是否可以找到不同种类的信息,如果找不到该信息,则会发出警告.
About the checks: I want to search if different kind of information can be found in the models and throw warnings if this information can not be found.
推荐答案
似乎根本没有用于.NET的BPMN 2.0解析器,但是使用xsd.exe(它是Microsoft SDK的一部分),可以不仅为BPMN,还可以自己创建一个.怎么做:
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:
- 从omg下载5个xsd文件: http://www.omg.org/spec/BPMN/2.0/并将它们放置在同一文件夹中.
- 使用四个参数运行xsd.exe:
xsd.exe DC.xsd DI.xsd BPMNDI.xsd BPMN20.xsd /classes
- 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
第五个文件将由应用程序添加.确保具有正确的xsd顺序.否则它将无法正常工作.
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
因此,您将收到一个BPMN20.cs,其中包含所有类.您甚至可以更改输出语言(默认为C#).只需运行不带参数的xsd.exe
即可查看所有选项.
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.
要在.Net中使用它,请确保将System.Xml作为程序集添加,然后可以像这样获得Object:
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);
这篇关于.NET是否有任何BPMN 2.0解析器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!