Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Collapsed subprocess paste & undo bugfix#2275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
jarekdanielak wants to merge4 commits intodevelop
base:develop
Choose a base branch
Loading
fromsubprocess-fix

Conversation

jarekdanielak
Copy link
Contributor

@jarekdanielakjarekdanielak commentedJan 17, 2025
edited
Loading

Problem

If you copy & paste a collapsed subprocess with some elements inside and try to undo this action, editor crashes.

Root cause

When a collapsed subprocess is pasted,elements.create command is triggered and triggers following actions:

  1. shape.create for a new subprocess element.
  2. elements.move for subprocess children (triggered post-shape.create by `SubProcessPlaneBehavior)
  3. shape.create for each child.

When this action is being undone, subprocess children are first removed (revertshape.create) and then are attempted to be moved back to their original parent/position (revertelements.move) which doesn't make sense as those elements are already removed.

Proposed solution

I believe the correct implementation of subprocess plane behavior should move the elements onto the new plane after they are all created, so onpostExecuted ofelements.create instead ofshape.create.

This pull requests does it and therefore solve the paste & undo bug.

New problem

Unfortunately, the subprocess element in thecontext ofelements.create handler doesn't have all its children. It's missing labels and text annotations. Those elements are still copied, but remain hidden on the root plane.

Additional context

Initial discussion and debugging session:bpmn-io/diagram-js#957 (comment).

Closes#2269

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e.using the@bpmn-io/sr tool
  • Related issue linked viaCloses {LINK_TO_ISSUE} orRelated to {LINK_TO_ISSUE}

@jarekdanielakjarekdanielak marked this pull request as draftJanuary 17, 2025 20:03
@bpmn-io-tasksbpmn-io-tasksbot added needs reviewReview pending in progressCurrently worked on and removed needs reviewReview pending labelsJan 17, 2025
@jarekdanielak
Copy link
ContributorAuthor

I've spent some more time debugging this and updated the top comment with my latest conclusions.

The proposed solution of moving children elements afterelements.create looks like the most sane way of implementing this behavior, but I still have some questions:

  • In the current implementation ofSubProcessPlaneBehavior, why isshape.create executed for each pasted subprocess child, even though they seem to be already available in the post-shape.create of the subprocess element?
  • Why are all the children available in the context ofshape.create, but not in the context ofelements.create?

I'd like to come back to this in a paired debugging session. cc.@barmac@nikku

barmac reacted with thumbs up emoji

@nikku
Copy link
Member

@jarekdanielak It seems like this PR stalled, and we did not get time to look into it. I'm moving it (and the linked issue) tobacklog.

jarekdanielak reacted with thumbs up emoji

@nikkunikku added backlogQueued in backlog and removed in progressCurrently worked on labelsApr 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@jarekdanielakjarekdanielak

Labels
backlogQueued in backlog
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Copy + Paste and then Undo Collapsed Sub process throws JS Errors
2 participants
@jarekdanielak@nikku

[8]ページ先頭

©2009-2025 Movatter.jp