-
Notifications
You must be signed in to change notification settings - Fork 19
Fixing task trees
When the task tree cannot be restored to the correct state by actions available to Caseflow users (like cancelling a task), the Caseflow application development team can manually correct the state of the task tree. Examples of occasions when manual intervention was needed and the steps we took to correct the task tree are below.
A member of the hearings branch reached out to support to report that they had accidentally cancelled a ScheduleHearingTask
and wanted it returned to their queue so they could properly schedule a hearing for that case (link to the related Slack conversation). Because the case had already been distributed to a judge we could not simply re-open the previous ScheduleHearingTask
. Instead we closed the existing JudgeAssignTask
and followed the model laid out in InitialTasksFactory.create_subtasks!
to create a new distribution task with the appropriate hearing tasks.
Full details below:
rails c> legacy_appeal = LegacyAppeal.find_by(vacols_id: 3075566)
rails c> veteran = legacy_appeal.veteran
rails c> appeal = Appeal.find_by(veteran_file_number: veteran.file_number)
rails c> puts appeal.structure_render(:id, :status, :created_at, :closed_at)
# Appeal 18410
└── RootTask 330761, on_hold, 2019-08-14 17:36:04 UTC, (closed_at)
├── TrackVeteranTask 330763, in_progress, 2019-08-14 17:36:05 UTC, (closed_at)
├── DistributionTask 330764, completed, 2019-08-14 17:36:05 UTC, 2019-08-20 13:30:39 UTC
│ └── HearingTask 330765, completed, 2019-08-14 17:36:05 UTC, 2019-08-19 21:30:15 UTC
│ ├── ScheduleHearingTask 330766, cancelled, 2019-08-14 17:36:05 UTC, 2019-08-19 17:40:07 UTC
│ └── EvidenceSubmissionWindowTask 338211, completed, 2019-08-19 17:40:07 UTC, 2019-08-19 21:30:15 UTC
└── JudgeAssignTask 339679, assigned, 2019-08-20 13:30:39 UTC, (closed_at)
rails c> judge = JudgeAssignTask.find(339679).assigned_to
# Reach out to judge first before resetting the state of this appeal
rails c> distribution_task = DistributionTask.create!(appeal: appeal, parent: appeal.root_task)
rails c> ScheduleHearingTask.create!(appeal: appeal, parent: distribution_task)
rails c> JudgeAssignTask.find(339679).update!(status: Constants.TASK_STATUSES.cancelled)
# Are we in the correct state?
rails c> puts appeal.structure_render(:id, :status, :created_at, :closed_at)
# Appeal 18410
└── RootTask 330761, on_hold, 2019-08-14 17:36:04 UTC, (closed_at)
├── TrackVeteranTask 330763, in_progress, 2019-08-14 17:36:05 UTC, (closed_at)
├── DistributionTask 330764, completed, 2019-08-14 17:36:05 UTC, 2019-08-20 13:30:39 UTC
│ └── HearingTask 330765, completed, 2019-08-14 17:36:05 UTC, 2019-08-19 21:30:15 UTC
│ ├── ScheduleHearingTask 330766, cancelled, 2019-08-14 17:36:05 UTC, 2019-08-19 17:40:07 UTC
│ └── EvidenceSubmissionWindowTask 338211, completed, 2019-08-19 17:40:07 UTC, 2019-08-19 21:30:15 UTC
├── JudgeAssignTask 339679, cancelled, 2019-08-20 13:30:39 UTC, 2019-09-09 14:42:25 UTC
└── DistributionTask 387249, on_hold, 2019-09-09 14:42:19 UTC, (closed_at)
└── HearingTask 387251, on_hold, 2019-09-09 14:42:21 UTC, (closed_at)
└── ScheduleHearingTask 387252, assigned, 2019-09-09 14:42:21 UTC, (closed_at)
# Looks good!
- Home
- Acronyms and Glossary
- Caseflow products
- Caseflow Intake
- Caseflow Queue
- Appeals Consumer
- Caseflow Reader
- Caseflow eFolder
- Caseflow Hearings
- Caseflow Certification
- Caseflow APIs
- Appeal Status API
- Caseflow Dispatch
-
CSUM Roles
- System Admin
- VHA Team Management
- Active Record Queries Resource
- External Integrations
- Caseflow Demo
- Caseflow ProdTest
- Background
- Stuck Jobs
- VA Notify
-
Caseflow-Team
- Tier 4
- Bat Team
- Technical Documentation
- Backend Code Patterns
- Backend Working Group
- FACOLS, VACOLS DB Schema
- Asyncable Models
- External Data: where and why
- Data Fetching Scripts
- Caseflow Data Model and Dictionary
- User Access Permissions
- Controller Schemas
- Constants
- Frontend Best Practices
- Accessibility
- How-To
- Debugging Tips
- Adding a Feature Flag with FeatureToggle
- Editing AMA issues
- Editing a decision review
- Fixing task trees
- Investigating and diagnosing issues
- Data and Metric Request Workflow
- Exporting and Importing Appeals
- Explain page for Appeals
- Record associations and Foreign Keys
- Upgrading Ruby
- Stuck Appeals
- Testing Action Mailer Messages Locally
- Re-running Seed Files
- Rake Generator for Legacy Appeals
- Manually running Scheduled Jobs
- System Admin UI
- Caseflow Makefile
- Upgrading Postgresql from v11.7 to v14.8 Locally
- VACOLS VM Trigger Fix M1
- Using SlackService to Send a Job Alert
- Technical Talks