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

SWF-Editor: Handle multiple setContent calls context #1657

Open
Tracked by #1127
handreyrc opened this issue Dec 2, 2024 · 0 comments
Open
Tracked by #1127

SWF-Editor: Handle multiple setContent calls context #1657

handreyrc opened this issue Dec 2, 2024 · 0 comments
Assignees
Labels
area:sonataflow Related to CNCF Serverless Workflow Spec and SonataFlow area:tools Issues affecting Apache KIE tooling projects

Comments

@handreyrc
Copy link

handreyrc commented Dec 2, 2024

Summary

The goal of this task is to handle workflow's context in the scenarios of loading a workflow for the very first time, reload the workflow, and load a new workflow. It is necessary to keep track of certain information about the workflow in between reloads.

Description

When the setContent is called to set the workflow content to be parsed and then rendered, it is necessary to assertain the following scenarios:

  • It is a new workflow that is being opened for the first time. This condition is met when there is no previous workflow loaded in the current session of the editor or if it is a different workflow being loaded (workflow id).
  • There is a workflow loaded and the we have an updated content for the same workflow ( workflow id).

In the first scenario consider a fresh start for the editor session. If there is a different worflow loaded previously the proper clean ups shall be done berore loading a new workflow.

  • reset zoom ratio to initial values
  • Clear cached node ids
  • Clear Errors stored in the error handler component on every iteration

In the second scenario where new content to the same workflow is being set through setContent the following contexts shall be handled:

  • The node ids shall remain the same after reloading the diagram otherwise we lose track of the previous nodes status, for isntance, reselect the same node from the previous loaded workflow. Use unique node names as key, if it is not possible to locate a node it shall be removed from the cache, it it is a new node a new id shall be generated and the id added to the cache for the next iterations.
  • The zoom reatio and scroll bars shall remain the same after the reload.
  • Errors shall be cleared on every iteration once the new content will be fully evaluated.

Note: Keep in mind that selection and highlight features will depend on this feature once we need to set the same selected node and / or highlited nodes again if the same workflow is reloaded.

Testing

Run the component and reload a new content for the same worlfow from the storybook change the zoom and move the scroll bars. Zoom ratio and bars position shall be preserved in between same workflow reloads.

Dependencies

@handreyrc handreyrc added area:tools Issues affecting Apache KIE tooling projects area:sonataflow Related to CNCF Serverless Workflow Spec and SonataFlow labels Dec 2, 2024
@handreyrc handreyrc self-assigned this Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sonataflow Related to CNCF Serverless Workflow Spec and SonataFlow area:tools Issues affecting Apache KIE tooling projects
Projects
None yet
Development

No branches or pull requests

1 participant