Fix: Determine workflow configuration by checking group assignment#535
Fix: Determine workflow configuration by checking group assignment#535kskaiser wants to merge 1 commit into
Conversation
The `isWorkflowConfigured` method previously relied on comparing the workflow group object's name against expected string values. This caused issues with migrated data where workflow group names did not follow the naming conventions of the new DSpace version, leading to incorrect workflow configuration detection. This commit updates the implementation to be independent of group names entirely. It now directly checks for the existence of a configured workflow group object that is assigned to a specific collection's workflow step. This ensures correct workflow status determination for both newly created and migrated collections. A new test class with integration tests is added to test the `XmlWorkflowItemService.isWorkflowConfigured` method. fixes 4Science#534 Signed-off-by: Katharina Kaiser <katharina.kaiser@tuwien.ac.at>
vins01-4science
left a comment
There was a problem hiding this comment.
Changes looks good to me.
I would like to perform some more testing about this PR, and I will try to merge it as soon as possible!
Thank you @kskaiser!
|
Hi @kskaiser , thanks for this contribution. After some more discussion, I think it would be better to open this PR against the main https://github.com/DSpace/DSpace repository, so it can be discussed and included in the upstream code, while merger activity is still on-going. The only other thing that occurred to me as I looked at the change, is to make sure that this does not return a false negative for any modern custom workflow configurations that use role names but do not have the legacy "step" integer IDs. |
|
Thank you, @kshepherd. This code is DSpace-CRIS specific. It is part of the “Request a correction” feature, which is not available in upstream DSpace (yet). My understanding is that this functionality would eventually be covered by DSpace issue #11794, but that issue is not currently planned. Therefore I don’t think this change can be proposed against the upstream repository at this time. Regarding your second point: the proposed implementation does not rely on the legacy workflow “step” integer IDs. Instead, it checks the workflow configuration stored in table "cwf_collectionrole", using the collection UUID and the assigned EPersonGroup UUIDs. In other words, it determines whether workflow groups are actually configured for the collection, rather than inferring that from the names of EPersonGroups. This means it also works with modern custom workflow configurations where group names do not follow the legacy naming pattern. |
References
Description
XMLWorkflowItemService#isWorkflowConfigured uses a pattern-based approach for identifying potential groups by name that would allow to edit/review an item. This does not work for migrated configurations <7.x; they use a different pattern. Furthermore, the existence of a group with a matching name says nothing about whether a workflow is actually configured for the collection.
Instructions for Reviewers
List of changes in this PR:
true.The new test is
XmlWorkflowItemServiceIT. Run it:Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.