Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ad-hoc subprocess #47

Merged
merged 4 commits into from
Jan 24, 2025
Merged

Add ad-hoc subprocess #47

merged 4 commits into from
Jan 24, 2025

Conversation

jarekdanielak
Copy link
Contributor

Proposed Changes

Add ad-hoc subprocess to menu options and update dependencies.

Related to camunda/camunda-modeler#4739

image

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 via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

@jarekdanielak
Copy link
Contributor Author

The failing test wants Transaction to be the first replace option on an element with transaction template. Do we mind if it's not the first, but just check if it exists in the menu?

image

@philippfromme
Copy link
Contributor

The failing test wants Transaction to be the first replace option on an element with transaction template. Do we mind if it's not the first, but just check if it exists in the menu?

image

I guess we just need to adjust the test case. The order is kind of random. I'd expect the transaction to be the last option after all the *-subprocess options.

@jarekdanielak
Copy link
Contributor Author

Based on RemoveTemplateReplaceProvider#addPlainElementEntry, the "remove template" option goes where a plain element would be. It's not fixed to go to the 0th index.

@jarekdanielak
Copy link
Contributor Author

I think just expecting the plain element to be available in the menu is a viable strategy. (9d237e7)

@barmac
Copy link
Member

barmac commented Jan 24, 2025

It's weird that the entries seem to be in correct order before rendering:
image

@barmac
Copy link
Member

barmac commented Jan 24, 2025

Looks that Object.entries does not respect the object ordering:
image
So it behaves more like a hashmap or a dictionary in Python.

@barmac
Copy link
Member

barmac commented Jan 24, 2025

@barmac
Copy link
Member

barmac commented Jan 24, 2025

OK so the debugger prints something different than the javascript evaluates to:
image

@philippfromme
Copy link
Contributor

How should we go about this? Merge and fix the order later?

Copy link
Contributor

@philippfromme philippfromme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will create a follow-up issue for the order.

@philippfromme philippfromme merged commit aa32656 into main Jan 24, 2025
5 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Jan 24, 2025
@philippfromme philippfromme deleted the ad-hoc branch January 24, 2025 15:01
@barmac
Copy link
Member

barmac commented Jan 24, 2025

I think this is OK.

@barmac
Copy link
Member

barmac commented Jan 24, 2025

@philippfromme I think this problem was caused by a bug in the library. We use "previous option index" to place the remove template action after it. However, if the desired option is at index 1, the previous option is placed at index 0. This is falsy and causes the condition to not be met in the code when it should be.

image

@barmac
Copy link
Member

barmac commented Jan 24, 2025

So the bug must have existed before, but we did not have a test to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants