Skip to content

CAP-CRM-ACT-017Create workflow tasks once and repeat actions according to state

Markdown

CAP-CRM-ACT-017

Create workflow tasks once and repeat actions according to state

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindCapabilityProduct areaCRMModuleActivities, Follow-ups and Task WorkRevision2

Read atservices-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
A single task for each creation stepRepeat responses based on task stateService attribution and explicit refusals
Surfaces
apijob
Preconditions
The caller is a registered service with invocation authority for the tasks service.
Intent sources
services-crm:docs/workstreams/wa-3a-tasks-action-link.md

Controls

29 controls apply, from the corpus control catalogue.

TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-006 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-IAM-001 TC-IAM-005 TC-IAM-006 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-MON-001 TC-MON-002 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-TEN-004

Permissions

KeyChecked atScope
crm.tasks.createservicetenant
crm.tasks.updateservicetenant

Business Rules

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

IdRuleKindEnforced atProvenance
01must prove
Proposed
Only registered Rhythm services can invoke the tasks service directly; HTTP requests and unknown principals are refused.
no proof recorded yet
permissionapi, servicetest
services-crm:modules/tasks/tests/e2e/tasks-service.e2e.spec.js#answers 403 context_mismatch to a console caller reaching the route over HTTP, whatever its keys
02must prove
Proposed
The service supports task creation, completion, cancellation, reassignment, role offers, due-day changes and offered-task listing.
no proof recorded yet
policyapi, serviceobserved
03must prove
Proposed
A workflow creation reference is workspace-unique, so repeated or concurrent creates return one task and identify whether that delivery created it.
no proof recorded yet
invariantservice, databasetest
04must prove
Proposed
Repeating completion, cancellation, reassignment or due-day changes returns the task unchanged when the requested state already holds.
no proof recorded yet
invariantservicetest
services-crm:modules/tasks/tests/integration/services/persistence/tasks.workflow-actions.integration.spec.js#answers a completed task as it is, writing nothing, when asked again idempotently
05must prove
Proposed
Inapplicable actions return specific refusals for incompatible closing, closed-task reassignment or redating, and update locks.
no proof recorded yet
validationservicetest
06must prove
Proposed
A task can be addressed by task reference, originating creation step or both, with disagreement between the two refused.
no proof recorded yet
validationservicetest
services-crm:modules/tasks/tests/integration/services/workflow-actions/task-service-operations.integration.spec.js#refuses an id and a run that name two different tasks (400), and changes neither
07must prove
Proposed
A service request provides the holder once, through either supported user form or a role offer.
no proof recorded yet
validationapitest
services-crm:modules/tasks/tests/e2e/tasks-service.e2e.spec.js#refuses a create naming its holder twice, assignee and assignee_user_id, 400
08must prove
Proposed
Workflow creation cannot specify a queue, initial status or task identifier.
no proof recorded yet
validationapiobserved
09must prove
Proposed
A task’s cross-application subject requires both a record kind and a record reference.
no proof recorded yet
validationservice, databasetest
services-crm:modules/tasks/tests/integration/services/persistence/tasks.workflow-actions.integration.spec.js#refuses an object with no record, naming the record, and writes nothing
10must prove
Proposed
Service writes attribute record stamps to the service principal, retaining the originating person only as execution provenance.
no proof recorded yet
invariantservice, databasetest
services-crm:modules/tasks/tests/integration/services/workflow-actions/task-service-operations.integration.spec.js#creates the task the action asked for, with the service principal as its creator and assigner
11
Proposed
Services can assign and close tasks but cannot hold or claim them.
permissionservice, databasetest
services-crm:modules/tasks/tests/integration/services/persistence/tasks.workflow-actions.integration.spec.js#refuses a service the claim of a queued task, because a claim makes the caller the assignee
12must prove
Proposed
Non-create actions retain no delivery reference, so a repeat after an intervening change is evaluated anew against current task state.
no proof recorded yet
invariantserviceobserved

Scenarios

IdGivenWhenThenProvenance
01A workflow creation step identifies a review task’s subject.Deliver its create request twice.Only one task is stored and the repeated answer reports no creation.test
services-crm:modules/tasks/tests/e2e/tasks-service.e2e.spec.js#answers the repeat 200 with the same task, unchanged, not created by it

Edge Cases

IdGivenWhenThenProvenance
02A person cancelled the workflow’s task.Deliver a completion action.The action reports incompatible closure and preserves Cancelled.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.