Workflow Status and Locking
Business Rules and Data Management sequences often need to check workflow status before acting — is the entity certified? Is the period locked? Can data be loaded? This guide covers the API surface for querying and controlling workflow state programmatically, including the primary key objects, the
WorkflowInfo result, and the locking methods.WorkflowUnitPk vs WorkflowUnitClusterPk
Two key objects identify workflow targets. Choosing the right one depends on whether you are operating on a single entity or a group.
WorkflowUnitPk identifies a single workflow unit: a specific Profile + Scenario + Time combination. Use this when you need to target one entity's workflow state.
WorkflowUnitClusterPk identifies a cluster of related workflow units — typically used when operating on a group of entities under the same profile. The cluster key aggregates status across children, so querying at this level tells you whether all entities in the cluster are locked, certified, and so on.
Use
WorkflowUnitPk for individual entity checks. Use WorkflowUnitClusterPk when querying or locking at the profile level, which includes all child entities.WorkflowInfo Properties
Calling
BRApi.Workflow.Status.GetWorkflowStatus returns a WorkflowInfo object. The table below lists the properties you will use most often in automation logic.| Property | Type | Description |
|---|---|---|
Locked | Boolean | Whether the workflow unit is currently locked. |
IsCertified() | Boolean | Whether the workflow unit has been certified (checks if the Certify step is completed). |
GetStep(StepClassificationTypes.X) | WorkflowStepInfo | Returns the step info for a given step classification (e.g., LoadCube, Certify). |
Step-level status is accessed through the
GetStep() method. For example, wfInfo.GetStep(StepClassificationTypes.LoadCube).Status returns the WorkflowStatusTypes value for the Load step.Querying Workflow Status
The most common call is
BRApi.Workflow.Status.GetWorkflowStatus. Pass a WorkflowUnitClusterPk and the API returns the aggregated status for that cluster.Locking and Unlocking
The
BRApi.Workflow.Locking namespace provides methods to lock and unlock workflow units programmatically. These are typically called from Data Management steps or administrative Business Rules.StepClassificationTypes Enum
Each step in the workflow task bar maps to a value in the
StepClassificationTypes enum. You will encounter these when inspecting step-level status or building custom task automation.| Enum Value | Integer | Description |
|---|---|---|
| Unknown | -1 | Default / unknown state. |
| ManageWorkflow | 0 | Manage Workflow task. |
| InputForms | 1 | Forms / Dashboard input task. |
| InputJournals | 2 | Journal entry task. |
| DataLoadTransform | 11 | Data load transformation task. |
| DataLoadClearData | 15 | Clear data task. |
| ValidateTransform | 20 | Validate transformation task. |
| ValidateIntersection | 21 | Validate intersection task. |
| LoadCube | 30 | Load data to cube task. |
| ProcessCube | 40 | Process / Calculate task. |
| Confirm | 50 | Confirm task. |
| Certify | 60 | Certify task. |
Check-Before-Write Guard Clause
A common pattern in automation rules is to verify workflow status before writing data. If the entity is locked or certified, the rule logs a message and returns early instead of attempting a write that would fail.
Related Content
- Workflow Engine Overview — architecture and core concepts
- Confirmation and Certification — the certification lifecycle
- Workflow Substitution Variables — dynamic variables resolved at runtime
- Automating IVL — batch automation that checks workflow status before loading