Code Monkey home page Code Monkey logo

camunda-modeler-plugin-example's Introduction

Camunda Modeler Plugin Example

Compatible with Camunda Modeler version 5 Plugin Type

This example serves as a starting point for creating your own plugin for the Camunda Modeler.

Development Setup

Use npm, the Node.js package manager to download and install required dependencies:

npm install

To make the Camunda Modeler aware of your plugin you must link the plugin to the Camunda Modeler plugin directory via a symbolic link. Available utilities to do that are mklink /d on Windows and ln -s on MacOS / Linux.

Re-start the app in order to recognize the newly linked plugin.

Building the Plugin

You may spawn the development setup to watch source files and re-build the client plugin on changes:

npm run dev

Given you've setup and linked your plugin as explained above, you should be able to reload the modeler to pick up plugin changes. To do so, open the app's built in development toos via F12. Then, within the development tools press the reload shortcuts CTRL + R or CMD + R to reload the app.

To prepare the plugin for release, executing all necessary steps, run:

npm run all

Before you Publish

  • Clearly state which Camunda Modeler version your plugin is compatible with and which type of plugin it is by changing the badges at the top of this README. See best-practice examples below.
  • Ensure you renamed the bpmn-js extension from PLEASE_CHANGE_ME to something unique
  • Ensure you've removed the menu and style folders as well as their references in ./index.js if you do not need them

Badges to indicate typical plugin types

Badge Markdown
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-BPMN-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-BPMN_(Camunda_Platform_7)-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-BPMN_(Camunda_Platform_8)-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-BPMN_Moddle-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-BPMN_Moddle_(Camunda_Platform_7)-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-BPMN_Moddle_(Camunda_Platform_8)-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-DMN-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-DMN_Moddle-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-React-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-Styles-orange.svg)](#)
Plugin Type [![Plugin Type](https://img.shields.io/badge/Plugin_Type-Menu-orange.svg)](#)

Additional Resources

Licence

MIT

camunda-modeler-plugin-example's People

Contributors

dependabot[bot] avatar ingorichtsmeier avatar nikku avatar philippfromme avatar skaiir avatar

Stargazers

 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

camunda-modeler-plugin-example's Issues

Problems when rendering some items depending on project/react config

Describe the Bug

Problems when rendering stuff (htmls... svgs...) when having both Client plugin and Pallete (or any other) Provider plugin.

Steps to Reproduce

https://github.com/billbarni/camunda-modeler-plugin-react-test

1 - add project dir to your modeler resources/plugin dir
2 - npm i in project dir
3 - npm run dev in project dir
4 - open modeler and create new Cam 7 BPM

You can see that the Pallete of Camunda Modeler is not able to render the icon correctly.

client/pallete/user-palette-provider.js - lines 22 to 37.

Expected Behavior

IconContext.Provider from react-icons to work... or to ReactDOMServer.renderToString to work...
Or some other way of converting the React icon to HTML inside the modeler plugin

I tried using preact-render-to-string, but it works only with some other bizarre Webpack config, and when it works... the "client" plugin stops working.

Environment

  • OS: Windows 10
  • Camunda Modeler Version: 5.9.0

Make sure people rename client plugin module to something else than 'clientPlugin'

People often are not aware of the fact that the name of the bpmn-js module matters (e.g. modules with same name will override others). If they create two plugins without renaming the module they'll wonder why only one of them works.

module.exports = {
  __init__: [ 'clientPlugin' ],
  clientPlugin: [ 'type', ClientPlugin ] // must be renamed
};

Update for Camunda Modeler 4.0+?

We have written several plugins for 3.x, but are looking to upgrade our base modeler that we ship the plugins with. The 4.x upgrade bumped the version of electron significantly and seems to have changed the requirements for plugin development.

Would it be possible to upgrade this plugin example to work with 4.x?

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.