processmaker
processmaker copied to clipboard
FOUR-27111 | Implement Backend Logic to Call API → Submit Document for Extraction
Summary
This PR adds configuration support for Smart Extract API variables, making them available as environment variables to scripts running in the Script Microservice Runner.
Solution
1. Configuration (config/app.php)
- Added
smart_extract_api_hostconfiguration option with default value'extract-api.processmaker.net' - Added
smart_extract_api_tokenconfiguration option (empty string by default)
2. Script Runner Environment Variables (ProcessMaker/ScriptRunners/ScriptMicroserviceRunner.php)
- Added
SMART_EXTRACT_API_HOSTto the environment variables passed to scripts - Added
SMART_EXTRACT_PM_API_TOKENto the environment variables passed to scripts - These variables are injected into the script execution environment alongside existing variables like
API_TOKEN,API_HOST, etc.
How To Test
- Verify that scripts can access
SMART_EXTRACT_API_HOSTandSMART_EXTRACT_PM_API_TOKENas environment variables
Code Review Checklist
- [ ] I have pulled this code locally and tested it on my instance, along with any associated packages.
- [ ] This code adheres to ProcessMaker Coding Guidelines.
- [ ] This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
- [ ] This solution fixes the bug reported in the original ticket.
- [ ] This solution does not alter the expected output of a component in a way that would break existing Processes.
- [ ] This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
- [ ] This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
- [ ] This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
- [ ] This ticket conforms to the PRD associated with this part of ProcessMaker.
[!NOTE] Adds Smart Extract API host/token config and injects them as
SMART_EXTRACT_API_HOSTandSMART_EXTRACT_PM_API_TOKENenv vars to scripts.
- Config:
- Add
app.smart_extract_api_host(defaultextract-api.processmaker.net).- Add
app.smart_extract_api_token(default empty).- Script Runner (
ProcessMaker/ScriptRunners/ScriptMicroserviceRunner.php):
- Include
SMART_EXTRACT_API_HOSTandSMART_EXTRACT_PM_API_TOKENin script environment variables alongside existingAPI_*vars.Written by Cursor Bugbot for commit 34840d31c56f6919212be4786bbf68e0c5d3f792. This will update automatically on new commits. Configure here.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
No data about Duplication