Giter Club home page Giter Club logo

bpmn-js-properties-panel's Introduction

Extending the properties panel changed significantly with bpmn-js-properties-panel>=1. For the 0.x version of the library, check out the 0.x branch. Read more on the changes in the changelog.

bpmn-js-properties-panel

CI

A properties panel extension for bpmn-js that adds the ability to edit technical properties (generic and Camunda).

bpmn-js-properties-panel screenshot

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 Camunda 7 and Camunda 8 properties
  • Redo and undo (plugs into the bpmn-js editing cycle)

Usage

Provide two HTML elements, one for the properties panel and one for the BPMN diagram:

<div class="modeler">
  <div id="canvas"></div>
  <div id="properties"></div>
</div>

Bootstrap bpmn-js with the properties panel and a properties provider:

import BpmnModeler from 'bpmn-js/lib/Modeler';
import {
  BpmnPropertiesPanelModule,
  BpmnPropertiesProviderModule,
} from 'bpmn-js-properties-panel';

const modeler = new BpmnModeler({
  container: '#canvas',
  propertiesPanel: {
    parent: '#properties'
  },
  additionalModules: [
    BpmnPropertiesPanelModule,
    BpmnPropertiesProviderModule
  ]
});

Styling

For proper styling include the necessary stylesheets:

<link rel="stylesheet" href="https://unpkg.com/@bpmn-io/properties-panel/dist/assets/properties-panel.css">

Dynamic Attach/Detach

You may attach or detach the properties panel dynamically to any element on the page, too:

const propertiesPanel = bpmnJS.get('propertiesPanel');

// detach the panel
propertiesPanel.detach();

// attach it to some other element
propertiesPanel.attachTo('#other-properties');

Edit Camunda Properties

To edit Camunda properties, you have to use a moddle extension so bpmn-js is can read and write Camunda properties and use a provider so these properties are shown in the properties panel.

For example, to edit Camunda 8 properties, use the Camunda 8 moddle extension and the Camunda 8 provider. Additionally, you should use behaviors specific to Camunda 8 to ensure parts of the model that are specific to Camunda 8 are maintained correctly.

import BpmnModeler from 'bpmn-js/lib/Modeler';
import {
  BpmnPropertiesPanelModule,
  BpmnPropertiesProviderModule,
  ZeebePropertiesProviderModule // Camunda 8 provider
} from 'bpmn-js-properties-panel';

// Camunda 8 moddle extension
import zeebeModdle from 'zeebe-bpmn-moddle/resources/zeebe';

// Camunda 8 behaviors
import ZeebeBehaviorsModule from 'camunda-bpmn-js-behaviors/lib/camunda-cloud';

const modeler = new BpmnModeler({
  container: '#canvas',
  propertiesPanel: {
    parent: '#properties'
  },
  additionalModules: [
    BpmnPropertiesPanelModule,
    BpmnPropertiesProviderModule,
    ZeebePropertiesProviderModule,
    ZeebeBehaviorsModule
  ],
  moddleExtensions: {
    zeebe: zeebeModdle
  }
});

API

BpmnPropertiesPanelRenderer#attachTo(container: HTMLElement) => void

Attach the properties panel to a parent node.

const propertiesPanel = modeler.get('propertiesPanel');

propertiesPanel.attachTo('#other-properties');

BpmnPropertiesPanelRenderer#detach() => void

Detach the properties panel from its parent node.

const propertiesPanel = modeler.get('propertiesPanel');

propertiesPanel.detach();

BpmnPropertiesPanelRenderer#registerProvider(priority: Number, provider: PropertiesProvider) => void

Register a new properties provider to the properties panel.

class ExamplePropertiesProvider {
  constructor(propertiesPanel) {
    propertiesPanel.registerProvider(500, this);
  }

  getGroups(element) {
    return (groups) => {

      // add, modify or remove groups
      // ...

      return groups;
    };
  }
}

ExamplePropertiesProvider.$inject = [ 'propertiesPanel' ];

Additional Resources

Development

Prepare the project by installing all dependencies:

npm install

Then, depending on your use-case, you may run any of the following commands:

# build the library and run all tests
npm run all

# spin up a single local modeler instance
npm start

# run the full development setup
npm run dev

License

MIT

bpmn-js-properties-panel's People

Contributors

alexanderskrock avatar azeghers avatar barmac avatar dependabot[bot] avatar falko avatar felix-mueller avatar hubel avatar jarekdanielak avatar lzgabel avatar marstamm avatar maxtru avatar menski avatar meyerdan avatar mojtaba-khallash avatar nikku avatar oguzeroglu avatar pedesen avatar philippfromme avatar pinussilvestrus avatar polenz avatar prithviraj-maurya avatar renovate[bot] avatar romansmirnov avatar simeon-penev avatar skaiir avatar smbea avatar stanleysweet avatar thorbenlindhauer avatar timstawowski avatar zeropaper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bpmn-js-properties-panel's Issues

I can set the signalRef for a signal event

