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

Workflow curation incorrect nesting causes multiple applications of the same task per object. #9496

Open
mwoodiupui opened this issue Apr 23, 2024 · 0 comments · May be fixed by #9497
Open
Assignees
Labels
bug component: workflow Related to approval workflow or configurable workflow help wanted Needs a volunteer to claim to move forward
Milestone

Comments

@mwoodiupui
Copy link
Member

Describe the bug
Code in org.dspace.curate.XmlWorkflowCuratorServiceImpl is incorrectly nested. We should first fill the Curator with Tasks and then queue or curate the object. What we're actually doing is curating the object once for each Task in the taskset of the Step as Tasks are added to the Curator. The comment is wrong too: it is the Step that has a queue, not each Task.

for (Task task : step.tasks) {
curator.addTask(task.name);
// Check whether the task is configured to be queued rather than automatically run
if (StringUtils.isNotEmpty(step.queue)) {
// queue attribute has been set in the FlowStep configuration: add task to configured queue
curator.queue(c, item.getID().toString(), step.queue);
} else {
// Task is configured to be run automatically
curator.curate(c, item);
int status = curator.getStatus(task.name);

To Reproduce
Unknown at this time, but the code is clearly wrong. Probably just set up a workflow step with two tasks, submit an item through that workflow, and observe double execution of one of the tasks by inspecting the log.

Expected behavior
The tasks attached to a workflow step should each be run only once over the workflow item whenever the step is entered.

@mwoodiupui mwoodiupui added bug component: workflow Related to approval workflow or configurable workflow needs triage New issue needs triage and/or scheduling labels Apr 23, 2024
@tdonohue tdonohue added help wanted Needs a volunteer to claim to move forward and removed needs triage New issue needs triage and/or scheduling labels Apr 23, 2024
@tdonohue tdonohue added this to the 7.6.2 milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component: workflow Related to approval workflow or configurable workflow help wanted Needs a volunteer to claim to move forward
Projects
Status: 🏗 In Progress
Development

Successfully merging a pull request may close this issue.

2 participants