-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): add collection flow observablity
- Loading branch information
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
...ites/docs/src/content/docs/en/collection-flow/collection-flow-observability.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
title: Collection Flow Observability | ||
description: Understanding and monitoring the state of your collection flow | ||
--- | ||
|
||
import CodeBlock from '../../../../components/CodeBlock/CodeBlock.astro'; | ||
|
||
## Overview | ||
|
||
The Collection Flow provides comprehensive observability into its internal state through the workflow context. This allows you to monitor and understand the current state of the collection flow, its configuration, and progress in real-time. | ||
|
||
## Workflow Context Structure | ||
|
||
The workflow context contains several key components that provide insights into the collection flow: | ||
|
||
### Configuration (config) | ||
|
||
The configuration section defines the basic setup of your collection flow: | ||
|
||
<CodeBlock lang="json" code={`{ | ||
"config": { | ||
"apiUrl": "https://api.example.com", | ||
"steps": [ | ||
{ | ||
"stateName": "personal_info", | ||
"orderNumber": 1 | ||
}, | ||
{ | ||
"stateName": "company_details", | ||
"orderNumber": 2 | ||
} | ||
] | ||
} | ||
}`}/> | ||
|
||
### State Management | ||
|
||
The state section tracks the current progress and status of the collection flow: | ||
|
||
<CodeBlock lang="json" code={`{ | ||
"state": { | ||
"currentStep": "company_details", | ||
"status": "inprogress", | ||
"progressBreakdown": { | ||
"personal_info": true, | ||
"company_details": false | ||
} | ||
} | ||
}`}/> | ||
|
||
#### Status Values | ||
|
||
The collection flow can have the following status values: | ||
|
||
- `pending`: Initial state, awaiting user data entry | ||
- `inprogress`: Active user engagement with form submission ongoing | ||
- `completed`: All steps finished, awaiting plugin processing and review | ||
- `approved`: Application approved by Backoffice | ||
- `revision`: Returned to client for corrections | ||
- `rejected`: Application rejected by Backoffice | ||
- `failed`: Plugin execution failure | ||
|
||
### Additional Information | ||
|
||
The context can include supplementary data used by plugins: | ||
|
||
<CodeBlock lang="json" code={`{ | ||
"additionalInformation": { | ||
"customField": "value", | ||
"pluginSpecificData": { | ||
// Plugin-specific information | ||
} | ||
} | ||
}`}/> | ||
|
||
## Monitoring and Debugging | ||
|
||
You can inspect the workflow context to: | ||
|
||
1. Track progress through the collection flow | ||
2. Debug issues with form submissions | ||
3. Understand the current state of plugin processing | ||
4. Verify configuration settings | ||
5. Monitor user progression through steps | ||
|
||
To access the workflow context, you can use the workflow runtime API or inspect it through the Backoffice interface. | ||
|
||
## Real-time Updates | ||
|
||
The context maintains bidirectional updates, meaning changes can occur from: | ||
|
||
- Frontend user interactions | ||
- Backend plugin processing | ||
- Administrative actions in the Backoffice | ||
- System automated processes | ||
|
||
This ensures you always have an accurate view of the collection flow's current state. |