日韩成人免费在线_国产成人一二_精品国产免费人成电影在线观..._日本一区二区三区久久久久久久久不

當(dāng)前位置:首頁 > 科技  > 軟件

探索BPMN—工作流技術(shù)的理論與實(shí)踐

來源: 責(zé)編: 時(shí)間:2024-07-19 07:59:43 605觀看
導(dǎo)讀一、前言19世紀(jì)70年代,流程管理思想萌芽階段。怎樣提高工作效率?泰勒:標(biāo)準(zhǔn)化個(gè)人操作流程亨利·福特:規(guī)定標(biāo)準(zhǔn)時(shí)間定額標(biāo)準(zhǔn)化、精簡(jiǎn)化、通用化、專業(yè)化。20世紀(jì)70年代,工作流技術(shù)起源于辦公自動(dòng)化領(lǐng)域的研究。由于當(dāng)時(shí)計(jì)算

一、前言

  • 19世紀(jì)70年代,流程管理思想萌芽階段。怎樣提高工作效率?泰勒:標(biāo)準(zhǔn)化個(gè)人操作流程亨利·福特:規(guī)定標(biāo)準(zhǔn)時(shí)間定額標(biāo)準(zhǔn)化、精簡(jiǎn)化、通用化、專業(yè)化。
  • 20世紀(jì)70年代,工作流技術(shù)起源于辦公自動(dòng)化領(lǐng)域的研究。由于當(dāng)時(shí)計(jì)算機(jī)尚未普及,網(wǎng)絡(luò)技術(shù)水平還很低以及理論基礎(chǔ)匱乏,這項(xiàng)新技術(shù)并未取得成功,許多公司采用紙張表單,手工傳遞的方式,一級(jí)一級(jí)審批簽字,工作效率非常低下。
  • 20世紀(jì)90年代,信息技術(shù)驅(qū)動(dòng)流程自動(dòng)化階段。信息技術(shù)開始引入管理領(lǐng)域,對(duì)傳統(tǒng)的業(yè)務(wù)進(jìn)行自動(dòng)化改造。產(chǎn)品:Sabre訂票系統(tǒng),MRP(物料需求計(jì)劃),MIS(管理信息系統(tǒng)),CIMS(計(jì)算機(jī)集成制造系統(tǒng))。
  • 21世紀(jì)初,BPM管理與治理結(jié)合。BPR/BPI:以信息技術(shù)為核心重新設(shè)計(jì)業(yè)務(wù)流程,失敗率高達(dá)50%-70%;BPM:以業(yè)務(wù)流程為主導(dǎo)的管理思想;BPM治理思想:對(duì)BPM實(shí)施的成功率以及ROI的高要求,強(qiáng)調(diào)BPM與企業(yè)戰(zhàn)略相結(jié)合。

二、BPMN介紹

BPMN(Business Process Modeling Notation,業(yè)務(wù)流程建模符號(hào))是一種用于描述業(yè)務(wù)流程的標(biāo)準(zhǔn)化建模語言。它通過圖形符號(hào)及規(guī)則,幫助企業(yè)建模、分析和優(yōu)化各種業(yè)務(wù)流程。BPMN有兩個(gè)主要版本:BPMN 1.0和BPMN 2.0。BPMN 1.0規(guī)范由標(biāo)準(zhǔn)組織BPMI(后并入到OMG)于2004年5月發(fā)布;BPMN 2.0標(biāo)準(zhǔn)由OMG于2011年推出。zxN28資訊網(wǎng)——每日最新資訊28at.com

2.0相對(duì)于1.0規(guī)范了流程引擎的語義和格式,利用標(biāo)準(zhǔn)的圖元描述真實(shí)的業(yè)務(wù)發(fā)生過程,保證相同的流程在不同的流程引擎中得到一致的執(zhí)行結(jié)果。zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

BPMN的理論基礎(chǔ)

zxN28資訊網(wǎng)——每日最新資訊28at.com

  • 流程建模:BPMN使用不同的圖形符號(hào)來表示業(yè)務(wù)流程中的各項(xiàng)活動(dòng)、任務(wù)、決策和事件等。這些符號(hào)包括任務(wù)、網(wǎng)關(guān)、事件等,每個(gè)符號(hào)都有特定的含義和用法。
  • 流程分析:通過BPMN模型,企業(yè)可以分析業(yè)務(wù)流程的效率、資源利用率和風(fēng)險(xiǎn)等,以便進(jìn)行優(yōu)化和改進(jìn)。
  • 流程執(zhí)行:BPMN不僅是一種建模語言,還可以將建模的業(yè)務(wù)流程實(shí)際執(zhí)行起來,并進(jìn)行監(jiān)控和控制。

zxN28資訊網(wǎng)——每日最新資訊28at.com

BPMN的優(yōu)勢(shì)

zxN28資訊網(wǎng)——每日最新資訊28at.com

圖片圖片zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

傳統(tǒng)使用場(chǎng)景

