Skip to content

CAP-PFM-DJE-004Interrupt a job and recover its unfinished work

Markdown

CAP-PFM-DJE-004

Interrupt a job and recover its unfinished work

Markdown
  • DocumentDraft
  • Product intentConfirmed
  • ImplementationObserved

KindCapabilityProduct areaPlatformModuleData Job EngineRevision1

Read atmacroservice-libraries 54536a44services-crm a8d1364freact-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Interruption takes effect between batches.Cancellation distinguishes committed records from work never attempted.Blocked dependencies can be retried after they arrive.
Surfaces
consoleapi
Intent sources
services-platform:docs/milestones/plans/PLAT-M19-plan.md#S06services-platform:docs/milestones/plans/PLAT-M19-plan.md#S15services-crm:docs/milestones/CRM-M7-data-operations.md#D-39

Controls

26 controls apply, from the corpus control catalogue.

TC-AVL-001 TC-AVL-004 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-DAT-001 TC-DAT-003 TC-IAM-001 TC-IAM-006 TC-LOG-004 TC-LOG-005 TC-MON-001 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-004 TC-PI-005 TC-PRV-001 TC-PRV-002 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-VEN-001 TC-VEN-002 TC-VEN-003

Permissions

KeyChecked atScope
crm.contacts.bulkapitenant
crm.organizations.bulkapitenant
data.jobs.controlconsoletenant

Business Rules

8 rules, 7 to be proved before approval. A rule's product intent is derived from its origin: 8 confirmed by a product decision, the rest inheriting this capability's confirmed.

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Job state changes follow the declared transitions; final states have no outgoing transition except the supported retry of completed work containing blocked items.
lifecycleservicetest
macroservice-libraries:packages/data-jobs/src/data-job-states.spec.ts#leaves every final state with nowhere to go, but for the retry of blocked items the plan allows
02must prove
Confirmed
Pause and cancel prevent later batches from starting while in-flight work settles; committed changes remain, and cancellation reports unattempted records.
lifecycleservicetest
services-crm:modules/data-jobs/tests/integration/services/jobs/contact-data-jobs.integration.spec.js#ends the job cancelled, not failed, once the batch it waited for has finished
03must prove
Confirmed
Resume queues unfinished batches again, including a file job paused before source reading began.
lifecycleservicetest
macroservice-libraries:packages/data-jobs/src/tests/integration/bulk-data-jobs.integration.spec.ts#holds a job paused before its source was read, and runs it to the end once resumed
04must prove
Confirmed
Retry recovers transiently failed batches or a completed job’s blocked items; rejected and conflicted items require a correcting job.
policyservicetest
macroservice-libraries:packages/data-jobs/src/tests/integration/keyed-data-jobs.integration.spec.ts#refuses to retry a job whose refusals are not blocked items, because correcting records is a new job
05must prove
Confirmed
Once a rollback has been applied, the original job refuses retry so blocked items cannot be written after restoration.
policyservicetest
macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses to retry a job that has been rolled back, so its blocked rows are not written after the undo
06must prove
Confirmed
Job controls require the route’s permissions; the console hides controls from unauthorized users and the backend refuses their requests.
permissionapi, consoledocumented
services-crm:docs/data-jobs.md#What a job may be asked now: `actions` (D-39)
07must prove
Confirmed
A failed bulk workflow marks its job failed with the cause and abandons unstarted batches as unattempted.
lifecycleservicetest
services-crm:modules/data-jobs/tests/integration/services/jobs/bulk-data-job-failure.integration.spec.js#fails the data job, so its status read answers failed and a Data Run polling it stops
08
Confirmed
Cancelling through the console requires an explicit confirmation.
policyconsoleobserved
react-console:lib/api/data-jobs/rules.ts:DATA_JOB_ACTIONS_NEEDING_CONFIRMATION

Scenarios

IdGivenWhenThenProvenance
01A 500-contact update is processing.The administrator pauses it, resumes it and then confirms cancellation.The job settles between batches as cancelled, accounting for all 500 contacts as applied or unattempted.test
02An import finished with branches blocked because their head office was absent.The administrator loads that head office and requests retry.The saved branch input can now attach to the head office without another upload.test

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.