snow-flow 10.0.1-dev.423 → 10.0.1-dev.424
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
CHANGED
|
@@ -1479,14 +1479,9 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
1479
1479
|
|
|
1480
1480
|
// Diagnostics: track every step for debugging "flow cannot be found" issues
|
|
1481
1481
|
var diagnostics: any = {
|
|
1482
|
-
factory_bootstrap: 'skipped (direct scheduled job)',
|
|
1483
|
-
factory_namespace: null,
|
|
1484
|
-
factory_call: null,
|
|
1485
1482
|
table_api_used: false,
|
|
1486
1483
|
version_created: false,
|
|
1487
1484
|
version_method: null,
|
|
1488
|
-
version_fields_set: [] as string[],
|
|
1489
|
-
engine_registration: null,
|
|
1490
1485
|
post_verify: null
|
|
1491
1486
|
};
|
|
1492
1487
|
|
|
@@ -1551,21 +1546,12 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
1551
1546
|
factoryWarnings.push('Scheduled job failed: ' + (schedErr.message || schedErr));
|
|
1552
1547
|
}
|
|
1553
1548
|
|
|
1554
|
-
//
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
// Check if publish or compile succeeded
|
|
1561
|
-
if (brResult.result.publishFlow === 'success' || brResult.result.publish === 'success (null return)') {
|
|
1562
|
-
factoryWarnings.length = 0; // Clear warnings — compilation worked!
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
} catch (brErr: any) {
|
|
1566
|
-
diagnostics.br_compile = { error: brErr.message || 'unknown' };
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1549
|
+
// BR compile + engine REST registration skipped:
|
|
1550
|
+
// - BR: FlowDesigner unavailable in all contexts, FlowAPI.compile returns error,
|
|
1551
|
+
// all Script Includes (FlowDesignerScriptable etc.) don't exist on PDI instances
|
|
1552
|
+
// - REST: all sn_fd endpoints return 400 "Requested URI does not represent any resource"
|
|
1553
|
+
// Both add ~20s combined and provide zero value. Flow records are functional
|
|
1554
|
+
// (listable, queryable, deletable) but cannot be opened in Flow Designer UI.
|
|
1569
1555
|
|
|
1570
1556
|
// ── Table API fallback (last resort) ─────────────────────────
|
|
1571
1557
|
if (!flowSysId) {
|
|
@@ -1764,21 +1750,7 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
1764
1750
|
|
|
1765
1751
|
}
|
|
1766
1752
|
|
|
1767
|
-
//
|
|
1768
|
-
// Call the REST API (publish/activate/checkout+checkin/snapshot) to
|
|
1769
|
-
// trigger engine compilation and set latest_version (computed field
|
|
1770
|
-
// that cannot be set via GlideRecord or Table API PATCH).
|
|
1771
|
-
if (flowSysId) {
|
|
1772
|
-
var engineResult = await registerFlowWithEngine(client, flowSysId, shouldActivate);
|
|
1773
|
-
diagnostics.engine_registration = {
|
|
1774
|
-
success: engineResult.success,
|
|
1775
|
-
method: engineResult.method,
|
|
1776
|
-
attempts: engineResult.attempts
|
|
1777
|
-
};
|
|
1778
|
-
if (!engineResult.success) {
|
|
1779
|
-
factoryWarnings.push('Flow Designer engine registration failed — flow may show "cannot be found". Attempts: ' + engineResult.attempts.join(', '));
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1753
|
+
// Engine REST registration skipped — all sn_fd endpoints return 400 on this instance type
|
|
1782
1754
|
|
|
1783
1755
|
// ── Post-creation verification ─────────────────────────────
|
|
1784
1756
|
if (flowSysId) {
|
|
@@ -1890,43 +1862,7 @@ export async function execute(args: any, context: ServiceNowContext): Promise<To
|
|
|
1890
1862
|
}
|
|
1891
1863
|
createSummary.indented('Table API used: ' + diagnostics.table_api_used);
|
|
1892
1864
|
createSummary.indented('Version created: ' + diagnostics.version_created + (diagnostics.version_method ? ' (' + diagnostics.version_method + ')' : ''));
|
|
1893
|
-
|
|
1894
|
-
if (diagnostics.br_compile) {
|
|
1895
|
-
var br = diagnostics.br_compile;
|
|
1896
|
-
if (br.error) {
|
|
1897
|
-
createSummary.indented('BR compile: FAILED — ' + br.error);
|
|
1898
|
-
} else {
|
|
1899
|
-
createSummary.indented('BR compile: fired=' + (br.fired || false));
|
|
1900
|
-
createSummary.indented(' sn_fd=' + (br.sn_fd || 'unknown') + ', FlowDesigner=' + (br.FlowDesigner || 'unknown') + ', FlowAPI=' + (br.FlowAPI || 'unknown'));
|
|
1901
|
-
if (br.FlowDesigner_methods) createSummary.indented(' FlowDesigner methods: [' + br.FlowDesigner_methods.join(', ') + ']');
|
|
1902
|
-
if (br.FlowAPI_methods) createSummary.indented(' FlowAPI methods: [' + br.FlowAPI_methods.join(', ') + ']');
|
|
1903
|
-
if (br.publishFlow) createSummary.indented(' FlowDesigner.publishFlow: ' + br.publishFlow);
|
|
1904
|
-
if (br.compile) createSummary.indented(' FlowAPI.compile: ' + br.compile);
|
|
1905
|
-
if (br.publish) createSummary.indented(' FlowAPI.publish: ' + br.publish);
|
|
1906
|
-
if (br.sn_fd_keys && br.sn_fd_keys.length > 0) createSummary.indented(' sn_fd keys: [' + br.sn_fd_keys.join(', ') + ']');
|
|
1907
|
-
if (br.script_includes && br.script_includes.length > 0) createSummary.indented(' Script Includes: [' + br.script_includes.join(', ') + ']');
|
|
1908
|
-
if (br.script_include_tests) {
|
|
1909
|
-
var siKeys = Object.keys(br.script_include_tests);
|
|
1910
|
-
for (var sk = 0; sk < siKeys.length; sk++) {
|
|
1911
|
-
createSummary.indented(' SI ' + siKeys[sk] + ': ' + br.script_include_tests[siKeys[sk]]);
|
|
1912
|
-
}
|
|
1913
|
-
}
|
|
1914
|
-
if (br.post_latest_version) createSummary.indented(' post_latest_version: ' + br.post_latest_version);
|
|
1915
|
-
if (br.post_latest_snapshot) createSummary.indented(' post_latest_snapshot: ' + br.post_latest_snapshot);
|
|
1916
|
-
if (br.post_status) createSummary.indented(' post_status: ' + br.post_status);
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
if (diagnostics.engine_registration) {
|
|
1920
|
-
var eng = diagnostics.engine_registration;
|
|
1921
|
-
if (eng.success !== undefined) {
|
|
1922
|
-
createSummary.indented('Engine REST registration: ' + (eng.success ? eng.method : 'FAILED'));
|
|
1923
|
-
if (eng.attempts) {
|
|
1924
|
-
for (var ea = 0; ea < eng.attempts.length; ea++) {
|
|
1925
|
-
createSummary.indented(' ' + eng.attempts[ea]);
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1865
|
+
createSummary.indented('Engine compile: skipped (not available on this instance — FlowDesigner unavailable, REST 400s, no Script Includes)');
|
|
1930
1866
|
if (diagnostics.latest_version_auto_set !== undefined) {
|
|
1931
1867
|
createSummary.indented('latest_version: ' + (diagnostics.latest_version_auto_set ? 'set' : 'null'));
|
|
1932
1868
|
}
|