zxN28資訊網(wǎng)——每日最新資訊28at.com

  • 采購(gòu)流程:通過BPMN建模,企業(yè)可以規(guī)范采購(gòu)流程,包括需求確認(rèn)、供應(yīng)商選擇、合同簽訂、物品收貨等環(huán)節(jié),提高采購(gòu)效率。
  • 請(qǐng)假審批流程:BPMN模型可以幫助企業(yè)規(guī)范請(qǐng)假審批流程,包括員工請(qǐng)假申請(qǐng)、直屬主管審批、人力資源部門審批等環(huán)節(jié),減少誤差和糾紛。
  • 客戶投訴處理流程:利用BPMN,企業(yè)可以清晰地展示客戶投訴處理流程,包括客戶投訴登記、處理人員分配、處理過程跟蹤、客戶反饋等環(huán)節(jié),提高客戶滿意度。

三、實(shí)踐舉例:XX平臺(tái)XXX商家合規(guī)治理任務(wù)優(yōu)化項(xiàng)目(非真實(shí)場(chǎng)景)

zxN28資訊網(wǎng)——每日最新資訊28at.com

背景目標(biāo)

zxN28資訊網(wǎng)——每日最新資訊28at.com

  • 商家合規(guī)治理手段的單一性和對(duì)線下人工的過度依賴方面需要優(yōu)化,通過整合商家合規(guī)治理策略,并實(shí)現(xiàn)這些策略的可在線化配置。這一舉措將打破傳統(tǒng)的手工操作模式,允許業(yè)務(wù)方直接在系統(tǒng)中配置和更新治理策略,減少人工干預(yù),提高治理效率。同時(shí),在線化配置也便于策略的快速部署和靈活調(diào)整,以應(yīng)對(duì)不同業(yè)務(wù)場(chǎng)景下的合規(guī)要求。
  • 各商家的合規(guī)治理進(jìn)度和狀態(tài)的透明度方面需要優(yōu)化,為改變這一現(xiàn)狀,我們需要搭建一套高效的工作流引擎。該引擎將支持商家合規(guī)治理流程的編排和自動(dòng)化流轉(zhuǎn),從任務(wù)觸發(fā)到完成審核、記錄反饋等各個(gè)環(huán)節(jié)都將實(shí)現(xiàn)自動(dòng)化處理。同時(shí),內(nèi)置的進(jìn)度跟蹤機(jī)制將確保業(yè)務(wù)團(tuán)隊(duì)能夠?qū)崟r(shí)查看各商家的治理進(jìn)度,及時(shí)發(fā)現(xiàn)問題并采取相應(yīng)措施。這將大大提高治理的透明度和可控性。
  • 評(píng)估治理成果和手段的有效性分析方面需要優(yōu)化,將合規(guī)治理成果的數(shù)據(jù)可視化,通過強(qiáng)大的數(shù)據(jù)分析與可視化系統(tǒng),我們將關(guān)鍵指標(biāo)(如治理效率、違規(guī)率、改進(jìn)情況等)以圖表、報(bào)告等形式直觀展現(xiàn)。同時(shí),通過持續(xù)的數(shù)據(jù)分析與改進(jìn)循環(huán),我們將逐步優(yōu)化治理策略和方式,最終形成商家合規(guī)治理的閉環(huán)機(jī)制。

zxN28資訊網(wǎng)——每日最新資訊28at.com

方案

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

業(yè)務(wù)流程

治理流程1治理流程1zxN28資訊網(wǎng)——每日最新資訊28at.com

治理流程2治理流程2zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

系統(tǒng)架構(gòu)圖

流程編排流程編排zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

工作流技術(shù)選型工作流技術(shù)選型zxN28資訊網(wǎng)——每日最新資訊28at.com

圖片圖片zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

SmartEngine詳細(xì)介紹

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

  E-R圖

圖片圖片zxN28資訊網(wǎng)——每日最新資訊28at.com

