Fix failed BuildScriptExecutor Job by sanjacornelius · Pull Request #6238 · ProcessMaker/processmaker

This PR resolves the failed BuildScriptExecutor job when importing a script executor via the php artisan processmaker:guided-template-sync command. The error was due to the fallback query associating a user to run the script executor, which defaulted to the admin user. However, the query was returning the admin ID in an array instead of an integer, causing build failures.

Solution

The solution involved updating the query to return the admin ID as an integer, resolving the build failures.

How to Test

.

CI Server

  1. Navigate to Processes -> Guided Templates
  2. Configure a guided template
  3. Upon completion, ensure no Failed Jobs appear in the Admin -> Queue Management -> Failed jobs listing.
  4. Run the process created from the guided template from the LaunchPad
  5. Ensure no Script Executor errors are present.

Local Environment

  1. In your local environment, ensure you do not have the 'Guided Template PHP' or 'Guided Template Python' script executors. If present, delete them from your database.
  2. Navigate to Admin -> Queue Management -> Failed Jobs in your instance.
  3. Run the command php artisan processmaker:sync-guided-templates in your terminal.
  4. Observe the Failed Jobs to ensure no new failed jobs appear.
  5. Navigate to Processes -> Guided Templates in your instance.
  6. Configure a guided template.
  7. Upon completion, ensure no Failed Jobs appear in the Queue Management -> Failed jobs listing.

Related Tickets & Packages

ci:next
ci:package-data-sources:observation/FOUR-14162

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.