最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Bpmn.js?自定義描述文件使用說明

 更新時(shí)間:2022年10月27日 14:46:26   作者:MiyueFE  
這篇文章主要為大家介紹了Bpmn.js?自定義描述文件使用說明,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪

前言

在使用 bpmn-js 繪制流程圖時(shí),可能會(huì)存在需要開發(fā)者自己定義屬性或者元素的情況,為了保證符合官方定義,對(duì)官方文檔進(jìn)行了漢化說明。以下說明基于個(gè)人理解,可能與真實(shí)作用有出入,希望大家指出不正確或者意義不明的地方,我好加以改正,謝謝!

說明文件配置屬性

原文見 bpmn 官方倉庫 bpmn-io/moddle 。

自定義說明文件demo

說明文件 SelfDescriptor.json

{
  "name": "self",
  "uri": "https://self",
  "prefix": "se",
  "xml": {
    "tagAlias": "lowerCase"
  },
  "types": [
    {
      "name": "AttrOne",
      "superClass": [
        "Element"
      ],
      "properties": [
        {
          "name": "name",
          "type": "String",
          "isAttr": "true"
        },
        {
          "name": "values",
          "type": "AttrOneProp",
          "isMany": true
        }
      ]
    },
    {
      "name": "AttrOneProp",
      "superClass": [
        "Element"
      ],
      "meta": {
        "allowedIn": [ "*" ]
      },
      "properties": [
        {
          "name": "propName",
          "type": "String",
          "isAttr": true
        },
        {
          "name": "value",
          "type": "String",
          "isAttr": true
        }
      ]
    },
    {
      "name": "AttrTwo",
      "superClass": [
        "Element"
      ],
      "meta": {
        "allowedIn": [ "*" ]
      },
      "properties": [
        {
          "name": "value",
          "type": "String",
          "isBody": true
        }
      ]
    }
  ]
}

使用

import $ from 'jquery';
import BpmnModeler from 'bpmn-js/lib/Modeler';
// 側(cè)邊欄
import propertiesPanelModule from 'bpmn-js-properties-panel';
// camunda 側(cè)邊欄內(nèi)容構(gòu)建器
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda';
// camunda 屬性解析文件
import camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda.json';
// 自定義的屬性解析文件
import SelfDescriptor from "./SelfDescriptor.json";
// 省略部分內(nèi)容...
// 初始化 modeler
var bpmnModeler = new BpmnModeler({
  container: canvas,
  propertiesPanel: {
    parent: '#js-properties-panel'
  },
  additionalModules: [
    propertiesPanelModule,
    propertiesProviderModule
  ],
  moddleExtensions: {
    // 使用引入的屬性解析文件
    camunda: camundaModdleDescriptor,
    self: SelfDescriptor
  }
});
// 使用與創(chuàng)建自定義屬性標(biāo)簽
bpmnModeler.on("element.click", function (event, eventObj) {
    const moddle = bpmnModeler.get("moddle");
    // 自定義屬性1
    const attrOne = moddle.create("se:AttrOne", { name: "testAttrOne", values: [] });
    // 自定義屬性子屬性
    const attrOneProp = moddle.create("se:AttrOneProp", {propName: "propName1", value: "propValue1"})
    // 自定義屬性2
    const attrTwo = moddle.create("se:AttrTwo", { value: "testAttrTwo" })
    // 原生屬性Properties
    const props = moddle.create("camunda:Properties", { values: [] });
    // 原生屬性Properties的子屬性
    const propItem = moddle.create("camunda:Property", { name: "原生子屬性name", values: "原生子屬性value" });
    // 原生擴(kuò)展屬性數(shù)組
    const extensions = moddle.create("bpmn:ExtensionElements", { values: [] })
    // 開始節(jié)點(diǎn)插入原生屬性
    if (eventObj.element.type === "bpmn:StartEvent") {
      props.values.push(propItem);
      extensions.values.push(props);
    }
    // 任務(wù)節(jié)點(diǎn)插入多種屬性
    if (eventObj.element.type === "bpmn:Task") {
      props.values.push(propItem, propItem);
      attrOne.values.push(attrOneProp);
      extensions.values.push(props, attrOne, attrTwo);
    }
    // root插入自定義屬性
    if (eventObj.element.type === "bpmn:Process") {
      attrOne.values.push(attrOneProp, attrOneProp);
      extensions.values.push(attrOne);
    }
    bpmnModeler.get("modeling").updateProperties(eventObj.element, {
      extensionElements: extensions
    });
})

