Skip to content

Add helperProcessRequestId Attribute to Processes Properties #6170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

sanjacornelius
Copy link
Contributor

@sanjacornelius sanjacornelius commented Feb 6, 2024

This PR adds a new attribute helperProcessRequestId to the processes properties object. This attribute will enable the PLG team to reference the helper process request id that initiated the creation of the guided template process.

How to Test

  1. Run a Guided Template helper process.
  2. Upon completion, check the database for the newly created process in the processes table.
  3. Navigate to the 'properties' column.
  4. Ensure in the object a new helperProcessRequestId is set.
  5. Take note of the newly created process id.
  6. In your environment, create a new PHP script.
  7. Paste the below provided code snippet.
  8. Replace the [NEW_PROCESS_ID] placeholder in the $guzzleApi variable with the actual newly created process id.
  9. Run the script.
  10. Ensure the helperProcessRequestId is returned.

Code Snippet:

<?php 
$guzzleClient = new \GuzzleHttp\Client(['base_uri'=> $_SERVER['HOST_URL'],'verify' => false]);
$guzzleOptions['headers']['Accept'] = 'application/json';
$guzzleOptions['headers']['Authorization'] = 'Bearer ' . getenv('API_TOKEN');

$processId = $data["_request"]['process_id'];
$guzzleApi = '/api/1.0/processes/[NEW_PROCESS_ID]';

// Get the helper process request ID stored in the process properties
$res = $guzzleClient->request("GET", $guzzleApi, $guzzleOptions);
$process = json_decode($res->getBody(), true);
$helperProcessRequestId = $process['properties']['helperProcessRequestId'];

return ["helperProcessRequestId" => $helperProcessRequestId];

Related Tickets & Packages

FOUR-14065

ci:next
ci:deploy

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.

Copy link

processmaker-sonarqube bot commented Feb 6, 2024

@tokensPM
Copy link

tokensPM commented Feb 6, 2024

QA server K8S was successfully deployed https://ci-2e9e3d5e9f.engk8s.processmaker.net

@ryancooley ryancooley merged commit eda162d into next Feb 7, 2024
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.

4 participants