@onlineapps/conn-orch-orchestrator 1.0.57 → 1.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/WorkflowOrchestrator.js +22 -9
package/package.json
CHANGED
|
@@ -152,9 +152,19 @@ class WorkflowOrchestrator {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
|
|
155
|
-
// Execute the step (
|
|
155
|
+
// Execute the step (build full context for template resolution)
|
|
156
|
+
const stepsArrayCtx = this._getStepsArray(cookbookDef);
|
|
157
|
+
const stepsMap = {};
|
|
158
|
+
stepsArrayCtx.forEach((s) => {
|
|
159
|
+
const id = this._getStepId(s);
|
|
160
|
+
if (id) {
|
|
161
|
+
stepsMap[id] = s;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
156
164
|
const stepContext = {
|
|
157
|
-
|
|
165
|
+
api_input: cookbookDef.api_input || {},
|
|
166
|
+
steps: stepsArrayCtx, // array (legacy consumers expect .map)
|
|
167
|
+
steps_by_id: stepsMap, // fast lookup by step_id for templating
|
|
158
168
|
_system: cookbookDef._system,
|
|
159
169
|
delivery: cookbookDef.delivery
|
|
160
170
|
};
|
|
@@ -563,13 +573,16 @@ class WorkflowOrchestrator {
|
|
|
563
573
|
const part = parts[i];
|
|
564
574
|
if (current === undefined || current === null) return undefined;
|
|
565
575
|
|
|
566
|
-
// Special handling for 'steps' array
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
576
|
+
// Special handling for 'steps' - support array (legacy) and map (steps_by_id)
|
|
577
|
+
if (parts[i - 1] === 'steps') {
|
|
578
|
+
if (context.steps_by_id && context.steps_by_id[part]) {
|
|
579
|
+
current = context.steps_by_id[part];
|
|
580
|
+
} else if (Array.isArray(context.steps)) {
|
|
581
|
+
const step = context.steps.find(s => s.id === part || s.step_id === part);
|
|
582
|
+
current = step;
|
|
583
|
+
} else {
|
|
584
|
+
current = undefined;
|
|
585
|
+
}
|
|
573
586
|
} else {
|
|
574
587
|
current = current[part];
|
|
575
588
|
}
|