bpmnjs自定义过程中,扩展flowable自定义标签的描述文件descriptor的编写可以说是难点中的难点,刚开始看根本理解不了,也不知道标签可以使用的属性有哪些,只能一点点从网上找到的文件中学习,如下是小编的描述文件部分内容,给大家做参考:
参考官方仓库:https://github.com/bpmn-io/moddle/blob/master/docs/descriptor.md
{
"name": "Flowable",
"uri": "http://flowable.org/bpmn",
"prefix": "flowable",
"xml": {
"tagAlias": "lowerCase"
},
"associations": [],
"types": [{
"name":"completionCondition",
"extends":["bpmn:MultiInstanceLoopCharacteristics"],
"superClass":["Element"],
"xml": {
"serialize": "xsi:type"
},
"meta":{
"allowedIn":["*"]
},
"properties":[
{
"name":"name",
"isAttr":true,
"type":"String"
},
{
"name":"value",
"isAttr":true,
"type":"String"
},
{
"name": "body",
"isBody": true,
"type": "Expression"
}
]
},
{
"name": "UserTask",
"isAbstract": true,
"extends": [
"bpmn:UserTask",
"bpmn:MultiInstanceLoopCharacteristics"
],
"properties": [ {
"name": "timerEventDefinition",
"type": "Expression"
},{
"name": "multiInstanceLoopCharacteristics",
"type": "MultiInstanceLoopCharacteristics"
}]
},
{
"name": "StartEvent",
"isAbstract": true,
"extends": [
"bpmn:StartEvent"
],
"properties": [{
"name": "timerEventDefinition",
"type": "Expression"
}]
},
{
"name":"Properties",
"isAbstract": true,
"extends":[],
"superClass":["Element"],
"meta":{
"allowedIn":["*"]
},
"properties":[{
"name":"values",
"isMany":true,
"isbody":true,
"type":"Formright"
}]
},
{
"name":"Formright",
"isAbstract": true,
"extends":[
"flowable:Exec_before",
"flowable:Exec_after"
],
"superClass":["Element"],
"meta":{
"allowedIn":["*"]
},
"properties":[{
"name":"value",
"isAttr":true,
"type":"String"
},{
"name": "body",
"isBody": true,
"type": "String"
}]
},
{
"name": "Property",
"superClass": ["Element"],
"properties": [{
"name": "id",
"type": "String",
"isAttr": true
},{
"name": "name",
"type": "String",
"isAttr": true
},{
"name": "value",
"type": "String",
"isAttr": true
}]
} ]
}
属性基本含义解读:
prefix:自定义属性的指定前缀(flowable/activiti/camunda);
uri: 命名空间(只需定义,不要求能打开);
types:自定义标签类型数组
- name:自定义标签的名称,一般首字母大写,具有唯一性(e.g:Formdata),在xml中显示为 flowable:Formdata;
- isAbstract:true | 是否支持复杂类型;
- extends:[] | 当前标签可以在这些标签里使用;
- superClass:[] | 继承基础类的属性;
- properties:[] | 存放标签属性的数组;
- name:xxx | 属性名;
- type:String|Boolean|Expression|Formright… | 属性值类型,可以为任意基础类型以及其他已定义的标签类型
- isAttr:true | 是否允许设置为标签行内属性(e.g
<flowable:Formdata xxx="abc"></flowable:Formdata>
)
- isAttr:true | 是否允许设置为标签行内属性(e.g
- isBody:false | 是否允许设置为标签子节点(e.g
<flowable:Formdata>xxx</flowable:Formdata>
)
- isBody:false | 是否允许设置为标签子节点(e.g
- isMany:true | 是否支持存放数组,设置时可以传数组updateProperties()赋值;(xml上表现为:e.g
<flowable:Formdata xxx="1,2,3"></flowable:Formdata>
),element.businessObject.$attr.xxx取值时为[1,2,3]
- isMany:true | 是否支持存放数组,设置时可以传数组updateProperties()赋值;(xml上表现为:e.g
引导:
关于bpmnjs+vue的更多篇章,小编已经全部整理在这里:
bpmnjs+vue中文文档API常见方法使用总结