Skip to content

Conversation

@mcraeteisha
Copy link
Contributor

@mcraeteisha mcraeteisha commented Nov 25, 2025

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_host configuration option with default value 'extract-api.processmaker.net'
  • Added smart_extract_api_token configuration option (empty string by default)

2. Script Runner Environment Variables (ProcessMaker/ScriptRunners/ScriptMicroserviceRunner.php)

  • Added SMART_EXTRACT_API_HOST to the environment variables passed to scripts
  • Added SMART_EXTRACT_PM_API_TOKEN to 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_HOST and SMART_EXTRACT_PM_API_TOKEN as 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_HOST and SMART_EXTRACT_PM_API_TOKEN env vars to scripts.

  • Config:
    • Add app.smart_extract_api_host (default extract-api.processmaker.net).
    • Add app.smart_extract_api_token (default empty).
  • Script Runner (ProcessMaker/ScriptRunners/ScriptMicroserviceRunner.php):
    • Include SMART_EXTRACT_API_HOST and SMART_EXTRACT_PM_API_TOKEN in script environment variables alongside existing API_* vars.

Written by Cursor Bugbot for commit 34840d3. This will update automatically on new commits. Configure here.

@processmaker-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants