Skip to content

Commit

Permalink
feat: replace acitivity uuids with activity names
Browse files Browse the repository at this point in the history
  • Loading branch information
wurstbrot committed Nov 7, 2024
1 parent ca25d85 commit 93aa2e9
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion yaml-generation/generateDimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@
$dimensionCustom = getDimensions($filename);
$dimensionsCustom = array_merge_recursive_ex($dimensionsCustom, $dimensionCustom);
}

$uuidArray=array();
foreach ($dimensionsCustom as $dimension => $subdimensions) {
ksort($subdimensions);
$uuidArray[$dimension] = array();
foreach ($subdimensions as $subdimension => $elements) {
$uuidArray[$dimension][$subdimension] = array();
foreach ($elements as $activityName => $activity) {
if(str_starts_with($activityName, "uuid:" )) {
echo "activity name $activityName is having a uuuid\n";
$activityUuid = str_replace("uuid:", "", $activityName);
$activityName = getActivityNameByUuid($dependsOnUuid, $dimensionsAggregated);
$uuidArray[$dimension][$subdimension][$activityName]=$dimensionsAggregated[$dimension][$subdimension][$activityUuid];

array_merge_recursive_ex($dimensionsCustom, $uuidArray);
unset($dimensionsCustom[$dimension][$subdimension][$activityUuid]);
echo "exchanged uuid $activityUuid to name $activityName";
}
}
}
}


if (sizeof($files) > 0) {
$dimensions = array_merge_recursive_ex($dimensions, $dimensionsCustom);
foreach (getActions($dimensions) as list($dimension, $subdimension, $activities)) {
Expand Down Expand Up @@ -67,7 +90,8 @@
var_dump($activity);
echo "</pre>";
exit;
}
}

if (!array_key_exists("tags", $activity)) {
$dimensionsAggregated[$dimension][$subdimension][$activityName]["tags"] = ["none"];
}
Expand Down

0 comments on commit 93aa2e9

Please sign in to comment.