CREATE TABLE `se_deployment_instance` (  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'PK'  ,  `gmt_create` datetime(6) NOT NULL   COMMENT 'create time' ,  `gmt_modified` datetime(6) NOT NULL  COMMENT 'modification time'  ,  `process_definition_id` varchar(255) NOT NULL  COMMENT 'process definition id'  ,  `process_definition_version` varchar(255) DEFAULT NULL  COMMENT 'process definition version'  ,  `process_definition_type` varchar(255) DEFAULT NULL  COMMENT 'process definition type'  ,  `process_definition_code` varchar(255) DEFAULT NULL  COMMENT 'process definition code'  ,  `process_definition_name` varchar(255) DEFAULT NULL  COMMENT 'process definition name'  ,  `process_definition_desc` varchar(255) DEFAULT NULL  COMMENT 'process definition desc'  ,  `process_definition_content` mediumtext NOT NULL  COMMENT 'process definition content'  ,  `deployment_user_id` varchar(128) NOT NULL  COMMENT 'deployment user id' ,  `deployment_status` varchar(64) NOT NULL   COMMENT 'deployment status' ,  `logic_status` varchar(64) NOT NULL  COMMENT 'logic status' ,  PRIMARY KEY (`id`)) COMMENT='流程定義表' ;CREATE TABLE `se_process_instance` (  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT  COMMENT 'PK'  ,  `gmt_create` datetime(6) NOT NULL  COMMENT 'create time' ,  `gmt_modified` datetime(6) NOT NULL  COMMENT 'modification time' ,  `process_definition_id_and_version` varchar(128) NOT NULL  COMMENT 'process definition id and version'  ,  `process_definition_type` varchar(255) DEFAULT NULL COMMENT 'process definition type'  ,  `status` varchar(64) NOT NULL COMMENT ' 1.running 2.completed 3.aborted',  `parent_process_instance_id` bigint(20) unsigned DEFAULT NULL   COMMENT 'parent process instance id' ,  `parent_execution_instance_id` bigint(20) unsigned DEFAULT NULL   COMMENT 'parent execution instance id' ,  `start_user_id` varchar(128) DEFAULT NULL  COMMENT 'start user id' ,  `biz_unique_id` varchar(255) DEFAULT NULL  COMMENT 'biz unique id' ,  `reason` varchar(255) DEFAULT NULL   COMMENT 'reason' ,  `comment` varchar(255) DEFAULT NULL   COMMENT 'comment' ,  `title` varchar(255) DEFAULT NULL  COMMENT 'title' ,  `tag` varchar(255) DEFAULT NULL  COMMENT 'tag' ,  PRIMARY KEY (`id`)) COMMENT='流程實(shí)例表' ;CREATE TABLE `se_activity_instance` (  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT  COMMENT 'PK'  ,  `gmt_create` datetime(6) NOT NULL   COMMENT 'create time' ,  `gmt_modified` datetime(6) NOT NULL  COMMENT 'modification time'  ,  `process_instance_id` bigint(20) unsigned DEFAULT NULL  COMMENT 'process instance id'  ,  `process_definition_id_and_version` varchar(255) NOT NULL  COMMENT 'process definition id and version'  ,  `process_definition_activity_id` varchar(64) NOT NULL COMMENT 'process definition activity id'   ,  PRIMARY KEY (`id`)) COMMENT='活動(dòng)節(jié)點(diǎn)實(shí)例表' ;CREATE TABLE `se_task_instance` (  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT  COMMENT 'PK'  ,  `gmt_create` datetime(6) NOT NULL   COMMENT 'create time' ,  `gmt_modified` datetime(6) NOT NULL  COMMENT 'modification time'  ,  `process_instance_id` bigint(20) unsigned NOT NULL  COMMENT 'process instance id'  ,  `process_definition_id_and_version` varchar(128) DEFAULT NULL  COMMENT 'process definition id and version'  ,  `process_definition_type` varchar(255) DEFAULT NULL  COMMENT 'process definition type'  ,  `activity_instance_id` bigint(20) unsigned NOT NULL   COMMENT 'activity instance id' ,  `process_definition_activity_id` varchar(255) NOT NULL  COMMENT 'process definition activity id' ,  `execution_instance_id` bigint(20) unsigned NOT NULL  COMMENT 'execution instance id'  ,  `claim_user_id` varchar(255) DEFAULT NULL   COMMENT 'claim user id' ,  `title` varchar(255) DEFAULT NULL COMMENT 'title'   ,  `priority` int(11) DEFAULT 500 COMMENT 'priority' ,  `tag` varchar(255) DEFAULT NULL  COMMENT 'tag'  ,  `claim_time` datetime(6) DEFAULT NULL COMMENT 'claim time'   ,  `complete_time` datetime(6) DEFAULT NULL COMMENT 'complete time'   ,  `status` varchar(255) NOT NULL COMMENT 'status'     ,  `comment` varchar(255) DEFAULT NULL  COMMENT 'comment'  ,  `extension` varchar(255) DEFAULT NULL COMMENT 'extension'  ,  PRIMARY KEY (`id`)) COMMENT='人工任務(wù)節(jié)點(diǎn)實(shí)例表'  ;CREATE TABLE `se_task_assignee_instance` (  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT  COMMENT 'PK'  ,  `gmt_create` datetime(6) NOT NULL  COMMENT 'create time'  ,  `gmt_modified` datetime(6) NOT NULL   COMMENT 'modification time' ,  `process_instance_id` bigint(20) unsigned NOT NULL  COMMENT 'process instance id'  ,  `task_instance_id` bigint(20) unsigned NOT NULL  COMMENT 'task instance id'  ,  `assignee_id` varchar(255) NOT NULL  COMMENT 'assignee id'  ,  `assignee_type` varchar(128) NOT NULL  COMMENT 'assignee type'  ,  PRIMARY KEY (`id`)) COMMENT='人工任務(wù)節(jié)點(diǎn)代理人實(shí)例表'  ;CREATE TABLE `se_execution_instance` (  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'PK'   ,  `gmt_create` datetime(6) NOT NULL   COMMENT 'create time' ,  `gmt_modified` datetime(6) NOT NULL  COMMENT 'modification time'  ,  `process_instance_id` bigint(20) unsigned NOT NULL  COMMENT 'process instance id'  ,  `process_definition_id_and_version` varchar(255) NOT NULL  COMMENT 'process definition id and version'  ,  `process_definition_activity_id` varchar(255) NOT NULL COMMENT 'process definition activity id'   ,  `activity_instance_id` bigint(20) unsigned NOT NULL COMMENT 'activity instance id'   ,  `active` tinyint(4) NOT NULL COMMENT '1:active 0:inactive',  PRIMARY KEY (`id`)) COMMENT='執(zhí)行節(jié)點(diǎn)實(shí)例表-最細(xì)粒度的實(shí)例'   ;CREATE TABLE `se_variable_instance` (  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT  COMMENT 'PK'  ,  `gmt_create` datetime(6) NOT NULL  COMMENT 'create time'  ,  `gmt_modified` datetime(6) NOT NULL  COMMENT 'modification time'  ,  `process_instance_id` bigint(20) unsigned NOT NULL   COMMENT 'process instance id' ,  `execution_instance_id` bigint(20) unsigned DEFAULT NULL   COMMENT 'execution instance id' ,  `field_key` varchar(128) NOT NULL   COMMENT 'field key' ,  `field_type` varchar(128) NOT NULL   COMMENT 'field type' ,  `field_double_value` decimal(65,30) DEFAULT NULL   COMMENT 'field double value' ,  `field_long_value` bigint(20) DEFAULT NULL  COMMENT 'field long value'  ,  `field_string_value` varchar(4000) DEFAULT NULL  COMMENT 'field string value' ,  PRIMARY KEY (`id`)) COMMENT='執(zhí)行節(jié)點(diǎn)變量量表' ;

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