結(jié)果

只截取了流程相關(guān)的部分

<bpmn2:process id="Process_1" isExecutable="false">
    <bpmn2:extensionElements>
        <se:attrOne name="testAttrOne">
            <se:attrOneProp propName="propName1" value="propValue1" />
            <se:attrOneProp propName="propName1" value="propValue1" />
        </se:attrOne>
    </bpmn2:extensionElements>
    <bpmn2:startEvent id="StartEvent_1">
        <bpmn2:extensionElements>
            <camunda:properties>
                <camunda:property name="原生子屬性name" values="原生子屬性value" />
            </camunda:properties>
        </bpmn2:extensionElements>
        <bpmn2:outgoing>Flow_066c7c5</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:task id="Activity_0ghpzc3" name="1">
        <bpmn2:extensionElements>
            <camunda:properties>
                <camunda:property name="原生子屬性name" values="原生子屬性value" />
                <camunda:property name="原生子屬性name" values="原生子屬性value" />
            </camunda:properties>
            <se:attrOne name="testAttrOne">
                <se:attrOneProp propName="propName1" value="propValue1" />
            </se:attrOne>
            <se:attrTwo>testAttrTwo</se:attrTwo>
        </bpmn2:extensionElements>
        <bpmn2:incoming>Flow_066c7c5</bpmn2:incoming>
        <bpmn2:outgoing>Flow_0qmpzc7</bpmn2:outgoing>
    </bpmn2:task>
    <bpmn2:sequenceFlow id="Flow_066c7c5" sourceRef="StartEvent_1" targetRef="Activity_0ghpzc3" />
    <bpmn2:task id="Activity_1gm4zj6" name="2">
        <bpmn2:extensionElements>
            <camunda:properties>
                <camunda:property name="原生子屬性name" values="原生子屬性value" />
                <camunda:property name="原生子屬性name" values="原生子屬性value" />
            </camunda:properties>
            <se:attrOne name="testAttrOne">
                <se:attrOneProp propName="propName1" value="propValue1" />
            </se:attrOne>
            <se:attrTwo>testAttrTwo</se:attrTwo>
        </bpmn2:extensionElements>
        <bpmn2:incoming>Flow_0qmpzc7</bpmn2:incoming>
        <bpmn2:outgoing>Flow_03hry06</bpmn2:outgoing>
    </bpmn2:task>
    <bpmn2:sequenceFlow id="Flow_0qmpzc7" sourceRef="Activity_0ghpzc3" targetRef="Activity_1gm4zj6" />
    <bpmn2:task id="Activity_0ahhdt5" name="3">
        <bpmn2:extensionElements>
            <camunda:properties>
                <camunda:property name="原生子屬性name" values="原生子屬性value" />
                <camunda:property name="原生子屬性name" values="原生子屬性value" />
            </camunda:properties>
            <se:attrOne name="testAttrOne">
                <se:attrOneProp propName="propName1" value="propValue1" />
            </se:attrOne>
            <se:attrTwo>testAttrTwo</se:attrTwo>
        </bpmn2:extensionElements>
        <bpmn2:incoming>Flow_03hry06</bpmn2:incoming>
        <bpmn2:outgoing>Flow_1h7pp7l</bpmn2:outgoing>
    </bpmn2:task>
    <bpmn2:sequenceFlow id="Flow_03hry06" sourceRef="Activity_1gm4zj6" targetRef="Activity_0ahhdt5" />
    <bpmn2:endEvent id="Event_1eofx2i">
        <bpmn2:incoming>Flow_1h7pp7l</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="Flow_1h7pp7l" sourceRef="Activity_0ahhdt5" targetRef="Event_1eofx2i" />
</bpmn2:process>

后記

由于工作需要(其實(shí)不是很需要),在公司項(xiàng)目的基礎(chǔ)上開源了一個(gè)基于 bpmn-js + Vue 2.x + ElementUI 的一個(gè)流程編輯器 Bpmn Process Designer

預(yù)覽地址 MiyueFE blog,

