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

Workflows still show up in Approvals when no longer needed #636

Closed
cullerton opened this issue Jan 13, 2025 · 1 comment
Closed

Workflows still show up in Approvals when no longer needed #636

cullerton opened this issue Jan 13, 2025 · 1 comment

Comments

@cullerton
Copy link
Collaborator

No description provided.

@cullerton
Copy link
Collaborator Author

Approvals are a type of task_event.

They are associated with workflows that have lanes. The lanes are named 'Approvers'.
Approvals are also linked to a specific document. If that document is required, then we display the approval workflow.

This is determined in PB.
Our test is whether study_info['documents'][the_document_name]['required'] is True

If an approval is necessary, a corresponding task_event can be found for each of the approvers.
query = (db.session.query(TaskEventModel)
.filter(TaskEventModel.study_id == study_id)
.filter(TaskEventModel.action == TaskAction.ASSIGNMENT.value)
.filter(TaskEventModel.workflow_spec_id == workflow_spec_id))

For some approvals, if a change is made in PB so that the approval is no longer necessary, we don't clean up the task events for the approvers.

So, they still see the stale approval request on their dashboard.

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

No branches or pull requests

1 participant