Skip to content

Conversation

@BartChris
Copy link
Collaborator

@BartChris BartChris commented Feb 7, 2025

Fixes #6290
Adresses #6355 (comment)

Additional changes

  • Switch to ViewScoped to prevent having old workflows in the session which migh overwrite another workflow
  • Deletion of old workflow files when the title of a workflow get changed

@BartChris BartChris force-pushed the preserve_workflow_svg_new branch 8 times, most recently from b136949 to f8dd94e Compare February 10, 2025 18:14
@BartChris BartChris force-pushed the preserve_workflow_svg_new branch 2 times, most recently from d587ff6 to a9162be Compare March 4, 2025 14:29
@BartChris BartChris force-pushed the preserve_workflow_svg_new branch from a9162be to cbdf11e Compare March 4, 2025 14:35
@BartChris BartChris closed this Oct 7, 2025
@BartChris BartChris deleted the preserve_workflow_svg_new branch October 7, 2025 15:35
@BartChris BartChris restored the preserve_workflow_svg_new branch October 7, 2025 18:38
@BartChris BartChris reopened this Oct 7, 2025
@thomaslow
Copy link
Collaborator

@BartChris Are you planning to continue working on this? I am working on refactoring all @SessionScoped form classes, which includes the WorkflowForm, see #6456.

@BartChris
Copy link
Collaborator Author

@thomaslow no, please go ahead, i left it open for quite long and do not want to to interfere with your work. I will close.

@BartChris BartChris closed this Dec 11, 2025
@thomaslow
Copy link
Collaborator

@BartChris Alright. I'll try to include some of your improvements in my refactoring if there is time.

I also came across this problematic "duplicate" action again (while changing @SessionScoped to @ViewScoped) and came up with another approach instead of this flash context thingy. I simply added a new view parameter "duplicate=true" in case an object should be duplicated. Do you think this is an appropriate solution or do you see any downsides to that? An example is here:

public void load(int id, Boolean duplicate) {
if (Objects.nonNull(duplicate) && duplicate) {
loadAsDuplicate(id);
} else {
loadById(id);
}
setSaveDisabled(true);
}
/**
* Load an existing ldap group as duplicate such that it can be saved as a new ldap group.
*
* @param id the id of the ldap group that should be duplicated
*/
private void loadAsDuplicate(int id) {
try {
LdapGroup baseLdapGroup = ServiceManager.getLdapGroupService().getById(id);
this.ldapGroup = ServiceManager.getLdapGroupService().duplicateLdapGroup(baseLdapGroup);
} catch (DAOException e) {
Helper.setErrorMessage(ERROR_DUPLICATE, new Object[] {ObjectType.LDAP_GROUP.getTranslationSingular()}, logger, e);
}
}
/**
* Load an existing ldap group for editing.
*
* @param id the id of the ldap group that will be edited
*/
private void loadById(int id) {
try {
if (!Objects.equals(id, 0)) {
this.ldapGroup = ServiceManager.getLdapGroupService().getById(id);
}
} catch (DAOException e) {
Helper.setErrorMessage(ERROR_LOADING_ONE, new Object[] {ObjectType.LDAP_GROUP.getTranslationSingular()}, logger, e);
}
}

@BartChris
Copy link
Collaborator Author

Sounds good i would say on first take, especially if it simplifies the logic on form setup. I think this check for the flash context is a little bit cumbersome.

@BartChris BartChris reopened this Dec 11, 2025
@BartChris
Copy link
Collaborator Author

I will maybe keep it as draft, so this does not get lost, but let you do your work uninterrupted.

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.

Empty .svg worfklow file, if workflow saved without changes

2 participants