界面画的流程图必需要解析到数据库,所以要有个样式扩展表来分析流程图,定义流程图描述信息文件格式:ProcessModle.xlst如下
流程图格式描述(XML)
<mxGraphModel>
<root>
<Diagram label="My Diagram" href="###" id="0">
<mxCell/>
</Diagram>
<Layer label="Default Layer" id="1">
<mxCell parent="0"/>
</Layer>
<Shape label="开始" href="" id="2">
<mxCell style="triangle;fillColor=#3cb208" parent="1" vertex="1">
<mxGeometry x="70" y="170" width="40" height="50" StepID="2" StepName="开始" ProcessGUID="" StepType="0" StepGUID="" AuditorType="4" AuditorGUID="2A3EF8D4-5B70-401B-AF6F-D3A58EEDB6FE" AuditorName="[发起人]" AuditorNameCC="" AuditorNameCCGUID="" IsCanAssign="1" IsMulti="0" IsCanRevolution="1" IsCanClose="0" IsCanRollBack="1" IsCanCancel="1" Description="" DispBusinessDomain="" EditBusinessDomain="申购单位,希望完成日期,单号,预计金额,物品名称,规格,申购数,预计单价,小计金额,申请单号,详细信息" as="geometry"/>
</mxCell>
</Shape>
<Shape label="结束" href="" id="3">
<mxCell style="doubleEllipse;fillColor=#3cb208" parent="1" vertex="1">
<mxGeometry x="950" y="170" width="40" height="40" StepID="3" StepName="结束" ProcessGUID="" StepType="3" StepGUID="" AuditorType="4" AuditorGUID="2A3EF8D4-5B70-401B-AF6F-D3A58EEDB6FE" AuditorName="[发起人]" AuditorNameCC="" AuditorNameCCGUID="" IsCanAssign="0" IsMulti="0" IsCanRevolution="0" IsCanClose="0" IsCanRollBack="0" IsCanCancel="0" Description="" DispBusinessDomain="" EditBusinessDomain="" as="geometry"/>
</mxCell>
</Shape>
<Roundrect label="大于6000审批" href="" id="5">
<mxCell style="rounded" vertex="1" parent="1">
<mxGeometry x="440" y="70" width="90" height="40" ProcessGUID="" StepID="5" StepName="大于6000审批" StepType="1" StepGUID="" AuditorType="5" AuditorGUID="b09841aa-56e6-4635-abcc-df35ed9dc2bb" AuditorName="熊培" AuditorNameCC="" AuditorNameCCGUID="" IsCanAssign="1" IsMulti="0" IsCanRevolution="1" IsCanClose="0" IsCanRollBack="1" IsCanCancel="1" Description="" DispBusinessDomain="" EditBusinessDomain="物品名称,规格,申购数,预计单价,小计金额,申请单号,详细信息" as="geometry"/>
</mxCell>
</Roundrect>
<Roundrect label="步骤三审批" href="" id="6">
<mxCell style="rounded" vertex="1" parent="1">
<mxGeometry x="440" y="170" width="90" height="40" ProcessGUID="" StepID="6" StepName="步骤三审批" StepType="1" StepGUID="" AuditorType="5" AuditorGUID="f1d46c9b-132c-4482-9c10-a00d7d50675a" AuditorName="王永豪" AuditorNameCC="" AuditorNameCCGUID="" IsCanAssign="1" IsMulti="0" IsCanRevolution="1" IsCanClose="0" IsCanRollBack="1" IsCanCancel="1" Description="" DispBusinessDomain="" EditBusinessDomain="" as="geometry"/>
</mxCell>
</Roundrect>
<Roundrect label="大于等于十万" href="" id="7">
<mxCell style="rounded" vertex="1" parent="1">
<mxGeometry x="440" y="250" width="100" height="40" ProcessGUID="" StepID="7" StepName="大于等于十万" StepType="1" StepGUID="" AuditorType="5" AuditorGUID="b502071b-7c7c-4fc3-a879-6c55a01a1703" AuditorName="蒋若兰" AuditorNameCC="" AuditorNameCCGUID="" IsCanAssign="1" IsMulti="0" IsCanRevolution="1" IsCanClose="0" IsCanRollBack="1" IsCanCancel="1" Description="" DispBusinessDomain="" EditBusinessDomain="申购单位,希望完成日期,单号,预计金额" as="geometry"/>
</mxCell>
</Roundrect>
<Shape label="主任审批" href="" id="8">
<mxCell style="rhombus" vertex="1" parent="1">
<mxGeometry x="680" y="160" width="60" height="60" ProcessGUID="" StepID="8" StepName="主任审批" StepGUID="" AuditorType="5" AuditorGUID="5f3c3bb2-bd0b-47c8-8da1-48a053aabf96" AuditorName="郭依恒" AuditorNameCC="" AuditorNameCCGUID="" IsCanAssign="1" IsMulti="0" IsCanRevolution="1" IsCanClose="0" IsCanRollBack="1" IsCanCancel="1" Description="" DispBusinessDomain="" EditBusinessDomain="" StepType="1" as="geometry"/>
</mxCell>
</Shape>
<Shape label="步骤二" href="" id="9">
<mxCell style="rhombus" vertex="1" parent="1">
<mxGeometry x="230" y="160" width="60" height="60" ProcessGUID="" StepID="9" StepName="步骤二" StepGUID="" AuditorType="5" AuditorGUID="02d45162-6f7a-464f-94f6-a661f2ef97bd" AuditorName="张超" AuditorNameCC="" AuditorNameCCGUID="" IsCanAssign="1" IsMulti="0" IsCanRevolution="1" IsCanClose="0" IsCanRollBack="1" IsCanCancel="1" Description="" DispBusinessDomain="" EditBusinessDomain="申购单位,希望完成日期,单号,预计金额,物品名称,规格,申购数,预计单价,小计金额,申请单号,详细信息" StepType="1" as="geometry"/>
</mxCell>
</Shape>
<Connector label="" isconnctor="true" href="" id="10">
<mxCell style="straightConnector" edge="1" parent="1" source="2" target="9">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain/&gt;&lt;opr/&gt;&lt;value/&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;" as="geometry"/>
</mxCell>
</Connector>
<Connector label="预计金额大于6000" isconnctor="true" href="" id="11">
<mxCell edge="1" parent="1" source="9" target="5">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="[预计金额]大于6000" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain&gt;[预计金额]&lt;/domain&gt;&lt;opr&gt;大于&lt;/opr&gt;&lt;value&gt;6000&lt;/value&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;&#xa;" as="geometry"/>
</mxCell>
</Connector>
<Connector label="" isconnctor="true" href="" id="12">
<mxCell edge="1" parent="1" source="9" target="6">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain/&gt;&lt;opr/&gt;&lt;value/&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;" as="geometry"/>
</mxCell>
</Connector>
<Connector label="预计金额大于等于十万" isconnctor="true" href="" id="13">
<mxCell edge="1" parent="1" source="9" target="7">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="[预计金额]大于等于100000" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain&gt;[预计金额]&lt;/domain&gt;&lt;opr&gt;大于等于&lt;/opr&gt;&lt;value&gt;100000&lt;/value&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;&#xa;" as="geometry"/>
</mxCell>
</Connector>
<Connector label="" isconnctor="true" href="" id="14">
<mxCell edge="1" parent="1" source="5" target="8">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain/&gt;&lt;opr/&gt;&lt;value/&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;" as="geometry"/>
</mxCell>
</Connector>
<Connector label="" isconnctor="true" href="" id="15">
<mxCell edge="1" parent="1" source="6" target="8">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain/&gt;&lt;opr/&gt;&lt;value/&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;" as="geometry"/>
</mxCell>
</Connector>
<Connector label="" isconnctor="true" href="" id="16">
<mxCell edge="1" parent="1" source="7" target="8">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain/&gt;&lt;opr/&gt;&lt;value/&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;" as="geometry"/>
</mxCell>
</Connector>
<Connector label="" isconnctor="true" href="" id="17">
<mxCell style="straightConnector" edge="1" parent="1" source="8" target="3">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain/&gt;&lt;opr/&gt;&lt;value/&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;" as="geometry"/>
</mxCell>
</Connector>
<Connector label="合计大于五十万" isconnctor="true" href="" id="19">
<mxCell edge="1" parent="1" source="2" target="8">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="[合计]大于500000" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain&gt;[合计]&lt;/domain&gt;&lt;opr&gt;大于&lt;/opr&gt;&lt;value&gt;500000&lt;/value&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;&#xa;" as="geometry">
<Array as="points">
<mxPoint x="110" y="370"/>
</Array>
</mxGeometry>
</mxCell>
</Connector>
<Connector label="单号等于administrator" isconnctor="true" href="" id="20">
<mxCell edge="1" parent="1" source="9" target="3">
<mxGeometry relative="1" ProcessGUID="" Source="" Target="" StartStepGUID="" EndStepGUID="" Expression="[单号]等于administrator" ExpressionStru="&lt;ExpressionStru&gt;&lt;filter&gt;&lt;leftparenthesis/&gt;&lt;domain&gt;[单号]&lt;/domain&gt;&lt;opr&gt;等于&lt;/opr&gt;&lt;value&gt;administrator&lt;/value&gt;&lt;rightparenthesis/&gt;&lt;logic/&gt;&lt;/filter&gt;&lt;/ExpressionStru&gt;&#xa;" as="geometry">
<Array as="points">
<mxPoint x="290" y="410"/>
</Array>
</mxGeometry>
</mxCell>
</Connector>
</root>
</mxGraphModel>
以上是流程图的描述信息,下面要建我们在后台可以解析的文件
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="mxGraphModel">
</xsl:template>
<xsl:template match="mxGraphModel">
<ProcessModel keyvalue="">
<!--流程基本信息-->
<Processs>
<Attributes>
<ProcessGUID></ProcessGUID>
<ProcessKindGUID></ProcessKindGUID>
<ProcessKindName></ProcessKindName>
<ProcessName></ProcessName>
<IsActive></IsActive>
<WatchMembers></WatchMembers>
<WatchMembersName></WatchMembersName>
<Description></Description>
<BusinessType></BusinessType>
<BusinessURL></BusinessURL>
<ReportURL></ReportURL>
<ProcessQueryDomain></ProcessQueryDomain>
<ProcessGrap></ProcessGrap>
<StationGUID></StationGUID>
</Attributes>
</Processs>
<!--步骤信息-->
<Steps>
<xsl:for-each select="root/Shape|root/Rect|root/Roundrect">
<Step>
<Attributes>
<StepGUID>
</StepGUID>
<NextStepGUID>
</NextStepGUID>
<StepName>
<xsl:value-of select="@label"/>
</StepName>
<StepID>
<xsl:value-of select="@id"/>
</StepID>
<StepType>
<xsl:choose>
<xsl:when test="@label='开始'">0</xsl:when>
<xsl:when test="@label='结束'">3</xsl:when>
<xsl:otherwise>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@StepType"></xsl:value-of>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</StepType>
<IsMulti>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@IsMulti"></xsl:value-of>
</xsl:for-each>
</IsMulti>
<ProcessGUID/>
<IsCanRollBack>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@IsCanRollBack"></xsl:value-of>
</xsl:for-each>
</IsCanRollBack>
<IsCanCancel>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@IsCanCancel"></xsl:value-of>
</xsl:for-each>
</IsCanCancel>
<IsCanAssign>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@IsCanAssign"></xsl:value-of>
</xsl:for-each>
</IsCanAssign>
<IsCanRevolution>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@IsCanRevolution"></xsl:value-of>
</xsl:for-each>
</IsCanRevolution>
<IsCanClose>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@IsCanClose"></xsl:value-of>
</xsl:for-each>
</IsCanClose>
<Description>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@Description"></xsl:value-of>
</xsl:for-each>
</Description>
<DispBusinessDomain>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@DispBusinessDomain"></xsl:value-of>
</xsl:for-each>
</DispBusinessDomain>
<EditBusinessDomain>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@EditBusinessDomain"></xsl:value-of>
</xsl:for-each>
</EditBusinessDomain>
<AuditorNameCC>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@AuditorNameCC"></xsl:value-of>
</xsl:for-each>
</AuditorNameCC>
<AuditorNameCCGUID>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@AuditorNameCCGUID"></xsl:value-of>
</xsl:for-each>
</AuditorNameCCGUID>
</Attributes>
<Brands>
<Band>
<Attributes>
<BandGUID></BandGUID>
<ProcessGUID>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@y"></xsl:value-of>
</xsl:for-each>
</ProcessGUID>
<StepGUID>
<xsl:value-of select="Shape|Rect/mxCell/mxGeometry[@x]"></xsl:value-of>
</StepGUID>
<AuditorName>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@AuditorName"></xsl:value-of>
</xsl:for-each>
</AuditorName>
<AuditorGUID>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@AuditorGUID"></xsl:value-of>
</xsl:for-each>
</AuditorGUID>
<AuditorType>
<xsl:for-each select="mxCell/mxGeometry">
<xsl:value-of select="@AuditorType"></xsl:value-of>
</xsl:for-each>
</AuditorType>
</Attributes>
</Band>
</Brands>
</Step>
</xsl:for-each>
</Steps>
<!--步骤关系信息-->
<Connectors>
<xsl:for-each select="root/Connector">
<Relation>
<Attributes>
<StepGUID>
<xsl:for-each select="mxCell">
<xsl:value-of select="@source"></xsl:value-of>
</xsl:for-each>
</StepGUID>
<NextStepGUID>
<xsl:for-each select="mxCell">
<xsl:value-of select="@target"></xsl:value-of>
</xsl:for-each>
</NextStepGUID>
<Expression/>
<IsActive/>
<ProcessGUID/>
<ExpressionStru/>
<RelationGUID/>
<Position/>
</Attributes>
</Relation>
</xsl:for-each>
</Connectors>
</ProcessModel>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>