UNPKG

vmes-flowable

Version:

ceshibao

122 lines (82 loc) 3.55 kB
# bpmn-js-properties-panel [![Build Status](https://travis-ci.org/bpmn-io/bpmn-js-properties-panel.svg?branch=master)](https://travis-ci.org/bpmn-io/bpmn-js-properties-panel) A properties panel extension for [bpmn-js](https://github.com/bpmn-io/bpmn-js) that adds the ability to edit technical properties (generic and [Flowable](https://flowable.com)). [![bpmn-js-properties-panel screenshot](https://raw.githubusercontent.com/bpmn-io/bpmn-js-properties-panel/master/docs/screenshot.png "Screenshot of the bpmn-js modeler + properties panel")](https://github.com/bpmn-io/bpmn-js-examples/tree/master/properties-panel) ## Features The properties panel allows users to edit invisible BPMN properties in a convenient way. Some of the features are: * Edit element ids, multi-instance details and more * Edit execution related [Flowable](http://flowable.org) properties * Redo and undo (plugs into the [bpmn-js](https://github.com/bpmn-io/bpmn-js) editing cycle) ## Usage Provide two HTML elements, one for the properties panel and one for the BPMN diagram: ```html <div class="modeler"> <div id="canvas"></div> <div id="properties"></div> </div> ``` Bootstrap [bpmn-js](https://github.com/bpmn-io/bpmn-js) with the properties panel and a [properties provider](https://github.com/bpmn-io/bpmn-js-properties-panel/tree/master/lib/provider): ```javascript var BpmnJS = require('jeeplus-bpmn/lib/Modeler'), propertiesPanelModule = require('bpmn-js-properties-panel'), propertiesProviderModule = require('bpmn-js-properties-panel/lib/provider/bpmn'); var bpmnJS = new BpmnJS({ additionalModules: [ propertiesPanelModule, propertiesProviderModule ], container: '#canvas', propertiesPanel: { parent: '#properties' } }); ``` ### Dynamic Attach/Detach You may attach or detach the properties panel dynamically to any element on the page, too: ```javascript var propertiesPanel = bpmnJS.get('propertiesPanel'); // detach the panel propertiesPanel.detach(); // attach it to some other element propertiesPanel.attachTo('#other-properties'); ``` ### Use with Flowable properties In order to be able to edit [Flowable](https://flowable.com) related properties, use the [flowable properties provider](https://github.com/bpmn-io/bpmn-js-properties-panel/tree/master/lib/provider/flowable). In addition, you need to define the `flowable` namespace via [flowable-bpmn-moddle](https://github.com/flowable/flowable-bpmn-moddle). ```javascript var BpmnJS = require('jeeplus-bpmn/lib/Modeler'), propertiesPanelModule = require('bpmn-js-properties-panel'), // use Flowable properties provider propertiesProviderModule = require('bpmn-js-properties-panel/lib/provider/flowable'); // a descriptor that defines Flowable related BPMN 2.0 XML extensions var flowableModdleDescriptor = require('flowable-bpmn-moddle/resources/flowable'); var bpmnJS = new BpmnJS({ additionalModules: [ propertiesPanelModule, propertiesProviderModule ], container: '#canvas', propertiesPanel: { parent: '#properties' }, // make flowable prefix known for import, editing and export moddleExtensions: { flowable: flowableModdleDescriptor } }); ... ``` ## Additional Resources * [Issue tracker](https://github.com/bpmn-io/bpmn-js-properties-panel) * [Forum](https://forum.bpmn.io) * [Example Project](https://github.com/bpmn-io/bpmn-js-examples/tree/master/properties-panel) ## Development ### Running the tests ```bash npm install export TEST_BROWSERS=Chrome npm run all ``` ## License MIT