# MARS-1011: WORKFLOW_MANAGER Package Update v1.7.1

## Description
Updates WORKFLOW_MANAGER package to version 1.7.1, adding automatic SERVICE_NAME='ODS' assignment in INIT_TASK function.

## Changes
- Modified `INIT_TASK` function to automatically set `SERVICE_NAME='ODS'` when inserting into `CT_MRDS.A_TASK_HISTORY`
- Updated package version from 1.7.0 to 1.7.1
- Updated build date to 2025-11-18

## Installation Files
1. `01_MARS_1011_install_CT_MRDS_WORKFLOW_MANAGER_SPEC.sql` - Package specification
2. `02_MARS_1011_install_CT_MRDS_WORKFLOW_MANAGER_BODY.sql` - Package body with SERVICE_NAME modification
3. `03_MARS_1011_verify_CT_MRDS_WORKFLOW_MANAGER.sql` - Verification and version check
4. `04_MARS_1011_track_CT_MRDS_WORKFLOW_MANAGER_version.sql` - Package version tracking in A_PACKAGE_VERSION_TRACKING

## Rollback Files
1. `91_MARS_1011_rollback_CT_MRDS_WORKFLOW_MANAGER_SPEC.sql` - Rollback package specification to v1.7.0
2. `91_MARS_1011_rollback_CT_MRDS_WORKFLOW_MANAGER_BODY.sql` - Rollback package body (removes SERVICE_NAME from INIT_TASK)
3. `92_MARS_1011_track_rollback_version.sql` - Track rollback version in A_PACKAGE_VERSION_TRACKING

## Installation
```bash
sqlplus CT_MRDS/password@database @install_mars1011.sql
```

## Rollback
```bash
sqlplus CT_MRDS/password@database @rollback_mars1011.sql
```

## Dependencies
- Requires CT_MRDS schema
- Requires A_TASK_HISTORY table with SERVICE_NAME column
- Requires ENV_MANAGER package for version management functions
- Requires A_PACKAGE_VERSION_TRACKING table for version tracking

## Testing
After installation, verify:
1. Package compiles successfully (check `03_MARS_1011_verify_CT_MRDS_WORKFLOW_MANAGER.sql` output)
2. Version shows as 1.7.1
3. INIT_TASK function properly inserts SERVICE_NAME='ODS'
4. Package version is tracked in A_PACKAGE_VERSION_TRACKING table
5. Check tracking: `SELECT * FROM CT_MRDS.A_PACKAGE_VERSION_TRACKING WHERE PACKAGE_NAME='WORKFLOW_MANAGER' ORDER BY TRACKING_DATE DESC;`

After rollback, verify:
1. Version shows as 1.7.0 (rolled back)
2. INIT_TASK function no longer includes SERVICE_NAME column
3. Rollback is tracked in A_PACKAGE_VERSION_TRACKING with CHANGE_STATUS='ROLLBACK'

## Impact
- Low risk change - only affects new task records
- Backward compatible - existing functionality unchanged
- No breaking changes to function signatures