Eclipse如何打开BPMN文件--Eclipse安装Activiti插件详解

项目场景:

最近在项目中使用到了Activiti工作流,需要编辑Test.bpmn流程图。


问题描述

但是拿到Test.bpmn文件之后选择直接打开发现全是代码,不是直观的图形界面。

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="Test" name="我的测试流程" isExecutable="true" isClosed="false" processType="None">
    <userTask id="ECThreeManagerApproval" name="三级经理审批" activiti:assignee="${staffId}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="#{ElectronicChannelCreateTaskListener}"></activiti:taskListener>
        <activiti:taskListener event="complete" delegateExpression="#{ElectronicChannelCompleteTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="ECDemandInterfacePersonAssign" name="二级经理审批" activiti:assignee="${staffId}">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="#{ElectronicChannelCreateTaskListener}"></activiti:taskListener>
        <activiti:taskListener event="complete" delegateExpression="#{ElectronicChannelCompleteTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <endEvent id="ECEnd" name="结束">
      <extensionElements>
        <activiti:executionListener event="end" delegateExpression="#{ElectronicChannelEndTaskListener}"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <sequenceFlow id="flow12" sourceRef="ECThreeManagerApproval" targetRef="ECDemandInterfacePersonAssign">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${verify=='ECDemandInterfacePersonAssign'}]]></conditionExpression>
    </sequenceFlow>
    <startEvent id="ECStart" name="开始"></startEvent>
    <userTask id="ECResponsibleManDistribute" name="三级经理审批">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="#{ElectronicChannelCreateTaskListener}"></activiti:taskListener>
        <activiti:taskListener event="complete" delegateExpression="#{ElectronicChannelCompleteTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow18" sourceRef="ECDemandInterfacePersonAssign" targetRef="ECResponsibleManDistribute">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${verify=='ECResponsibleManDistribute'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow21" sourceRef="ECStart" targetRef="ECThreeManagerApproval">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${verify=='ECThreeManagerApproval'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow25" sourceRef="ECResponsibleManDistribute" targetRef="ECEnd">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${verify=='ECEnd'}]]></conditionExpression>
    </sequenceFlow>
    <userTask id="ECDemandProposerClose" name="发起人关闭工单">
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="#{ElectronicChannelCreateTaskListener}"></activiti:taskListener>
        <activiti:taskListener event="complete" delegateExpression="#{ElectronicChannelCompleteTaskListener}"></activiti:taskListener>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow26" sourceRef="ECThreeManagerApproval" targetRef="ECDemandProposerClose">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${verify=='ECDemandProposerClose'}]]></conditionExpression>
    </sequenceFlow>
    <endEvent id="ECRejectEnd" name="驳回结束">
      <extensionElements>
        <activiti:executionListener event="end" delegateExpression="#{ElectronicChannelEndTaskListener}"></activiti:executionListener>
      </extensionElements>
    </endEvent>
    <sequenceFlow id="flow27" sourceRef="ECDemandProposerClose" targetRef="ECRejectEnd">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${verify=='ECRejectEnd'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow28" sourceRef="ECResponsibleManDistribute" targetRef="ECDemandProposerClose">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${verify=='ECDemandProposerClose'}]]></conditionExpression>
    </sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_Test">
    <bpmndi:BPMNPlane bpmnElement="Test" id="BPMNPlane_Test">
      <bpmndi:BPMNShape bpmnElement="ECThreeManagerApproval" id="BPMNShape_ECThreeManagerApproval">
        <omgdc:Bounds height="65.0" width="145.0" x="410.0" y="185.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="ECDemandInterfacePersonAssign" id="BPMNShape_ECDemandInterfacePersonAssign">
        <omgdc:Bounds height="71.0" width="131.0" x="630.0" y="182.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="ECEnd" id="BPMNShape_ECEnd">
        <omgdc:Bounds height="35.0" width="35.0" x="1100.0" y="200.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="ECStart" id="BPMNShape_ECStart">
        <omgdc:Bounds height="35.0" width="35.0" x="290.0" y="200.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="ECResponsibleManDistribute" id="BPMNShape_ECResponsibleManDistribute">
        <omgdc:Bounds height="66.0" width="121.0" x="840.0" y="185.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="ECDemandProposerClose" id="BPMNShape_ECDemandProposerClose">
        <omgdc:Bounds height="55.0" width="145.0" x="410.0" y="80.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="ECRejectEnd" id="BPMNShape_ECRejectEnd">
        <omgdc:Bounds height="35.0" width="35.0" x="465.0" y="0.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
        <omgdi:waypoint x="555.0" y="217.0"></omgdi:waypoint>
        <omgdi:waypoint x="630.0" y="217.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
        <omgdi:waypoint x="761.0" y="217.0"></omgdi:waypoint>
        <omgdi:waypoint x="840.0" y="218.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow21" id="BPMNEdge_flow21">
        <omgdi:waypoint x="325.0" y="217.0"></omgdi:waypoint>
        <omgdi:waypoint x="410.0" y="217.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow25" id="BPMNEdge_flow25">
        <omgdi:waypoint x="961.0" y="218.0"></omgdi:waypoint>
        <omgdi:waypoint x="1100.0" y="217.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow26" id="BPMNEdge_flow26">
        <omgdi:waypoint x="482.0" y="185.0"></omgdi:waypoint>
        <omgdi:waypoint x="482.0" y="135.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow27" id="BPMNEdge_flow27">
        <omgdi:waypoint x="482.0" y="80.0"></omgdi:waypoint>
        <omgdi:waypoint x="482.0" y="35.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow28" id="BPMNEdge_flow28">
        <omgdi:waypoint x="900.0" y="185.0"></omgdi:waypoint>
        <omgdi:waypoint x="900.0" y="107.0"></omgdi:waypoint>
        <omgdi:waypoint x="555.0" y="107.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

原因分析:

经过研究发现BPMN文件如果没有相应软件或者编辑器直接打开的话会显示其源码,通过查阅资料得知此类工具也比较多,在此仅跟大家分享一下其中一种方案:使用Eclipse打开BPMN文件


解决方案:

1.在电脑上安装Eclipse工具(不再详细介绍)
2.安装好Eclipse工具之后,只需要安装Activiti BPMN 2.0 designer插件就可以了
具体操作步骤如下:
在Eclipse的菜单中打开
help -> install new software…:
单击add
Name: Activiti BPMN 2.0 designer
Location: http://activiti.org/designer/update/
点击OK

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

最终效果:

安装好Activiti插件之后再把Test.bpmn复制到Eclipse中来打开,就可以看到图形界面啦~
在这里插入图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这是 activiti-bpmn-layout-5.22.0 的 pom.xml 文件内容: ``` <project> <modelVersion>4.0.0</modelVersion> <groupId>org.activiti</groupId> <artifactId>activiti-bpmn-layout</artifactId> <version>5.22.0</version> <packaging>jar</packaging> <name>Activiti BPMN Layout</name> <description>Layout algorithms for BPMN 2.0 diagrams</description> <dependencies> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-bpmn-model</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.4</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.5</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <mainClass>${main.class}</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build> </project> ``` 该 pom.xml 文件定义了项目的基本信息,包括: - 项目的 groupId、artifactId 和 version; - 项目的名称和描述; - 项目依赖的其他库(activiti-bpmn-model、commons-lang3 和 slf4j-api); - 项目的构建配置,包括编译器版本、打包方式和插件

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值