Giter VIP home page Giter VIP logo

angular-bpmn's Introduction

NB / Warning

I see that this project is still being forked and viewed. Please note that this repository is old, not updated, and uses third-party libraries that has since been shown to have multiple vulernabilities. Do not use this code except for inspiration and ideas.

Angular BPMN Sample project

This is a simple project demonstrating how to integrate Angular (5 6 7) with the BPMN-JS components. It is the start of a rewrite of my previous project integrating Angular2 with BPMN-JS: https://github.com/narve/ang2-bpmnjs.

The previous project was created in an ancient period when Angular2 was still hot, and suffered from several problems, chief among them the complicated setup (lots of webpack configuration) and difficulty of upgrading components.

This time around I wanted to use the Angular CLI and as many defaults, standards and conventions as possible. The main objective is to have a simple, standardized solution, making it easy to maintain and upgrade the code.

NB: This project is not affiliated with / created by / endorsed by (etc) Camunda/BPMN.IO or anybody but myself.

Feedback

Feedback is welcome, as issues, pull requests, comments, whatever. Without feedback this project will be left unmaintained.

Documentation

The documentation is kept to a bare minimum in order to avoid out-of-date information. Especially Angular is a moving target.
Consult the documentation for Typescript/Angular/AngularCLI/BPMN-JS. Remember to check that you are viewing the correct version!

To run this project with live-reload etc:

git clone [email protected]:narve/angular-bpmn.git
cd angular-bpmn
npm install
npm start 

Then look at http://localhost:4200.

Or else, to run using plain http-server

npm run build
npx run http-server dist

NB: The prod-mode is currently not working - it builds but fails at runtime.

To run in prod-mode:

npm run start-prod

or

npm run build-prod
npx run http-server dist

Requirements / Tested on

  • Linux (Mint)

  • Windows (plain Powershell, not Git Bash)

  • Linux-On-Windows (WSL)

  • npm v9.2.11 (probably works on other versions)

Features / Status

  • Angular CLI based project (see docs and package.json for exact versions).

  • No installation / setup required, besides node/npm

  • Async loading of a sample BPMN diagram

  • Properties panel

  • Custom properties (extending original)

  • Custom palette (extending original)

  • Surprisingly little actual code (including configuration files!)

  • Hopefully usable as a template / inspiration for actual production use

  • Hopefully as future-proof as any front-end code can be these days

Known bugs / limitations

  • Let me know :)

angular-bpmn's People

Contributors

narve 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

Watchers

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

angular-bpmn's Issues

Sample Project not work

Hello!

I downloaded the sample project, but I can not do a simple test.

When I run the project I can not drag an object on the screen, it has the forbidden icon.

What can I be doing wrong?

bpmn

dmnjs with angular 5

Hi Narve

Thanks for sharing your bmnjs integration with Angular5. I am using this as reference to integrate dmn-js. But I am struggling on how to inject DmnJS module into my app component since dmnjs doesn't have types. I would appreciate if you can give me some pointers on how can similarly include dmn-js?

Thank you.

Implement i18n

Hellow!
what is the best way to implement component translation?

Override default palette entries with custom palette entries

Hello, i was looking to add palette events in CustomPaletteProvider, you gave us an example to add custom entry (SAVE) and event listener.
But in my case, i'm looking to override default palette entries, for eg: start, end, data-store palette entries in CustomPaletteProvider.ts, could you provide a sample, your help is so needful.

Thanks in advance

Modular id __implicitroot already exists

Hi Narve, You did awesome work on the camuda Bpmn part, i am appreciate your work and i amd also doing same like you Right now i ma using the Angular5 project i need to embedded the modular with the Angular5 tpm package and start the project , Project started successfully, But while creating the Modular its through the Error , like Id already exists,so i can't able to create the Module Could you tell me How to Resolve the Issue. its through the Error , like Id already exists,so i can't able to create the Module Could you tell me How to Resolve the Issue.
modularcreation_issue

importXML issue(bpmn file angular)

Hi.I am using bpmn with angular 4.When importing bpmn file and attaching customElements with the modeler i am facing the issue of undefined .The exact error on console is cannot read property ‘modeler’ of undefined The code in ngOnInit is:
` const url = 'assets/bpmn/initial.bpmn';
this.http.get(url, {
headers: {observe: 'response'}, responseType: 'text'
}).subscribe(
(x: any) =>
{
this.modeler.importXML(x, function(err){
if(err){
console.log(err);
}
this.modeler.get('canvas').zoom('fit-viewport');
this.modeler.addCustomElements(customElements);
});

  },`

