bpmn-io / bpmn-js

A BPMN 2.0 rendering toolkit and web modeler.
https://bpmn.io/toolkit/bpmn-js/
Other
8.55k stars 1.32k forks source link

Vertical Pools and Lanes Modeling #507

Open lisps opened 8 years ago

lisps commented 8 years ago

Introduction

Modeling of vertical pools and lanes is a feature request we see once in a while. It is also part of the MIWG test suite, case A.4.1 specifically. While we do not want to promote vertical modeling in general, we should support it under the hood.

Breakdown


Referenced in forum.

gimbel commented 8 years ago

At the moment vertical pools are not possible.

Are you interested in providing a pull request for that?

lisps commented 8 years ago

my rescourses are limited, would it be much work?

gimbel commented 8 years ago

Well, I guess it will require some effort, also in order to get into the project

matthiasg commented 8 years ago

We might be interested in any looking at doing this. Can anybody from core same give some pointers?

nikku commented 8 years ago

Sorry for not getting back to you earlier. Did you already have the chance to get familiar with diagram-js/bpmn-js?

matthiasg commented 8 years ago

No. We have a customer requiring vertical lanes, but we are currently trying to gauge how much of a hard requirement it really is. I have extensive experience doing similar graphs in our own apps though.

lisps commented 8 years ago

@matthiasg has you worked on this?

nikku commented 6 years ago

This is not on our roadmap. If someone wants to contribute --- we accept PRs.

matthiasg commented 6 years ago

@lisps no, customer prioritized poster print support instead.

btw: I did not see your comment until now. sorry for that

nikku commented 6 years ago

We'll not support vertical collaboration, unless we receive a contribution for it.

Related we may implement proper rendering of vertical pools (https://github.com/bpmn-io/bpmn-js/issues/57) some time maybe.

sombrek commented 9 months ago

@nikku I'd like to contribute to this feature.

I think I can implement resizing via drag&drop and using the space tool. Is that an acceptable scope for an increment?

nikku commented 9 months ago

@sombrek As an initial step I'd suggest you to see what is currently broken, and summarize it here. We can then go ahead and give you pointers where to fix things.

sombrek commented 9 months ago

@nikku Here's a summary of what I've got so far.

Resize Issue Demonstration ![pool-issues-resize](https://github.com/bpmn-io/bpmn-js/assets/150448993/165951ba-e786-4a5e-9bb6-a88d8f9c996c)

I also noticed some existing quirks for horizontal pools and I would like your input on this.

I have identified lib/features/modeling/behavior/ResizeBehavior.js, lib/features/modeling/behavior/SpaceToolBehavior.js, and maybe lib/features/modeling/util/LaneUtil.js as startig points for an implementation.

Other areas of work:

I think full support also needs new icons...

... and new translatable texts. In both cases I don't know the extra work that might be required.

philippfromme commented 9 months ago

You've done a good job identifying most aspects of making vertical pools work. As you can see, there are many. I'd suggest starting with the smallest possible increment, which I think would be:

For that, I'd suggest creating a separate issue to track this so this issue can serve as the epic. I've updated the description of this issue to include a full breakdown of everything we have to account for. We can start ticking off these boxes one by one.

What do you think?

sombrek commented 5 months ago

There was a lot of progress regarding this feature.

All tasks in "vertical pools and lanes can be updated" should work now, except for "pools can be switched between horizontal and vertical". There haven't been any UI updates to reflect this feature.

"Vertical modeling is enabled in vertical pools", i.e. auto-place does work. However, it is not perfect yet, due to issue #2127. Moreover, some minor features were adjusted to consider vertical pools (e.g. hit boxes).

I'm giving this update, because some time may pass until my next contribution. Thanks for all your kind and helpful support.

barmac commented 5 months ago

Thank you for your amazing work on this epic. I updated the top comment according to the progress delivered.

nikku commented 5 months ago

@sombrek Some amazing contributions, indeed, thank you! Will make some users happy :cake: :1st_place_medal:

rip222 commented 5 months ago

@sombrek This is amazing! Looking forward to creating pools and lanes. Been waiting for it for years.

Also what is the progress on these two things and how can I help?

sombrek commented 5 months ago

@rip222 At the moment there will be no progress from my side.

If you simply want to add a vertical pool to your diagram, I recommend the steps I described in the forum. Once your pool is vertical, most existing features will work as expected.

If you'd like to try implementing more features, here are some starting points.

I'm not 100 % sure, but to create vertical pools via code, you would have to extend the ElementFactory so that you can set the isHorizontal attribute accordingly. https://github.com/bpmn-io/bpmn-js/blob/abd8c6c1c2435576b5b8b24275405ba32cc51927/lib/features/modeling/ElementFactory.js#L337-L351

To create pools using the modeler, you might have (in addition to the above) create a plugin that provides this feature as an extension of the PaletteProvider. I say plugin, because the maintainers may not want this feature available by default.

Regarding updating: You'd have to write new code that translates horizontal pools and lanes into vertical ones (and vice versa), but not their content (at least not as part of the first iteration). This could be made available in the ContextPadProvider (possibly as a plugin as well).

If you want to pick up any of this, simply create an issue to get in contact with the maintainers. You can see examples of how I did it in some of the linked issues above my previous post.

nikku commented 5 months ago

@sombrek Thanks for the guidance :heart:

@rip222 As a maintainer I fully subscribe to https://github.com/bpmn-io/bpmn-js/issues/507#issuecomment-2088490846.

Specifically, whether you want to model vertically or horizontally may be a decision that you take upfront (editor setting, or that is inferred from the context; we do not aim to provide you the option to switch back and forth during editing in the out-of-the-box experience.