Overview
A Database Unit in a flow diagram interacts with a database as part of the workflow. It allows the process to perform structured operations such as reading, writing, updating, or deleting data.
- What it does:
- Connects to a database system (SQL or NoSQL).
- Executes queries or commands to manipulate data.
- Returns results for use in subsequent steps.
- How it works:
- Configuration:
- Database type (e.g., MySQL, PostgreSQL, Oracle, MongoDB).
- Connection details (host, port, username, password).
- Optional: Connection pooling, timeout settings.
- Action Selection:
- Read: Fetch data using SELECT or equivalent.
- Write: Insert or update records.
- Delete: Remove records.
- Execute Procedure: Call stored procedures or functions.
- Execution:
- Sends the query to the database.
- Receives the result set or status.
- Passes data to the next unit (e.g., Mapping Unit, Decision Unit).
- Error Handling:
- Handles connection failures, query errors, or timeouts.
- Can branch to error-handling logic.
- Use case:
- Document Workflow: Fetch metadata from a database before processing a document.
- Integration: Store API response data in a database.
- Reporting: Retrieve records for generating reports.