Skip to content

FOUR-32305: Export assets referenced in scripts using environment variables#8918

Open
caleeli wants to merge 2 commits into
developfrom
FOUR-32305
Open

FOUR-32305: Export assets referenced in scripts using environment variables#8918
caleeli wants to merge 2 commits into
developfrom
FOUR-32305

Conversation

@caleeli

@caleeli caleeli commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

As process architect I require us export/import assets referenced in script code same as we do in other places.

Solution

  • implement asset linking for environment variables

How to Test

  1. Create a collection
  2. Create an environment variable
  3. Link this environment variable with the created collection
  4. Use this environment variable in a script
  5. Use the script in a process
  6. Export the process
  7. Import the process in a different place
  8. Check that the collection ID corresponds to the right one

Related Tickets & Packages

ci:deploy

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-8568b9d751.engk8s.processmaker.net

@processmaker-sonarqube

Copy link
Copy Markdown

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-8568b9d751.engk8s.processmaker.net

@caleeli

caleeli commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Source Server:
image

@caleeli

caleeli commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Exporting the process with linked environment variable:

part1.mov

Importing the process with linked environment variable:

part2.mov

@nolanpro
nolanpro requested a review from eiresendez July 21, 2026 17:13

@eiresendez eiresendez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @caleeli, I left a few comments that I think are worth considering. If they make sense, let me know what you think.
cc: @nolanpro

{
foreach ($this->getDependents(DependentType::ENVIRONMENT_VARIABLE_ASSET, true) as $dependent) {
$asset = $dependent->model;
if (!$asset) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 A discarded or unresolved asset (Custom Import) can be returned as an empty model. The truthiness check at line 55 passes, then the importer saves asset_uuid = null and an empty numeric value. The fallback at line 66 is therefore bypassed, leaving scripts with a broken environment variable after Import or DevLink. Only use a persisted dependent asset; otherwise fail clearly or restore a deliberately unlinked value without persisting a half-link.

{
class: "ProcessMaker\\Package\\PackageDecisionEngine\\Models\\DecisionTable",
label: "Decision Table",
apiPath: "decision-tables",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 This point to nonexistent APIs. Decision Tables use decision_tables; FlowGenies use package-ai/flow_genies. Because AssetLinkFields.vue (line 192) silently converts request failures into an empty list, both advertised asset types are unusable without any visible error.

{
$fields = ['name', 'description'];
if ($request->filled('value')) {
$data = $this->prepareAssetLinkInput($request->all());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 If asset_uuid is retained, update validation does not actually guarantee both-or-neither. It validates only the incoming payload, so clearing one link field while omitting the other can persist an inconsistent pair. Validate the merged resulting state or update both fields atomically.

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.

3 participants