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 process applications feature #4762

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft

Conversation

philippfromme
Copy link
Contributor

@philippfromme philippfromme commented Dec 16, 2024

Proposed Changes

Backend

  • adds file-context feature
    • all open files are added to file context
    • metadata is extracted from every supported file type (.bpmn, .dmn, .form, .process-application)
    • process application is opened/closed automatically if opened/closed file is part of process application
    • opening process application watches process application directory

Frontend

  • ProcessApplications feature to open and close process applications automatically
  • new application menu entry to create process application
    • choose directory, empty .process-application file will be created

image

  • new (➕) entry to create process application
  • works the same as new application menu entry

image

  • new button in status bar that is shown when open file is part of process application

image

  • new overlay that shows all files that are part of same process application as open file

image

  • different tab header for files that are part of process application

image

Try it out

I've added an example process application: a354d21

Open any file in this directory to see the process application.

To run the Camunda Modeler try npm install && npm start

Follow-ups

Closes #4666
Closes #4675
Closes #4687
Related to #4676
Related to #4664

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}

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Dec 16, 2024
@@ -1136,8 +1134,7 @@ export class App extends PureComponent {
if (
activeTab !== prevState.activeTab ||
tabs !== prevState.tabs ||
layout !== prevState.layout ||
endpoints !== prevState.endpoints
Copy link
Member

@nikku nikku Dec 16, 2024

Choose a reason for hiding this comment

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

This will be used (again) once we support "endpoints" for deployment.

Why would we remove it here?

Copy link
Member

Choose a reason for hiding this comment

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

(Of course fine, if we consider to store the endpoints in a different place, once supported).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it because it's not used at all at the moment and was probably meant to be removed. I would rather reintroduce it again in the context of adding a feature that requires it.

Copy link
Member

Choose a reason for hiding this comment

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

We just have to be aware that this is "the data model" that was previously used. We can remove it, but then we'll not remember the data model once we re-introduce an endpoints feature.

@nikku
Copy link
Member

nikku commented Jan 6, 2025

@philippfromme Please add "steps to try out" to this PR, so @lmbateman and others can give it a run (to understand the UX we propose).

@philippfromme philippfromme force-pushed the process-applications branch 4 times, most recently from 5350340 to cbc64dc Compare January 10, 2025 15:15
@philippfromme philippfromme marked this pull request as ready for review January 10, 2025 15:21
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Jan 10, 2025
@philippfromme philippfromme changed the title Process applications App process applications feature Jan 10, 2025
@philippfromme philippfromme changed the title App process applications feature Add process applications feature Jan 10, 2025
@jarekdanielak
Copy link
Contributor

jarekdanielak commented Jan 15, 2025

Overall works fine on macOS! 👏

Perhaps if we can now create and open an application process, we could use an option to close it? Similar to close active/all/other tabs:
image

@philippfromme
Copy link
Contributor Author

Perhaps if we can now create and open an application process, we could use an option to close it? Similar to close active/all/other tabs:

You mean Close process application would close all files belonging to the open process application? Interesting idea I haven't thought about. 🤔

@jarekdanielak
Copy link
Contributor

You mean Close process application would close all files belonging to the open process application?

Exactly. 😊

@jarekdanielak
Copy link
Contributor

jarekdanielak commented Jan 15, 2025

When I try to deploy a file from a process application, the modeler just reloads.

Same thing happens when I save a file. Both only happens to files in a process application, the rest works normally.

Screen.Recording.2025-01-15.at.11.56.30.mov

@philippfromme
Copy link
Contributor Author

When I try to deploy a file from a process application, the modeler just reloads.

Same thing happens when I save a file. Both only happens to files in a process application, the rest works normally.

Screen.Recording.2025-01-15.at.11.56.30.mov

This happens becasue the modeler reloads when something in resources changes. 🙈 Opening a process application outside will prevent this.

@barmac
Copy link
Collaborator

barmac commented Jan 15, 2025

I've added the bpmn/dmn-moddle libraries to the app so that a built application can run: 70f0555

@barmac barmac force-pushed the process-applications branch from 70f0555 to 1653967 Compare January 15, 2025 15:45
@barmac

This comment was marked as resolved.

@barmac
Copy link
Collaborator

barmac commented Jan 15, 2025

I'll try to help with this one.

@barmac

This comment was marked as resolved.

@barmac
Copy link
Collaborator

barmac commented Jan 15, 2025

@philippfromme were you able to run a local build of this? So the one from npm run build.

On my machine, the build job results in the source code of dmn-moddle being included in the asar. This is not coming from node_modules where the package is installed correctly.

To verify the build, besides running the app, you can execute this command for MacOS:
npx asar list dist/mac-arm64/Camunda\ Modeler.app/Contents/Resources/app.asar | grep dmn-moddle
This should show dist in the list. Not sure how to do it on Windows.

@jarekdanielak
Copy link
Contributor

Creating a variable on any task in BPMN model with Variables panel open (or opening it after) crashes.

Screen.Recording.2025-01-15.at.17.36.50.mov

@jarekdanielak
Copy link
Contributor

@barmac I was able to successfully build locally and run the app. Hit me up if you want to test stuff.

@barmac
Copy link
Collaborator

barmac commented Jan 16, 2025

OK so it seems to be my local configuration problem. It's not a blocker in that case.

@philippfromme philippfromme marked this pull request as draft January 17, 2025 13:52
@bpmn-io-tasks bpmn-io-tasks bot added in progress Currently worked on and removed needs review Review pending labels Jan 17, 2025
@philippfromme
Copy link
Contributor Author

Converted back to draft. Based on the discussion with @barmac I will make some changes to the implementation:

  • try to make process applications (or at least its UI) a plugin
  • add the ability for plugins to register actions instead of having to hard-code them in App.js
  • try not to pollute the global state in App.js with state only relevant for process applications

image

Miro: https://miro.com/app/board/uXjVPmTBc04=/?share_link_id=716131412171

@barmac
Copy link
Collaborator

barmac commented Jan 23, 2025

@philippfromme Let's look into this today so that we can merge for the current release.

I checked out the UI today, and I think having "New process application" on top of Cmd+N menu is suboptimal, because this is the action that I'd rather not expect to happen that often. We create a process application once, and then add multiple diagrams.

@barmac barmac force-pushed the process-applications branch from 1653967 to ca50db7 Compare January 24, 2025 09:44
@lmbateman
Copy link

I haven't had time to do a full review, but here are some initial thoughts/findings:

  • When I select File > New Process Application and then select a folder, there’s no confirmation that my process application has been created. I wasn’t sure if it had been, so I tried File > New Process Application again and tried to select a file inside the folder, but they were all grayed out. I wasn’t sure if my process application had been created until I opened one of the files and saw the process application icon in the bottom left corner. I found this process a little confusing.
  • Would it be helpful to have an Open All command in the popup that lists the process application files? (But I see it stays open even after I click on a filename, so maybe we don’t need Open All.)
  • It might be helpful to have the folder name as the header in the popup, instead of “Process Application”.
  • I made my Downloads folder a process application, and apparently the popup doesn’t scroll. :D

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Currently worked on
Projects
None yet
5 participants