# How to attach a workflow

> **Deferred — needs a deployment with deployed BPMN.** Empirically
> confirmed against the dev DB: `SELECT COUNT(*) FROM act_re_procdef`
> returns 0; `gdsmoduleflow = 0`; `gdsmodule WHERE bCheck = 1` matches
> 0 rows. The dispatch path itself is hard-disabled by
> `ConstantUtils.bCheckflowCheck = false` (see
> [Activiti integration](../maintainer/activiti.md)). The
> recipe below is the **code-derived hypothesis** — it has not been
> exercised against a live deployment.

> **Deferred.** Activiti is wired into the codebase, but a deployment
> that doesn't run an approval flow leaves the workflow tables empty,
> so end-to-end verification of this recipe needs a deployment that
> *does*. See [Slice 7 (deferred)](../../slices/07-workflow.md) for the
> same reasoning.
>
> The shape of the recipe:
>
> 1. Set `gdsmodule.bCheck = 1` to flag the module as workflow-enabled.
> 2. Populate `gdsmoduleflow` with the flow's window configuration.
> 3. Link the module/button to the process in `gdsmoduleflow` using
>    the fields expected by `CheckExamineFlowServiceImpl`.
>    `gdsmodule.sVersionFlowId` / `sVersionFlowCode` are edition tags,
>    not the live Activiti binding.
> 4. Deploy the BPMN process definition through the Activiti REST API
>    or whichever workflow deployment surface is enabled in the target
>    environment.
> 5. Verify rows appear in `act_re_procdef` after deployment.
> 6. Test by submitting a record — `act_ru_task` should populate.
>
> Once a deployment with active workflows is available, this page
> becomes a proper recipe and Slice 7 becomes a proper slice.