代碼實(shí)操

第一步,要選擇正確的SmartEngine版本,將其添加到pom依賴中。zxN28資訊網(wǎng)——每日最新資訊28at.com

<dependency>zxN28資訊網(wǎng)——每日最新資訊28at.com

  <groupld>com.alibaba.smart.framework</groupld>zxN28資訊網(wǎng)——每日最新資訊28at.com

  <artifactld>smart-engine-extension-storage-custom</artifactld>zxN28資訊網(wǎng)——每日最新資訊28at.com

  <version>3.0.0</version>zxN28資訊網(wǎng)——每日最新資訊28at.com

</dependency>zxN28資訊網(wǎng)——每日最新資訊28at.com

第二步,完成SmartEngine初始化。在初始化時(shí),一般要加載流程定義到應(yīng)用中。集群情況下,要注意流程定義的一致性(如果純靜態(tài)記載則無此類問題)。在初始化時(shí),可以根據(jù)需要定義Bean的加載優(yōu)先級(jí)。zxN28資訊網(wǎng)——每日最新資訊28at.com

import com.alibaba.smart.framework.engine.SmartEngine;import com.alibaba.smart.framework.engine.configuration.InstanceAccessor;import com.alibaba.smart.framework.engine.configuration.ProcessEngineConfiguration;import com.alibaba.smart.framework.engine.configuration.impl.DefaultProcessEngineConfiguration;import com.alibaba.smart.framework.engine.configuration.impl.DefaultSmartEngine;import com.alibaba.smart.framework.engine.exception.EngineException;import com.alibaba.smart.framework.engine.service.command.RepositoryCommandService;import com.alibaba.smart.framework.engine.util.IOUtil;import org.springframework.beans.BeansException;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;import org.springframework.context.ApplicationContext;import org.springframework.context.ApplicationContextAware;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.core.annotation.Order;import org.springframework.core.io.Resource;import org.springframework.core.io.support.PathMatchingResourcePatternResolver;import java.io.InputStream;import static org.springframework.core.Ordered.LOWEST_PRECEDENCE;@Order(LOWEST_PRECEDENCE)@Configuration@ConditionalOnClass(SmartEngine.class)public class SmartEngineAutoConfiguration implements ApplicationContextAware {    private ApplicationContext applicationContext;    @Bean    @ConditionalOnMissingBean    public SmartEngine constructSmartEngine() {        ProcessEngineConfiguration processEngineConfiguration = new DefaultProcessEngineConfiguration();        // 實(shí)現(xiàn)InstanceAccessor接口        processEngineConfiguration.setInstanceAccessor(new CustomInstanceAccessService());        SmartEngine smartEngine = new DefaultSmartEngine();        smartEngine.init(processEngineConfiguration);        // 加載流程定義        deployProcessDefinition(smartEngine);        return smartEngine;    }    @Override    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {        this.applicationContext = applicationContext;    }    private class CustomInstanceAccessService implements InstanceAccessor {        @Override        public Object access(String name) {            return applicationContext.getBean(name);        }    }    private void deployProcessDefinition(SmartEngine smartEngine) {        RepositoryCommandService repositoryCommandService = smartEngine                .getRepositoryCommandService();        PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();        try {            Resource[] resources = resolver.getResources("classpath*:/smart-engine/*.xml");            for (Resource resource : resources) {                InputStream inputStream = resource.getInputStream();                repositoryCommandService.deploy(inputStream);                IOUtil.closeQuietly(inputStream);            }        } catch (Exception e) {            throw new EngineException(e);        }    }}

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

BMPN2.0 xml舉例

zxN28資訊網(wǎng)——每日最新資訊28at.com

附言:排他網(wǎng)關(guān)的條件表達(dá)式是跟著線條綁定的,要自己確保條件的是和否加在一起的總概率是100%,如果不是100%,小概率執(zhí)行節(jié)點(diǎn)會(huì)卡在排他網(wǎng)關(guān)走不下去。例如:線條“否”的條件表達(dá)式為:條件1為假且條件2為假,線條“是”的條件表達(dá)式為條件1為真且條件2為真,則其他條件會(huì)卡死在排他網(wǎng)關(guān)流程走不下去。zxN28資訊網(wǎng)——每日最新資訊28at.com

test1.bpmnzxN28資訊網(wǎng)——每日最新資訊28at.com

<?xml versinotallow="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Web Modeler" exporterVersion="b1a091a" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.5.0" camunda:diagramRelationId="2a2c997b-ff2f-49b0-9ba8-3c4860d223e7">  <bpmn:process id="Process_1qijgvk" name="test1" isExecutable="true">    <bpmn:startEvent id="StartEvent_1">      <bpmn:outgoing>Flow_0soou9n</bpmn:outgoing>    </bpmn:startEvent>    <bpmn:sequenceFlow id="Flow_0soou9n" sourceRef="StartEvent_1" targetRef="Activity_02gdgyk" />    <bpmn:endEvent id="Event_1i2y4ym">      <bpmn:incoming>Flow_07mf0sc</bpmn:incoming>      <bpmn:incoming>Flow_1nd3369</bpmn:incoming>      <bpmn:incoming>Flow_160ji3a</bpmn:incoming>    </bpmn:endEvent>    <bpmn:exclusiveGateway id="Gateway_1kykneu" name="檢查是否5天內(nèi)完成治理">      <bpmn:extensionElements />      <bpmn:incoming>Flow_0exjsc9</bpmn:incoming>      <bpmn:outgoing>Flow_0hj860q</bpmn:outgoing>      <bpmn:outgoing>Flow_1oqjt08</bpmn:outgoing>    </bpmn:exclusiveGateway>    <bpmn:sequenceFlow id="Flow_0hj860q" name="否" sourceRef="Gateway_1kykneu" targetRef="Activity_1ms8vu6" />    <bpmn:serviceTask id="Activity_02gdgyk" name="站內(nèi)通知商戶去治理">      <bpmn:extensionElements />      <bpmn:incoming>Flow_0soou9n</bpmn:incoming>      <bpmn:outgoing>Flow_0exjsc9</bpmn:outgoing>    </bpmn:serviceTask>    <bpmn:sequenceFlow id="Flow_0exjsc9" sourceRef="Activity_02gdgyk" targetRef="Gateway_1kykneu" />    <bpmn:serviceTask id="Activity_1ms8vu6" name="發(fā)送sms通知商戶">      <bpmn:incoming>Flow_0hj860q</bpmn:incoming>      <bpmn:outgoing>Flow_0bemgki</bpmn:outgoing>    </bpmn:serviceTask>    <bpmn:sequenceFlow id="Flow_0bemgki" sourceRef="Activity_1ms8vu6" targetRef="Gateway_1dyp6hh" />    <bpmn:sequenceFlow id="Flow_1oqjt08" name="是" sourceRef="Gateway_1kykneu" targetRef="Activity_1c9i1el" />    <bpmn:exclusiveGateway id="Gateway_1dyp6hh" name="是否10天內(nèi)完成治理">      <bpmn:incoming>Flow_0bemgki</bpmn:incoming>      <bpmn:outgoing>Flow_07xq405</bpmn:outgoing>      <bpmn:outgoing>Flow_1w4qeti</bpmn:outgoing>    </bpmn:exclusiveGateway>    <bpmn:sequenceFlow id="Flow_07xq405" name="是" sourceRef="Gateway_1dyp6hh" targetRef="Activity_0m5dsna" />    <bpmn:serviceTask id="Activity_1c9i1el" name="發(fā)放獎(jiǎng)勵(lì)給到商戶">      <bpmn:incoming>Flow_1oqjt08</bpmn:incoming>      <bpmn:outgoing>Flow_1t7ectj</bpmn:outgoing>    </bpmn:serviceTask>    <bpmn:sequenceFlow id="Flow_1t7ectj" sourceRef="Activity_1c9i1el" targetRef="Activity_1p6mkdy" />    <bpmn:task id="Activity_0m5dsna" name="任務(wù)完成">      <bpmn:incoming>Flow_07xq405</bpmn:incoming>      <bpmn:outgoing>Flow_07mf0sc</bpmn:outgoing>    </bpmn:task>    <bpmn:sequenceFlow id="Flow_07mf0sc" sourceRef="Activity_0m5dsna" targetRef="Event_1i2y4ym" />    <bpmn:sequenceFlow id="Flow_1w4qeti" name="否" sourceRef="Gateway_1dyp6hh" targetRef="Activity_1gud1rw" />    <bpmn:task id="Activity_1p6mkdy" name="任務(wù)完成">      <bpmn:incoming>Flow_1t7ectj</bpmn:incoming>      <bpmn:outgoing>Flow_1nd3369</bpmn:outgoing>    </bpmn:task>    <bpmn:sequenceFlow id="Flow_1nd3369" sourceRef="Activity_1p6mkdy" targetRef="Event_1i2y4ym" />    <bpmn:serviceTask id="Activity_1gud1rw" name="通知運(yùn)營(yíng)下線商戶店鋪">      <bpmn:incoming>Flow_1w4qeti</bpmn:incoming>      <bpmn:outgoing>Flow_0vr5zs3</bpmn:outgoing>    </bpmn:serviceTask>    <bpmn:sequenceFlow id="Flow_0vr5zs3" sourceRef="Activity_1gud1rw" targetRef="Activity_1pfbnmo" />    <bpmn:task id="Activity_1pfbnmo" name="任務(wù)結(jié)束">      <bpmn:incoming>Flow_0vr5zs3</bpmn:incoming>      <bpmn:outgoing>Flow_160ji3a</bpmn:outgoing>    </bpmn:task>    <bpmn:sequenceFlow id="Flow_160ji3a" sourceRef="Activity_1pfbnmo" targetRef="Event_1i2y4ym" />  </bpmn:process>  <bpmndi:BPMNDiagram id="BPMNDiagram_1">    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1qijgvk">      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">        <dc:Bounds x="152" y="232" width="36" height="36" />      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="Gateway_1kykneu_di" bpmnElement="Gateway_1kykneu" isMarkerVisible="true">        <dc:Bounds x="465" y="225" width="50" height="50" />        <bpmndi:BPMNLabel>          <dc:Bounds x="448" y="188" width="84" height="27" />        </bpmndi:BPMNLabel>      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="Activity_02gdgyk_di" bpmnElement="Activity_02gdgyk">        <dc:Bounds x="270" y="210" width="100" height="80" />        <bpmndi:BPMNLabel />      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="Activity_1ms8vu6_di" bpmnElement="Activity_1ms8vu6">        <dc:Bounds x="630" y="210" width="100" height="80" />        <bpmndi:BPMNLabel />      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="Event_1i2y4ym_di" bpmnElement="Event_1i2y4ym">        <dc:Bounds x="1182" y="232" width="36" height="36" />      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="Gateway_1dyp6hh_di" bpmnElement="Gateway_1dyp6hh" isMarkerVisible="true">        <dc:Bounds x="825" y="225" width="50" height="50" />        <bpmndi:BPMNLabel>          <dc:Bounds x="810" y="285" width="79" height="27" />        </bpmndi:BPMNLabel>      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="Activity_1c9i1el_di" bpmnElement="Activity_1c9i1el">        <dc:Bounds x="630" y="320" width="100" height="80" />        <bpmndi:BPMNLabel />      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="Activity_0m5dsna_di" bpmnElement="Activity_0m5dsna">        <dc:Bounds x="950" y="210" width="100" height="80" />        <bpmndi:BPMNLabel />      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="BPMNShape_0ab1d2g" bpmnElement="Activity_1p6mkdy">        <dc:Bounds x="840" y="320" width="100" height="80" />        <bpmndi:BPMNLabel />      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="Activity_1gud1rw_di" bpmnElement="Activity_1gud1rw">        <dc:Bounds x="800" y="80" width="100" height="80" />        <bpmndi:BPMNLabel />      </bpmndi:BPMNShape>      <bpmndi:BPMNShape id="BPMNShape_02s3tua" bpmnElement="Activity_1pfbnmo">        <dc:Bounds x="950" y="80" width="100" height="80" />        <bpmndi:BPMNLabel />      </bpmndi:BPMNShape>      <bpmndi:BPMNEdge id="Flow_0soou9n_di" bpmnElement="Flow_0soou9n">        <di:waypoint x="188" y="250" />        <di:waypoint x="270" y="250" />      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_0exjsc9_di" bpmnElement="Flow_0exjsc9">        <di:waypoint x="370" y="250" />        <di:waypoint x="465" y="250" />      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_0hj860q_di" bpmnElement="Flow_0hj860q">        <di:waypoint x="515" y="250" />        <di:waypoint x="630" y="250" />        <bpmndi:BPMNLabel>          <dc:Bounds x="567" y="232" width="11" height="14" />        </bpmndi:BPMNLabel>      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_1oqjt08_di" bpmnElement="Flow_1oqjt08">        <di:waypoint x="490" y="275" />        <di:waypoint x="490" y="360" />        <di:waypoint x="630" y="360" />        <bpmndi:BPMNLabel>          <dc:Bounds x="544" y="373" width="11" height="14" />        </bpmndi:BPMNLabel>      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_0bemgki_di" bpmnElement="Flow_0bemgki">        <di:waypoint x="730" y="250" />        <di:waypoint x="825" y="250" />      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_1t7ectj_di" bpmnElement="Flow_1t7ectj">        <di:waypoint x="730" y="360" />        <di:waypoint x="840" y="360" />      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_07mf0sc_di" bpmnElement="Flow_07mf0sc">        <di:waypoint x="1050" y="250" />        <di:waypoint x="1182" y="250" />      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_07xq405_di" bpmnElement="Flow_07xq405">        <di:waypoint x="875" y="250" />        <di:waypoint x="950" y="250" />        <bpmndi:BPMNLabel>          <dc:Bounds x="899" y="232" width="11" height="14" />        </bpmndi:BPMNLabel>      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_1w4qeti_di" bpmnElement="Flow_1w4qeti">        <di:waypoint x="850" y="225" />        <di:waypoint x="850" y="160" />        <bpmndi:BPMNLabel>          <dc:Bounds x="853" y="186" width="11" height="14" />        </bpmndi:BPMNLabel>      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_1nd3369_di" bpmnElement="Flow_1nd3369">        <di:waypoint x="940" y="360" />        <di:waypoint x="1120" y="360" />        <di:waypoint x="1120" y="250" />        <di:waypoint x="1182" y="250" />      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_0vr5zs3_di" bpmnElement="Flow_0vr5zs3">        <di:waypoint x="900" y="120" />        <di:waypoint x="950" y="120" />      </bpmndi:BPMNEdge>      <bpmndi:BPMNEdge id="Flow_160ji3a_di" bpmnElement="Flow_160ji3a">        <di:waypoint x="1050" y="120" />        <di:waypoint x="1120" y="120" />        <di:waypoint x="1120" y="250" />        <di:waypoint x="1182" y="250" />      </bpmndi:BPMNEdge>    </bpmndi:BPMNPlane>  </bpmndi:BPMNDiagram></bpmn:definitions>
  • process,表示一個(gè)流程。
  • id="exclusiveTest" versinotallow="1.0.0",分別表示流程定義的id和版本。這兩個(gè)字段唯一區(qū)分一個(gè)流程定義。
  • startEvent,表示流程開始節(jié)點(diǎn)。只允許有一個(gè)開始節(jié)點(diǎn)。
  • endEvent,表示流程結(jié)束節(jié)點(diǎn)。可以有多個(gè)結(jié)束節(jié)點(diǎn)。
  • sequenceFlow,表示環(huán)節(jié)流轉(zhuǎn)關(guān)系。sourceRef="theStart" targetRef="submitTask" 分別表示起始節(jié)點(diǎn)和目標(biāo)節(jié)點(diǎn)。該節(jié)點(diǎn)有個(gè)子節(jié)點(diǎn), approve == 'agree',這個(gè)片段很重要,用來描述流程流轉(zhuǎn)的條件。approve == 'upgrade'使用的是MVEL表達(dá)式語法。另外,還值得注意的是,在驅(qū)動(dòng)流程運(yùn)轉(zhuǎn)時(shí),需要傳入正確的參數(shù)。比如說,在后面介紹的api中,通常會(huì)需要在Map中傳遞業(yè)務(wù)請(qǐng)求參數(shù)。那么需要將Map中的key和Mvel的運(yùn)算因子關(guān)聯(lián)起來。以這個(gè)例子來說,request.put("approve", "agree");里面的approve和approve == 'agree'命名要一致。
  • exclusiveGateway,表示互斥網(wǎng)關(guān)。該節(jié)點(diǎn)非常重要。用來區(qū)分流程節(jié)點(diǎn)的不同轉(zhuǎn)向。互斥網(wǎng)關(guān)在引擎執(zhí)行conditionExpression后,有且只能選擇一條匹配的sequenceFlow繼續(xù)執(zhí)行。
  • serviceTask,服務(wù)任務(wù),用來表示執(zhí)行一個(gè)服務(wù),所以他會(huì)有引擎默認(rèn)的擴(kuò)展:smart:class="com.alibaba.smart.framework.example.AuditProcessServiceTaskDelegation". Client Developer使用時(shí),需要自定義對(duì)應(yīng)的業(yè)務(wù)實(shí)現(xiàn)類。在該節(jié)點(diǎn)執(zhí)行時(shí),它會(huì)自動(dòng)執(zhí)行服務(wù)調(diào)用,執(zhí)行smart:class 這個(gè) delegation。該節(jié)點(diǎn)不暫停,會(huì)自動(dòng)往下一個(gè)流轉(zhuǎn)。
  • receiveTask,接收任務(wù)。在引擎遇到此類型的節(jié)點(diǎn)時(shí),引擎執(zhí)行會(huì)自動(dòng)暫停,等待外部調(diào)用signal方法。當(dāng)調(diào)用signal方法時(shí),會(huì)驅(qū)動(dòng)流程當(dāng)前節(jié)點(diǎn)離開。在離開該節(jié)點(diǎn)時(shí),引擎會(huì)自動(dòng)執(zhí)行smart:class 這個(gè)delegation。在一般業(yè)務(wù)場(chǎng)景中,我們通常使用receiveTask來表示等需要等待外部回調(diào)的節(jié)點(diǎn)。
  • userTask,表示用戶任務(wù)節(jié)點(diǎn),僅用于DataBase模式。該節(jié)點(diǎn)需要人工參與處理,并且通常需要在待辦列表中展示。在Custom模式下,建議使用receiveTask來代替。
  • parallelGateway,這個(gè)節(jié)點(diǎn)并未在上述流程定義中體現(xiàn),這里詳細(xì)說一下。parallelGateway 首先必須成對(duì)出現(xiàn),分別承擔(dān)fork和join職責(zé)。其次,在join時(shí)需要實(shí)現(xiàn)分布式鎖接口:LockStrategy。第三,fork默認(rèn)是順序遍歷多個(gè)sequeceFlow,但是你如果需要使用并發(fā)fork功能的話,則需要實(shí)現(xiàn)該接口:ExecutorService。

zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

重要領(lǐng)域?qū)ο?/h4>
  • 部署實(shí)例: DeploymentInstance,描述這個(gè)流程定義是誰發(fā)布的,當(dāng)前處于什么狀態(tài)。
  • 流程定義: ProcessDefinition,描述一個(gè)流程有幾個(gè)環(huán)節(jié),之間的流轉(zhuǎn)關(guān)系是什么樣子的。
  • 流程實(shí)例: ProcessInstance,可以簡(jiǎn)單理解為我們常見的一個(gè)工單。
  • 活動(dòng)實(shí)例: ActivityInstance,主要是描述流程實(shí)例(工單)的流轉(zhuǎn)軌跡。
  • 執(zhí)行實(shí)例: ExecutionInstance,主要根據(jù)該實(shí)例的狀態(tài),來判斷當(dāng)前流程處在哪個(gè)節(jié)點(diǎn)上。
  • 任務(wù)實(shí)例: TaskInstance,用來表示人工任務(wù)處理的,可以理解為一個(gè)需要人工參與處理的環(huán)節(jié)。
  • 任務(wù)處理:TaskAssigneeInstance,用來表示當(dāng)前任務(wù)共有幾個(gè)處理者。通常在代辦列表中用到此實(shí)體。
  • 變量實(shí)例:VariableInstance,用來存儲(chǔ)流程實(shí)例上下文。

SmartEngine引擎源碼地址:https://github.com/alibaba/SmartEngine/tree/masterzxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

SmartEngine UserGuide:  https://github.com/alibaba/SmartEngine/wiki/SmartEngine-UserGuide--Chinese-Version-%28%E4%B8%AD%E6%96%87%E7%89%88%29zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

Camunda開源流程設(shè)計(jì)器(支持在線和本地node.js部署兩種方式):https://camunda.com/download/modeler/zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

Camunda設(shè)計(jì)器學(xué)習(xí)文檔:https://docs.camunda.io/docs/components/modeler/bpmn/bpmn-primer/zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

四、總結(jié)與建議

zxN28資訊網(wǎng)——每日最新資訊28at.com

優(yōu)點(diǎn)

zxN28資訊網(wǎng)——每日最新資訊28at.com

  • 業(yè)務(wù)流程可視化與實(shí)際系統(tǒng)流程可視化高度一致,所見即所得。
  • 調(diào)整效率高(業(yè)務(wù)平均每個(gè)月會(huì)升級(jí)一次治理流程),如果業(yè)務(wù)流程1.0要升級(jí)到1.1,只需要重新復(fù)制一份bpmn.xml流程模板重新編排為1.1,并下發(fā)流程實(shí)例即可,不影響原有的流程模板和流程實(shí)例執(zhí)行(調(diào)整效率由原來的一周縮短到1小時(shí))。
  • 流程實(shí)例和流程節(jié)點(diǎn)實(shí)例可視,方便監(jiān)控各個(gè)節(jié)點(diǎn)的執(zhí)行和數(shù)據(jù)報(bào)表的產(chǎn)出。

zxN28資訊網(wǎng)——每日最新資訊28at.com

缺點(diǎn)

zxN28資訊網(wǎng)——每日最新資訊28at.com

  • 異常處理的支持度不夠友好(SmartEngine是異常丟棄),如果在某一個(gè)節(jié)點(diǎn)上執(zhí)行失敗(一般情況是業(yè)務(wù)接口執(zhí)行失敗導(dǎo)致),默認(rèn)當(dāng)前流程進(jìn)度是卡在該節(jié)點(diǎn)的,需要設(shè)計(jì)張異常表,把當(dāng)前流程實(shí)例,節(jié)點(diǎn)實(shí)例以及變量都保存下載,通過job重新拉起重試去驅(qū)動(dòng)流程繼續(xù)執(zhí)行,并需要做好告警監(jiān)控,以及任務(wù)實(shí)例和流程實(shí)例的核對(duì)。
  • 高并發(fā)場(chǎng)景的支持度并不是太友好,要通過異步消息的方式來控制創(chuàng)建流程實(shí)例的速度,目前得到的創(chuàng)建流程實(shí)例的TPS是100/s單臺(tái),只是相對(duì)于activiti來說并發(fā)支持度要高,超過這個(gè)上限的場(chǎng)景建議謹(jǐn)慎使用。
  • 可擴(kuò)展性不足,例如:ProcessQueryService只支持findById,findList,count;ExecutionQueryService只支持findActiveExecutionList,findAll這些基本查詢 ,復(fù)雜查詢需要新寫SmartEngine核心包,升級(jí)jar包版本后才可使用。
  • 無歷史記錄表,每隔一段時(shí)間要清理表中流程實(shí)例已經(jīng)完結(jié)的相關(guān)數(shù)據(jù),否則歷史數(shù)據(jù)堆積影響查詢效率。

zxN28資訊網(wǎng)——每日最新資訊28at.com

建議

zxN28資訊網(wǎng)——每日最新資訊28at.com

如果業(yè)務(wù)流程的復(fù)雜度一般,且經(jīng)常會(huì)調(diào)整,并發(fā)量并不高的情況下,建議使用;如果業(yè)務(wù)復(fù)雜度過高,或并發(fā)量TPS超過單臺(tái)100/s,不建議使用。zxN28資訊網(wǎng)——每日最新資訊28at.com

zxN28資訊網(wǎng)——每日最新資訊28at.com

本文鏈接:http://www.www897cc.com/showinfo-26-101710-0.html探索BPMN—工作流技術(shù)的理論與實(shí)踐

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。郵件:2376512515@qq.com

上一篇: 輕盈高效:深入了解.NET中的ValueStopwatch計(jì)時(shí)器

下一篇: 短信服務(wù) platform-sms 0.6.1 發(fā)布,看完覺得怎么樣?

標(biāo)簽:
  • 熱門焦點(diǎn)
Top 主站蜘蛛池模板: 南岸区| 高要市| 夏邑县| 广德县| 仁布县| 阿巴嘎旗| 婺源县| 怀宁县| 共和县| 淳化县| 新泰市| 安平县| 白河县| 衡东县| 定日县| 江门市| 正宁县| 界首市| 县级市| 额济纳旗| 金门县| 北碚区| 郸城县| 资阳市| 兴海县| 南溪县| 平利县| 大理市| 岐山县| 黄冈市| 日照市| 吉安市| 泰顺县| 方城县| 平顶山市| 舒兰市| 云浮市| 北宁市| 小金县| 凉山| 深圳市|