以上就是Bpmn.js 自定義描述文件使用說明的詳細(xì)內(nèi)容,更多關(guān)于Bpmn.js 自定義描述文件的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • vue將毫秒數(shù)轉(zhuǎn)化為正常日期格式的實(shí)例

    vue將毫秒數(shù)轉(zhuǎn)化為正常日期格式的實(shí)例

    今天小編就為大家分享一篇vue將毫秒數(shù)轉(zhuǎn)化為正常日期格式的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2018-09-09
  • Vue3之Mixin的使用方式(全局,局部,setup內(nèi)部使用)

    Vue3之Mixin的使用方式(全局,局部,setup內(nèi)部使用)

    這篇文章主要介紹了Vue3之Mixin的使用方式(全局,局部,setup內(nèi)部使用),具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-10-10
  • vue 按鈕 權(quán)限控制介紹

    vue 按鈕 權(quán)限控制介紹

    這篇文章主要介紹了vue 按鈕 權(quán)限控制,在日常項(xiàng)目中,會(huì)碰到需要根據(jù)后臺(tái)接口返回的數(shù)據(jù),來判斷當(dāng)前用戶的操作權(quán)限,必須當(dāng)有刪除權(quán)限時(shí),就顯示刪除按鈕,下面我們就來了解一下具體的解決方法,需要的朋友也可以參考一下
    2021-12-12
  • vue輪播圖插件vue-awesome-swiper

    vue輪播圖插件vue-awesome-swiper

    這篇文章主要為大家詳細(xì)介紹了vue輪播圖插件vue-awesome-swiper,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-11-11
  • vue結(jié)合leaflet實(shí)現(xiàn)熱力圖

    vue結(jié)合leaflet實(shí)現(xiàn)熱力圖

    本文主要介紹了vue實(shí)現(xiàn)熱力圖,結(jié)合leaflet.heat插件可以很容易的做出熱力圖,文中通過示例代碼介紹的非常詳細(xì),需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-06-06
  • 在項(xiàng)目中封裝axios的實(shí)戰(zhàn)過程

    在項(xiàng)目中封裝axios的實(shí)戰(zhàn)過程

    這篇文章主要給大家介紹了關(guān)于如何在項(xiàng)目中封裝axios的相關(guān)資料,axios 請(qǐng)求的封裝,無非是為了方便代碼管理,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2021-09-09
  • vue自定義橫向滾動(dòng)條css導(dǎo)航兩行排列布局實(shí)現(xiàn)示例

    vue自定義橫向滾動(dòng)條css導(dǎo)航兩行排列布局實(shí)現(xiàn)示例

    這篇文章主要為大家介紹了vue自定義橫向滾動(dòng)條css導(dǎo)航兩行排列布局實(shí)現(xiàn)示例,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-08-08
  • 詳解VUE里子組件如何獲取父組件動(dòng)態(tài)變化的值

    詳解VUE里子組件如何獲取父組件動(dòng)態(tài)變化的值

    這篇文章主要介紹了詳解VUE里子組件如何獲取父組件動(dòng)態(tài)變化的值,子組件通過props獲取父組件傳過來的數(shù)據(jù),子組件存在操作傳過來的數(shù)據(jù)并且傳遞給父組件,需要的朋友可以參考下
    2018-12-12
  • ant design vue中table表格滾動(dòng)加載實(shí)現(xiàn)思路

    ant design vue中table表格滾動(dòng)加載實(shí)現(xiàn)思路

    在處理一寫數(shù)據(jù)量特別大的情況下,我們不能把后端的數(shù)據(jù)一次性全部拿到前端在table表格中展示,為了考慮性能優(yōu)化,使用了滾動(dòng)加載表格數(shù)據(jù),這篇文章主要介紹了ant design vue中table表格滾動(dòng)加載實(shí)現(xiàn)思路,需要的朋友可以參考下
    2024-07-07
  • Vue 報(bào)錯(cuò)Error: No PostCSS Config found問題及解決

    Vue 報(bào)錯(cuò)Error: No PostCSS Config foun

    這篇文章主要介紹了Vue 報(bào)錯(cuò)Error: No PostCSS Config found問題及解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-07-07

最新評(píng)論

苍南县| 宝鸡市| 绥棱县| 景宁| 若尔盖县| 黄浦区| 嘉义市| 济源市| 佛坪县| 高密市| 吉隆县| 柞水县| 板桥市| 绵阳市| 隆子县| 秦安县| 横山县| 宁远县| 兴安县| 防城港市| 邯郸市| 育儿| 江华| 潜江市| 文登市| 湖口县| 安吉县| 同仁县| 安康市| 新昌县| 大名县| 丰城市| 秦皇岛市| 康平县| 大理市| 韶山市| 资阳市| 宜昌市| 屯留县| 信宜市| 盘锦市|