AT:

Applies to all signal catching and throwing events
I can select an existing signal
I can create a new signal and reference it in one atomic action
I can clear the reference to the signal

I can set the name of a process

AT:

  • using a text input I can set and clear the name of a process
  • the text input is provided when the "isExecutabe" property is provided as well

I can set the retry time cycle for jobs

AT:

  • I can set the retry time cycle for jobs. This includes: asynchronous continuations and timers
  • Special behavior with asynchronous continuations:
    -- if neiter async before nor after are checked, the retry time cycle input field is not shown

Review format of JSDoc

The format of the JSDoc comments may not be up to date with current bpmn.io guideline

AT:

  • format of JSdoc is up to date with current bpmn.io guidelines

Cannot run Testsuite with Phantom-JS

Stack trace:

meyerd@ca-meyerd:~/Documents/Workspace/bpmn-io/bpmn-js-properties-panel$ grunt auto-test
Running "karma:unit" (karma) task
INFO [framework.browserify]: registering rebuild (autoWatch=true)
INFO [framework.browserify]: 4011837 bytes written (5.68 seconds)
INFO [framework.browserify]: bundle built
INFO [karma]: Karma v0.12.36 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket 8ixJ6MzMyRP2fNmNOb8P with id 71225075
PhantomJS 1.9.8 (Linux 0.0.0)  should attach a error to an element with error def FAILED
    TypeError: '[object MouseEventConstructor]' is not a constructor (evaluating 'new MouseEvent(( eventType || 'change' ), {
        view: window,
        bubbles: true
      })')
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:50429:0 <- test/TestHelper.js:21:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:50435:0 <- test/TestHelper.js:27:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:51215:0 <- test/spec/provider/parts/specs/EventPropertiesSpec.js:212:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:29943:0 <- node_modules/diagram-js/node_modules/didi/lib/injector.js:81:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:2722:0 <- node_modules/bpmn-js/lib/Viewer.js:249:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:17178:0 <- node_modules/bpmn-js/test/helper/index.js:202:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:2652:0 <- node_modules/bpmn-js/lib/Viewer.js:179:0
        at importBpmnDiagram (/tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:8954:0 <- node_modules/bpmn-js/lib/import/Importer.js:55:0)
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:2740:0 <- node_modules/bpmn-js/lib/Viewer.js:267:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:2653:0 <- node_modules/bpmn-js/lib/Viewer.js:180:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:9950:0 <- node_modules/bpmn-js/node_modules/bpmn-moddle/node_modules/moddle-xml/lib/reader.js:629:0
        at /tmp/75f72f4d8cdefeda08da2f67b117fd16.browserify:46093:0 <- node_modules/lodash/internal/baseDelay.js:18:0
PhantomJS 1.9.8 (Linux 0.0.0): Executed 1 of 56 (1 FAILED) ERROR (2.291 secs / 0.084 secs)
^C

Incorrect reference update

Affects Reference Combo Box

Problem:
when updating a reference to an element, we currently pass in the id instead of element itself

Create reusable combo box widget for editing references

Widget which can be used in situations where the user has to define a reference. Example: define the reference from a messageEventDefinition to a Message

  • select an existing referncable element
  • create a new element and reference it in one atomic action

I can configure asynchronous continuations for flow nodes

AT:

  • it is possible to configure asynchronous continuations for BPMN flow nodes (as supported by the process engine)
  • support asynchronous continuations before and after flow nodes

Notes:

  • metamodel extension required. The metamodel should control for which bpmn elements the checkbox is provided
  • introduce new factory method for boolean checkbox properties

I can set exclusive for asynchronous continuations

AT:

  • when an asynchronous continuation is configured, I can also set the exclusive attribute.
  • NOTE: the default value of the exclusive attribute is true!
  • If neither async before nor async after are checked, the exclusive checkbox is not shown
  • If at least one of async befrore or async after are checked, the exclusive checkbox is shown

Check IE Compatibility

Check compatibility with internet explorer and compile a list of bugs.

TODO: which internet explorer versions are supported?

Simplify EntryFactory Code

The code in EntryFactory is somewhat confusing. Simplify it. Most importantly, review the use of defaultParameters

I can set the ErrorRef for a error event

  • same as message and signal ...
  • When creating a new error I can only provide the Error name-
  • Both error name and errorCode are displayed (in case the error code exists)

Labels for Property Groups

Properties are organized into groups.

AT:

  • current properties are organized into meaningful groups.
  • the labels of the groups are displayed to the user

I can set Async Before, After on multi instance loop characteristics

AT:

  • if an activity has multi instance loop characteristics, i can set async before and after on the loop characteristics themselves
  • it is still possible to set the properties on the activity

Example:

<serviceTask id=".." camunda:asyncBefore="true">
  <multiInstanceLoopCharacteristics camunda:asyncBefore="true" camunda:asyncAfter="true">
    ...
  </multiInstanceLoopCharacteristics>
</serviceTask>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.