The code is simple.It basically import bpmn file and after that it attaches he customElements form json file with the xml.This part is important in my case.Attaching customElements with the xml file.My bpmn package version in package.json is
"bpmn-js": “^2.4.1”,

Create Tab according type

First of all, I've being using your project for some while and it is very good, congrats.

Lately I have found a problem when I have to create my custom tab according to the type of the object I'm working with.
For example:
if I select a Task, I need to show tab ABC, and If I select a StartEvent, I need to show tab DEF.
Trying to use element.type but it seems the tab is created before the selection of the object.

Hiding the default tools in palette present in angular-app

Hi.currently i am going trying to customize the palette in angular app in a way that i can hide/block the default tools from the palette.For example 'lasso-tools','hands tools' etc.In the bpmn example given in JS here it is fully possible by using the following code

`function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool, handTool, translate) {

this._palette = palette;
this._create = create;
this._elementFactory = elementFactory;
this._spaceTool = spaceTool;
this._lassoTool = lassoTool;
this._handTool = handTool;
this._translate = translate;

palette.registerProvider(this);
}
`
at first and then in function getPaletteEntries we can just simply provide the list of actions/tools we want in palette in assign function.
But now currently in angular app we are inheriting the class IPaletteProvider as i am figuring out rest of methods.
Any help in this regard is highly appreciated

thanks

BPMN Execute Engine?

I'm new to the BPMN process and still trying things out. Is there a way to execute the diagrams created in angular-bpmn using Angular/TypeScript or maybe NodeJS as execute engine?

Getting error on ng build --prod

im getting the error when doing ng build --prod, the problem with propertiesPanel custom providers. Can i know how can i resolve the issue. I think the issue with minification for properties panel.js file

Erro - Error: No provider for "l"! (Resolving: propertiesPanel -> propertiesProvider -> l)

Bind Form on dropped object

Hi narve,

could you please guide me the steps where i will use double click event on pallate object to bind external form on it.

cant save and load work from locally

Hi.i am running the project on locally.currently i am unable to load the saved work on the project and also could not able to save the work on my computer using the file extension .bpmn .As i am going through the documentation,i have found out that there is a file cycle of saving the xml doc.but its implementation is not present in angular code.The life cycle is following:

  • saveXML.start (before serialization)
  • saveXML.serialized (after xml generation)
  • saveXML.done (everything done)
    I am assuming the working to be similar as https://demo.bpmn.io where users can save and load the work

Thanks

Customizing palette

I need to add an icon to palette and assign a custom behaviour to that icon.

For that purpose I edited CustomPaletteProvider.ts and added a part from bpmn-js-nyan package (https://github.com/bpmn-io/bpmn-js-nyan/blob/master/lib/nyan/palette/NyanPaletteProvider.js)

With my code I can see a new element is already added to palette. But I can't set a baheviour to that item.
My version below this post.

import {IPalette, IPaletteProvider} from "../bpmn-js/bpmn-js";

export class CustomPaletteProvider implements IPaletteProvider {

  static $inject = ['palette', 'originalPaletteProvider'];

  myElementFactory;
  myCreate;

  // Note that names of arguments must match injected modules, see InjectionNames.
  // I don't know why originalPaletteProvider matters but it breaks if it isn't there.
  // I guess since this component is injected, and it requires an instance of originalPaletteProvider,
  // originalPaletteProvider will be new'ed and thus call palette.registerProvider for itself.
  // There probably is a better way.
  constructor(private palette: IPalette, private originalPaletteProvider: IPaletteProvider) {
    // console.log(this.constructor.name, "constructing", palette, originalPaletteProvider);
    palette.registerProvider(this);
	
    this.myElementFactory = originalPaletteProvider._elementFactory;
    this.myCreate = originalPaletteProvider._create;
 }

  getPaletteEntries() {

    function startCreate(event) {
      var serviceTaskShape = this.myElementFactory.create(
          'shape', { type: 'bpmn:ServiceTask' }
      );

      this.myCreate.start(event, serviceTaskShape);
    }


    return {
      save: {
        group: 'tools',
        className: ['fa-save', 'fa'],
        title: 'TEST',
        action: {
          click: () => console.log( 'TEST Action clicked!')
        }
      },
      createservicetask: {
        group: 'tools',
        title: 'TEST3',
        className: ['bpmn-icon-start-event-signal'],
        action: {
          dragstart: startCreate,
          click: startCreate
        }
    }
    };
  }
}

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.