Skip to content

Conversation

@kskaiser
Copy link

@kskaiser kskaiser commented Dec 15, 2025

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:

  • First, the implementation was changed to get check for each possible workflow step of a collection a group is defined. If a group is defined and it's not empty, the check returns true.
  • Second, the methods definition in the interface was changed, because the new implementation does not throw an exception.
  • Third, a new integration test was implemented testing all possible configurations.
    The new test is XmlWorkflowItemServiceIT. Run it:
mvn install -DskipIntegrationTests=false  -DfailIfNoTests=false -Dit.test=XmlWorkflowItemServiceIT

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!

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & integration tests). Exceptions may be made if previously agreed upon.
  • My PR passes Checkstyle validation based on the Code Style Guide.
  • My PR includes Javadoc for all new (or modified) public methods and classes. It also includes Javadoc for large or complex private methods.
  • My PR passes all tests and includes new/updated Unit or Integration Tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in any pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR modifies REST API endpoints, I've opened a separate REST Contract PR related to this change.
  • If my PR includes new configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

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>
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.

[Request a Correction] isWorkflowConfigured method does not work on migrated (<7.x) groups

1 participant