snow-flow 1.3.30 → 1.3.31
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/dist/utils/complete-flow-xml-generator.js +52 -52
- package/dist/version.js +19 -1
- package/package.json +1 -1
|
@@ -250,11 +250,11 @@ class CompleteFlowXMLGenerator {
|
|
|
250
250
|
generateCompleteFlowXML(flowDef) {
|
|
251
251
|
this.flowSysId = this.generateSysId();
|
|
252
252
|
this.snapshotSysId = this.generateSysId();
|
|
253
|
-
const internalName = flowDef.internal_name || this.generateInternalName(flowDef.name);
|
|
253
|
+
const internalName = this.flowDef.internal_name || this.generateInternalName(this.flowDef.name);
|
|
254
254
|
// Generate all component sys_ids
|
|
255
255
|
const updateSetSysId = this.generateSysId();
|
|
256
256
|
const triggerSysId = this.generateSysId();
|
|
257
|
-
const activitySysIds = flowDef.activities.map(() => this.generateSysId());
|
|
257
|
+
const activitySysIds = this.flowDef.activities.map(() => this.generateSysId());
|
|
258
258
|
const logicSysIds = [];
|
|
259
259
|
// Calculate all required logic nodes
|
|
260
260
|
let logicNodeCount = 1; // Start node
|
|
@@ -275,7 +275,7 @@ class CompleteFlowXMLGenerator {
|
|
|
275
275
|
<sys_remote_update_set action="INSERT_OR_UPDATE">
|
|
276
276
|
<sys_id>${updateSetSysId}</sys_id>
|
|
277
277
|
<name>${this.escapeXml(this.updateSetName)}</name>
|
|
278
|
-
<description>Complete flow import: ${this.escapeXml(flowDef.name)}</description>
|
|
278
|
+
<description>Complete flow import: ${this.escapeXml(this.flowDef.name)}</description>
|
|
279
279
|
<origin_sys_id>${updateSetSysId}</origin_sys_id>
|
|
280
280
|
<parent/>
|
|
281
281
|
<release_date/>
|
|
@@ -305,7 +305,7 @@ class CompleteFlowXMLGenerator {
|
|
|
305
305
|
<category>customer</category>
|
|
306
306
|
<comments/>
|
|
307
307
|
<name>sys_hub_flow_${this.flowSysId}</name>
|
|
308
|
-
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow"><sys_hub_flow action="INSERT_OR_UPDATE"><access>${flowDef.accessible_from || 'package_private'}</access><acls/><active>true</active><annotation>${this.escapeXml(flowDef.annotation || '')}</annotation><callable_by_client_api>${flowDef.callable_by_client_api || false}</callable_by_client_api><category>${flowDef.category || 'custom'}</category><compiler_build/><copied_from/><copied_from_name/><description>${this.escapeXml(flowDef.description)}</description><internal_name>${this.escapeXml(internalName)}</internal_name><label_cache>${encodedLabelCache}</label_cache><latest_snapshot display_value="${this.escapeXml(flowDef.name)}">${this.snapshotSysId}</latest_snapshot><master_snapshot display_value="${this.escapeXml(flowDef.name)}">${this.snapshotSysId}</master_snapshot><name>${this.escapeXml(flowDef.name)}</name><natlang>false</natlang><outputs/><remote_trigger_id/><run_as>${flowDef.run_as || 'user'}</run_as><runtime_value>${this.encodeFlowValue(flowDef.runtime_value || {})}</runtime_value><sc_callable>false</sc_callable><show_action_header>false</show_action_header><show_draft_actions>false</show_draft_actions><show_flow_tile>false</show_flow_tile><show_prompted>false</show_prompted><show_triggered>false</show_triggered><status>published</status><sys_class_name>sys_hub_flow</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>${this.flowSysId}</sys_id><sys_mod_count>0</sys_mod_count><sys_name>${this.escapeXml(flowDef.name)}</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_hub_flow_${this.flowSysId}</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><tags>${(flowDef.tags || []).join(',')}</tags><type>flow</type></sys_hub_flow></record_update>]]></payload>
|
|
308
|
+
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow"><sys_hub_flow action="INSERT_OR_UPDATE"><access>${this.flowDef.accessible_from || 'package_private'}</access><acls/><active>true</active><annotation>${this.escapeXml(this.flowDef.annotation || '')}</annotation><callable_by_client_api>${this.flowDef.callable_by_client_api || false}</callable_by_client_api><category>${this.flowDef.category || 'custom'}</category><compiler_build/><copied_from/><copied_from_name/><description>${this.escapeXml(this.flowDef.description)}</description><internal_name>${this.escapeXml(internalName)}</internal_name><label_cache>${encodedLabelCache}</label_cache><latest_snapshot display_value="${this.escapeXml(this.flowDef.name)}">${this.snapshotSysId}</latest_snapshot><master_snapshot display_value="${this.escapeXml(this.flowDef.name)}">${this.snapshotSysId}</master_snapshot><name>${this.escapeXml(this.flowDef.name)}</name><natlang>false</natlang><outputs/><remote_trigger_id/><run_as>${this.flowDef.run_as || 'user'}</run_as><runtime_value>${this.encodeFlowValue(this.flowDef.runtime_value || {})}</runtime_value><sc_callable>false</sc_callable><show_action_header>false</show_action_header><show_draft_actions>false</show_draft_actions><show_flow_tile>false</show_flow_tile><show_prompted>false</show_prompted><show_triggered>false</show_triggered><status>published</status><sys_class_name>sys_hub_flow</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>${this.flowSysId}</sys_id><sys_mod_count>0</sys_mod_count><sys_name>${this.escapeXml(this.flowDef.name)}</sys_name><sys_overrides/><sys_package display_value="Global" source="global">global</sys_package><sys_policy/><sys_scope display_value="Global">global</sys_scope><sys_update_name>sys_hub_flow_${this.flowSysId}</sys_update_name><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><tags>${(this.flowDef.tags || []).join(',')}</tags><type>flow</type></sys_hub_flow></record_update>]]></payload>
|
|
309
309
|
<remote_update_set display_value="${this.escapeXml(this.updateSetName)}">${updateSetSysId}</remote_update_set>
|
|
310
310
|
<replace_on_upgrade>false</replace_on_upgrade>
|
|
311
311
|
<source_table>sys_hub_flow</source_table>
|
|
@@ -330,16 +330,16 @@ class CompleteFlowXMLGenerator {
|
|
|
330
330
|
<action>INSERT_OR_UPDATE</action>
|
|
331
331
|
<application display_value="Global">global</application>
|
|
332
332
|
<name>sys_hub_flow_snapshot_${this.snapshotSysId}</name>
|
|
333
|
-
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_snapshot"><sys_hub_flow_snapshot action="INSERT_OR_UPDATE"><flow display_value="${this.escapeXml(flowDef.name)}">${this.flowSysId}</flow><name>${this.escapeXml(flowDef.name)}</name><note>Complete flow created by CompleteFlowXMLGenerator</note><snapshot>${encodedSnapshot}</snapshot><sys_class_name>sys_hub_flow_snapshot</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>${this.snapshotSysId}</sys_id><sys_mod_count>0</sys_mod_count><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on></sys_hub_flow_snapshot></record_update>]]></payload>
|
|
333
|
+
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_snapshot"><sys_hub_flow_snapshot action="INSERT_OR_UPDATE"><flow display_value="${this.escapeXml(this.flowDef.name)}">${this.flowSysId}</flow><name>${this.escapeXml(this.flowDef.name)}</name><note>Complete flow created by CompleteFlowXMLGenerator</note><snapshot>${encodedSnapshot}</snapshot><sys_class_name>sys_hub_flow_snapshot</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>${this.snapshotSysId}</sys_id><sys_mod_count>0</sys_mod_count><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on></sys_hub_flow_snapshot></record_update>]]></payload>
|
|
334
334
|
<remote_update_set display_value="${this.escapeXml(this.updateSetName)}">${updateSetSysId}</remote_update_set>
|
|
335
335
|
<source_table>sys_hub_flow_snapshot</source_table>
|
|
336
336
|
<type>Flow Designer Snapshot</type>
|
|
337
337
|
</sys_update_xml>
|
|
338
338
|
|
|
339
339
|
${this.generateTriggerXML(flowDef, triggerSysId, updateSetSysId)}
|
|
340
|
-
${this.generateActionInstancesXML(flowDef.activities, activitySysIds, updateSetSysId)}
|
|
340
|
+
${this.generateActionInstancesXML(this.flowDef.activities, activitySysIds, updateSetSysId)}
|
|
341
341
|
${this.generateFlowLogicXML(flowDef, triggerSysId, activitySysIds, logicSysIds, updateSetSysId)}
|
|
342
|
-
${this.generateVariablesXML(flowDef.variables || [], updateSetSysId)}
|
|
342
|
+
${this.generateVariablesXML(this.flowDef.variables || [], updateSetSysId)}
|
|
343
343
|
</unload>`;
|
|
344
344
|
return xml;
|
|
345
345
|
}
|
|
@@ -349,13 +349,13 @@ class CompleteFlowXMLGenerator {
|
|
|
349
349
|
buildCompleteLabelCache(flowDef, triggerSysId, activitySysIds) {
|
|
350
350
|
const labelCache = {
|
|
351
351
|
"flow_data": {
|
|
352
|
-
"name": flowDef.name,
|
|
353
|
-
"description": flowDef.description,
|
|
352
|
+
"name": this.flowDef.name,
|
|
353
|
+
"description": this.flowDef.description,
|
|
354
354
|
"sys_id": this.flowSysId,
|
|
355
|
-
"internal_name": flowDef.internal_name || this.generateInternalName(flowDef.name),
|
|
356
|
-
"category": flowDef.category || 'custom',
|
|
357
|
-
"run_as": flowDef.run_as || 'user',
|
|
358
|
-
"accessible_from": flowDef.accessible_from || 'package_private'
|
|
355
|
+
"internal_name": this.flowDef.internal_name || this.generateInternalName(this.flowDef.name),
|
|
356
|
+
"category": this.flowDef.category || 'custom',
|
|
357
|
+
"run_as": this.flowDef.run_as || 'user',
|
|
358
|
+
"accessible_from": this.flowDef.accessible_from || 'package_private'
|
|
359
359
|
},
|
|
360
360
|
"triggers": {},
|
|
361
361
|
"actions": {},
|
|
@@ -370,19 +370,19 @@ class CompleteFlowXMLGenerator {
|
|
|
370
370
|
}
|
|
371
371
|
};
|
|
372
372
|
// Add trigger with complete metadata
|
|
373
|
-
const triggerType = this.getTriggerTypeDefinition(flowDef.trigger_type);
|
|
373
|
+
const triggerType = this.getTriggerTypeDefinition(this.flowDef.trigger_type);
|
|
374
374
|
labelCache.triggers[triggerSysId] = {
|
|
375
375
|
"name": "Trigger",
|
|
376
376
|
"type": triggerType.sys_id,
|
|
377
377
|
"type_name": triggerType.internal_name,
|
|
378
378
|
"display_name": triggerType.display_name,
|
|
379
|
-
"table": flowDef.table || '',
|
|
380
|
-
"condition": flowDef.trigger_condition || '',
|
|
379
|
+
"table": this.flowDef.table || '',
|
|
380
|
+
"condition": this.flowDef.trigger_condition || '',
|
|
381
381
|
"inputs": {},
|
|
382
|
-
"outputs": this.generateTriggerOutputs(flowDef.table)
|
|
382
|
+
"outputs": this.generateTriggerOutputs(this.flowDef.table)
|
|
383
383
|
};
|
|
384
384
|
// Add actions with complete metadata
|
|
385
|
-
flowDef.activities.forEach((activity, index) => {
|
|
385
|
+
this.flowDef.activities.forEach((activity, index) => {
|
|
386
386
|
const sysId = activitySysIds[index];
|
|
387
387
|
const actionType = this.getActionTypeDefinition(activity.type);
|
|
388
388
|
labelCache.actions[sysId] = {
|
|
@@ -401,8 +401,8 @@ class CompleteFlowXMLGenerator {
|
|
|
401
401
|
};
|
|
402
402
|
});
|
|
403
403
|
// Add variables
|
|
404
|
-
if (flowDef.variables) {
|
|
405
|
-
flowDef.variables.forEach(variable => {
|
|
404
|
+
if (this.flowDef.variables) {
|
|
405
|
+
this.flowDef.variables.forEach(variable => {
|
|
406
406
|
labelCache.variables[variable.name] = {
|
|
407
407
|
"type": variable.type,
|
|
408
408
|
"default_value": variable.default_value,
|
|
@@ -444,7 +444,7 @@ class CompleteFlowXMLGenerator {
|
|
|
444
444
|
buildCompleteFlowSnapshot(flowDef, triggerSysId, activitySysIds, labelCache) {
|
|
445
445
|
const actions = [];
|
|
446
446
|
// Add trigger node with complete structure
|
|
447
|
-
const triggerType = this.getTriggerTypeDefinition(flowDef.trigger_type);
|
|
447
|
+
const triggerType = this.getTriggerTypeDefinition(this.flowDef.trigger_type);
|
|
448
448
|
actions.push({
|
|
449
449
|
"id": triggerSysId,
|
|
450
450
|
"name": "Trigger",
|
|
@@ -452,11 +452,11 @@ class CompleteFlowXMLGenerator {
|
|
|
452
452
|
"base_type": "trigger",
|
|
453
453
|
"trigger_type": triggerType.sys_id,
|
|
454
454
|
"trigger_type_name": triggerType.internal_name,
|
|
455
|
-
"table": flowDef.table || '',
|
|
456
|
-
"condition": flowDef.trigger_condition || '',
|
|
455
|
+
"table": this.flowDef.table || '',
|
|
456
|
+
"condition": this.flowDef.trigger_condition || '',
|
|
457
457
|
"parents": [],
|
|
458
458
|
"children": activitySysIds.length > 0 ? [activitySysIds[0]] : [],
|
|
459
|
-
"outputs": this.generateTriggerOutputs(flowDef.table),
|
|
459
|
+
"outputs": this.generateTriggerOutputs(this.flowDef.table),
|
|
460
460
|
"position": { "x": 100, "y": 100 },
|
|
461
461
|
"ui_id": (0, uuid_1.v4)(),
|
|
462
462
|
"metadata": {
|
|
@@ -465,7 +465,7 @@ class CompleteFlowXMLGenerator {
|
|
|
465
465
|
}
|
|
466
466
|
});
|
|
467
467
|
// Add activity nodes with complete structure
|
|
468
|
-
flowDef.activities.forEach((activity, index) => {
|
|
468
|
+
this.flowDef.activities.forEach((activity, index) => {
|
|
469
469
|
const actionSysId = activitySysIds[index];
|
|
470
470
|
const actionType = this.getActionTypeDefinition(activity.type);
|
|
471
471
|
const parents = index === 0 ? [triggerSysId] : [activitySysIds[index - 1]];
|
|
@@ -503,12 +503,12 @@ class CompleteFlowXMLGenerator {
|
|
|
503
503
|
return {
|
|
504
504
|
"schemaVersion": "2.0",
|
|
505
505
|
"id": this.flowSysId,
|
|
506
|
-
"name": flowDef.name,
|
|
507
|
-
"description": flowDef.description,
|
|
506
|
+
"name": this.flowDef.name,
|
|
507
|
+
"description": this.flowDef.description,
|
|
508
508
|
"type": "flow",
|
|
509
|
-
"internal_name": flowDef.internal_name || this.generateInternalName(flowDef.name),
|
|
510
|
-
"category": flowDef.category || 'custom',
|
|
511
|
-
"tags": flowDef.tags || [],
|
|
509
|
+
"internal_name": this.flowDef.internal_name || this.generateInternalName(this.flowDef.name),
|
|
510
|
+
"category": this.flowDef.category || 'custom',
|
|
511
|
+
"tags": this.flowDef.tags || [],
|
|
512
512
|
"metadata": {
|
|
513
513
|
"version": "2.0",
|
|
514
514
|
"created": this.timestamp,
|
|
@@ -519,9 +519,9 @@ class CompleteFlowXMLGenerator {
|
|
|
519
519
|
"instance": this.instanceName
|
|
520
520
|
},
|
|
521
521
|
"properties": {
|
|
522
|
-
"run_as": flowDef.run_as || 'user',
|
|
523
|
-
"accessible_from": flowDef.accessible_from || 'package_private',
|
|
524
|
-
"callable_by_client_api": flowDef.callable_by_client_api || false,
|
|
522
|
+
"run_as": this.flowDef.run_as || 'user',
|
|
523
|
+
"accessible_from": this.flowDef.accessible_from || 'package_private',
|
|
524
|
+
"callable_by_client_api": this.flowDef.callable_by_client_api || false,
|
|
525
525
|
"active": true,
|
|
526
526
|
"status": "published"
|
|
527
527
|
},
|
|
@@ -545,8 +545,8 @@ class CompleteFlowXMLGenerator {
|
|
|
545
545
|
"flowData": {
|
|
546
546
|
"flow_id": this.flowSysId,
|
|
547
547
|
"snapshot_id": this.snapshotSysId,
|
|
548
|
-
"run_as": flowDef.run_as || 'user',
|
|
549
|
-
"accessible_from": flowDef.accessible_from || 'package_private'
|
|
548
|
+
"run_as": this.flowDef.run_as || 'user',
|
|
549
|
+
"accessible_from": this.flowDef.accessible_from || 'package_private'
|
|
550
550
|
}
|
|
551
551
|
},
|
|
552
552
|
"layout": {
|
|
@@ -560,15 +560,15 @@ class CompleteFlowXMLGenerator {
|
|
|
560
560
|
"id": triggerSysId,
|
|
561
561
|
"type": triggerType.sys_id,
|
|
562
562
|
"type_name": triggerType.internal_name,
|
|
563
|
-
"table": flowDef.table || '',
|
|
564
|
-
"condition": flowDef.trigger_condition || '',
|
|
563
|
+
"table": this.flowDef.table || '',
|
|
564
|
+
"condition": this.flowDef.trigger_condition || '',
|
|
565
565
|
"active": true
|
|
566
566
|
}],
|
|
567
|
-
"variables": flowDef.variables || [],
|
|
567
|
+
"variables": this.flowDef.variables || [],
|
|
568
568
|
"inputs": {},
|
|
569
569
|
"outputs": {},
|
|
570
|
-
"subflows": flowDef.subflows || [],
|
|
571
|
-
"error_handling": flowDef.error_handling || { on_error: 'stop' },
|
|
570
|
+
"subflows": this.flowDef.subflows || [],
|
|
571
|
+
"error_handling": this.flowDef.error_handling || { on_error: 'stop' },
|
|
572
572
|
"label_cache": labelCache
|
|
573
573
|
};
|
|
574
574
|
}
|
|
@@ -576,10 +576,10 @@ class CompleteFlowXMLGenerator {
|
|
|
576
576
|
* Generate trigger XML with v2 structure
|
|
577
577
|
*/
|
|
578
578
|
generateTriggerXML(flowDef, triggerSysId, updateSetSysId) {
|
|
579
|
-
const triggerType = this.getTriggerTypeDefinition(flowDef.trigger_type);
|
|
579
|
+
const triggerType = this.getTriggerTypeDefinition(this.flowDef.trigger_type);
|
|
580
580
|
const encodedValues = this.encodeFlowValue({
|
|
581
|
-
table: flowDef.table || '',
|
|
582
|
-
condition: flowDef.trigger_condition || '',
|
|
581
|
+
table: this.flowDef.table || '',
|
|
582
|
+
condition: this.flowDef.trigger_condition || '',
|
|
583
583
|
trigger_type: triggerType.sys_id
|
|
584
584
|
});
|
|
585
585
|
return `
|
|
@@ -589,7 +589,7 @@ class CompleteFlowXMLGenerator {
|
|
|
589
589
|
<action>INSERT_OR_UPDATE</action>
|
|
590
590
|
<application display_value="Global">global</application>
|
|
591
591
|
<name>sys_hub_trigger_instance_v2_${triggerSysId}</name>
|
|
592
|
-
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_trigger_instance_v2"><sys_hub_trigger_instance_v2 action="INSERT_OR_UPDATE"><active>true</active><condition>${this.escapeXml(flowDef.trigger_condition || '')}</condition><flow display_value="${this.escapeXml(flowDef.name)}">${this.flowSysId}</flow><flow_trigger display_value="${triggerType.display_name}">${triggerType.sys_id}</flow_trigger><name>Trigger</name><order>0</order><parent_ui_id/><sys_class_name>sys_hub_trigger_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>${triggerSysId}</sys_id><sys_mod_count>0</sys_mod_count><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><table>${flowDef.table || ''}</table><trigger_definition display_value="${triggerType.display_name}">${triggerType.sys_id}</trigger_definition><trigger_inputs/><trigger_outputs/><trigger_type display_value="${triggerType.display_name}">${triggerType.sys_id}</trigger_type><ui_id>${(0, uuid_1.v4)()}</ui_id><values>${encodedValues}</values></sys_hub_trigger_instance_v2></record_update>]]></payload>
|
|
592
|
+
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_trigger_instance_v2"><sys_hub_trigger_instance_v2 action="INSERT_OR_UPDATE"><active>true</active><condition>${this.escapeXml(this.flowDef.trigger_condition || '')}</condition><flow display_value="${this.escapeXml(this.flowDef.name)}">${this.flowSysId}</flow><flow_trigger display_value="${triggerType.display_name}">${triggerType.sys_id}</flow_trigger><name>Trigger</name><order>0</order><parent_ui_id/><sys_class_name>sys_hub_trigger_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_domain>global</sys_domain><sys_domain_path>/</sys_domain_path><sys_id>${triggerSysId}</sys_id><sys_mod_count>0</sys_mod_count><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><table>${this.flowDef.table || ''}</table><trigger_definition display_value="${triggerType.display_name}">${triggerType.sys_id}</trigger_definition><trigger_inputs/><trigger_outputs/><trigger_type display_value="${triggerType.display_name}">${triggerType.sys_id}</trigger_type><ui_id>${(0, uuid_1.v4)()}</ui_id><values>${encodedValues}</values></sys_hub_trigger_instance_v2></record_update>]]></payload>
|
|
593
593
|
<remote_update_set display_value="${this.escapeXml(this.updateSetName)}">${updateSetSysId}</remote_update_set>
|
|
594
594
|
<source_table>sys_hub_trigger_instance_v2</source_table>
|
|
595
595
|
<type>Flow Designer Trigger</type>
|
|
@@ -618,7 +618,7 @@ class CompleteFlowXMLGenerator {
|
|
|
618
618
|
<action>INSERT_OR_UPDATE</action>
|
|
619
619
|
<application display_value="Global">global</application>
|
|
620
620
|
<name>sys_hub_action_instance_v2_${actionSysId}</name>
|
|
621
|
-
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_action_instance_v2"><sys_hub_action_instance_v2 action="INSERT_OR_UPDATE"><action_type display_value="${actionType.display_name}">${actionType.sys_id}</action_type><action_type_parent/><attributes/><comment>${this.escapeXml(activity.description || '')}</comment><compiled_snapshot>${actionType.sys_id}</compiled_snapshot><display_text/><flow display_value="${this.escapeXml(flowDef.name)}">${this.flowSysId}</flow><generation_source/><name>${this.escapeXml(activity.name)}</name><order>${orderValue}</order><parent_ui_id/><sys_class_name>sys_hub_action_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${actionSysId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope display_value="Global">global</sys_scope><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${uiId}</ui_id><updation_source/><values>${encodedValues}</values></sys_hub_action_instance_v2></record_update>]]></payload>
|
|
621
|
+
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_action_instance_v2"><sys_hub_action_instance_v2 action="INSERT_OR_UPDATE"><action_type display_value="${actionType.display_name}">${actionType.sys_id}</action_type><action_type_parent/><attributes/><comment>${this.escapeXml(activity.description || '')}</comment><compiled_snapshot>${actionType.sys_id}</compiled_snapshot><display_text/><flow display_value="${this.escapeXml(this.flowDef.name)}">${this.flowSysId}</flow><generation_source/><name>${this.escapeXml(activity.name)}</name><order>${orderValue}</order><parent_ui_id/><sys_class_name>sys_hub_action_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${actionSysId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope display_value="Global">global</sys_scope><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${uiId}</ui_id><updation_source/><values>${encodedValues}</values></sys_hub_action_instance_v2></record_update>]]></payload>
|
|
622
622
|
<remote_update_set display_value="${this.escapeXml(this.updateSetName)}">${updateSetSysId}</remote_update_set>
|
|
623
623
|
<source_table>sys_hub_action_instance_v2</source_table>
|
|
624
624
|
<type>Flow Designer Action</type>
|
|
@@ -644,7 +644,7 @@ class CompleteFlowXMLGenerator {
|
|
|
644
644
|
<action>INSERT_OR_UPDATE</action>
|
|
645
645
|
<application display_value="Global">global</application>
|
|
646
646
|
<name>sys_hub_flow_logic_instance_v2_${startLogicId}</name>
|
|
647
|
-
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_logic_instance_v2"><sys_hub_flow_logic_instance_v2 action="INSERT_OR_UPDATE"><attributes/><block display_value="">${this.generateSysId()}</block><comment>Flow Start</comment><connected_to/><decision_table/><display_text>Start</display_text><flow display_value="${this.escapeXml(flowDef.name)}">${this.flowSysId}</flow><flow_variables_assigned/><generation_source/><logic_definition display_value="Start">1176605ea76103004f27b0d2187901c5</logic_definition><order>0</order><outputs_assigned/><parent_ui_id/><sys_class_name>sys_hub_flow_logic_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${startLogicId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope/><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${(0, uuid_1.v4)()}</ui_id><updation_source/><values>${startLogicValues}</values><workflow_reference/></sys_hub_flow_logic_instance_v2></record_update>]]></payload>
|
|
647
|
+
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_logic_instance_v2"><sys_hub_flow_logic_instance_v2 action="INSERT_OR_UPDATE"><attributes/><block display_value="">${this.generateSysId()}</block><comment>Flow Start</comment><connected_to/><decision_table/><display_text>Start</display_text><flow display_value="${this.escapeXml(this.flowDef.name)}">${this.flowSysId}</flow><flow_variables_assigned/><generation_source/><logic_definition display_value="Start">1176605ea76103004f27b0d2187901c5</logic_definition><order>0</order><outputs_assigned/><parent_ui_id/><sys_class_name>sys_hub_flow_logic_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${startLogicId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope/><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${(0, uuid_1.v4)()}</ui_id><updation_source/><values>${startLogicValues}</values><workflow_reference/></sys_hub_flow_logic_instance_v2></record_update>]]></payload>
|
|
648
648
|
<remote_update_set display_value="${this.escapeXml(this.updateSetName)}">${updateSetSysId}</remote_update_set>
|
|
649
649
|
<source_table>sys_hub_flow_logic_instance_v2</source_table>
|
|
650
650
|
<type>Flow Designer Logic</type>
|
|
@@ -665,7 +665,7 @@ class CompleteFlowXMLGenerator {
|
|
|
665
665
|
<action>INSERT_OR_UPDATE</action>
|
|
666
666
|
<application display_value="Global">global</application>
|
|
667
667
|
<name>sys_hub_flow_logic_instance_v2_${connectionLogicId}</name>
|
|
668
|
-
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_logic_instance_v2"><sys_hub_flow_logic_instance_v2 action="INSERT_OR_UPDATE"><attributes/><block display_value="">${this.generateSysId()}</block><comment>Connection</comment><connected_to/><decision_table/><display_text/><flow display_value="${this.escapeXml(flowDef.name)}">${this.flowSysId}</flow><flow_variables_assigned/><generation_source/><logic_definition/><order>${logicIndex * 100}</order><outputs_assigned/><parent_ui_id/><sys_class_name>sys_hub_flow_logic_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${connectionLogicId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope/><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${(0, uuid_1.v4)()}</ui_id><updation_source/><values>${connectionValues}</values><workflow_reference/></sys_hub_flow_logic_instance_v2></record_update>]]></payload>
|
|
668
|
+
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_logic_instance_v2"><sys_hub_flow_logic_instance_v2 action="INSERT_OR_UPDATE"><attributes/><block display_value="">${this.generateSysId()}</block><comment>Connection</comment><connected_to/><decision_table/><display_text/><flow display_value="${this.escapeXml(this.flowDef.name)}">${this.flowSysId}</flow><flow_variables_assigned/><generation_source/><logic_definition/><order>${logicIndex * 100}</order><outputs_assigned/><parent_ui_id/><sys_class_name>sys_hub_flow_logic_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${connectionLogicId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope/><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${(0, uuid_1.v4)()}</ui_id><updation_source/><values>${connectionValues}</values><workflow_reference/></sys_hub_flow_logic_instance_v2></record_update>]]></payload>
|
|
669
669
|
<remote_update_set display_value="${this.escapeXml(this.updateSetName)}">${updateSetSysId}</remote_update_set>
|
|
670
670
|
<source_table>sys_hub_flow_logic_instance_v2</source_table>
|
|
671
671
|
<type>Flow Designer Logic</type>
|
|
@@ -687,7 +687,7 @@ class CompleteFlowXMLGenerator {
|
|
|
687
687
|
<action>INSERT_OR_UPDATE</action>
|
|
688
688
|
<application display_value="Global">global</application>
|
|
689
689
|
<name>sys_hub_flow_logic_instance_v2_${connectionLogicId}</name>
|
|
690
|
-
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_logic_instance_v2"><sys_hub_flow_logic_instance_v2 action="INSERT_OR_UPDATE"><attributes/><block display_value="">${this.generateSysId()}</block><comment>Connection</comment><connected_to/><decision_table/><display_text/><flow display_value="${this.escapeXml(flowDef.name)}">${this.flowSysId}</flow><flow_variables_assigned/><generation_source/><logic_definition/><order>${logicIndex * 100}</order><outputs_assigned/><parent_ui_id/><sys_class_name>sys_hub_flow_logic_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${connectionLogicId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope/><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${(0, uuid_1.v4)()}</ui_id><updation_source/><values>${connectionValues}</values><workflow_reference/></sys_hub_flow_logic_instance_v2></record_update>]]></payload>
|
|
690
|
+
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_logic_instance_v2"><sys_hub_flow_logic_instance_v2 action="INSERT_OR_UPDATE"><attributes/><block display_value="">${this.generateSysId()}</block><comment>Connection</comment><connected_to/><decision_table/><display_text/><flow display_value="${this.escapeXml(this.flowDef.name)}">${this.flowSysId}</flow><flow_variables_assigned/><generation_source/><logic_definition/><order>${logicIndex * 100}</order><outputs_assigned/><parent_ui_id/><sys_class_name>sys_hub_flow_logic_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${connectionLogicId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope/><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${(0, uuid_1.v4)()}</ui_id><updation_source/><values>${connectionValues}</values><workflow_reference/></sys_hub_flow_logic_instance_v2></record_update>]]></payload>
|
|
691
691
|
<remote_update_set display_value="${this.escapeXml(this.updateSetName)}">${updateSetSysId}</remote_update_set>
|
|
692
692
|
<source_table>sys_hub_flow_logic_instance_v2</source_table>
|
|
693
693
|
<type>Flow Designer Logic</type>
|
|
@@ -706,7 +706,7 @@ class CompleteFlowXMLGenerator {
|
|
|
706
706
|
<action>INSERT_OR_UPDATE</action>
|
|
707
707
|
<application display_value="Global">global</application>
|
|
708
708
|
<name>sys_hub_flow_logic_instance_v2_${endLogicId}</name>
|
|
709
|
-
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_logic_instance_v2"><sys_hub_flow_logic_instance_v2 action="INSERT_OR_UPDATE"><attributes/><block display_value="">${this.generateSysId()}</block><comment>Flow End</comment><connected_to/><decision_table/><display_text>End</display_text><flow display_value="${this.escapeXml(flowDef.name)}">${this.flowSysId}</flow><flow_variables_assigned/><generation_source/><logic_definition display_value="End">d176605ea76103004f27b0d2187901c7</logic_definition><order>${(logicIndex + 1) * 100}</order><outputs_assigned/><parent_ui_id/><sys_class_name>sys_hub_flow_logic_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${endLogicId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope/><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${(0, uuid_1.v4)()}</ui_id><updation_source/><values>${endLogicValues}</values><workflow_reference/></sys_hub_flow_logic_instance_v2></record_update>]]></payload>
|
|
709
|
+
<payload><![CDATA[<?xml version="1.0" encoding="UTF-8"?><record_update table="sys_hub_flow_logic_instance_v2"><sys_hub_flow_logic_instance_v2 action="INSERT_OR_UPDATE"><attributes/><block display_value="">${this.generateSysId()}</block><comment>Flow End</comment><connected_to/><decision_table/><display_text>End</display_text><flow display_value="${this.escapeXml(this.flowDef.name)}">${this.flowSysId}</flow><flow_variables_assigned/><generation_source/><logic_definition display_value="End">d176605ea76103004f27b0d2187901c7</logic_definition><order>${(logicIndex + 1) * 100}</order><outputs_assigned/><parent_ui_id/><sys_class_name>sys_hub_flow_logic_instance_v2</sys_class_name><sys_created_by>admin</sys_created_by><sys_created_on>${this.timestamp}</sys_created_on><sys_id>${endLogicId}</sys_id><sys_mod_count>0</sys_mod_count><sys_scope/><sys_updated_by>admin</sys_updated_by><sys_updated_on>${this.timestamp}</sys_updated_on><ui_id>${(0, uuid_1.v4)()}</ui_id><updation_source/><values>${endLogicValues}</values><workflow_reference/></sys_hub_flow_logic_instance_v2></record_update>]]></payload>
|
|
710
710
|
<remote_update_set display_value="${this.escapeXml(this.updateSetName)}">${updateSetSysId}</remote_update_set>
|
|
711
711
|
<source_table>sys_hub_flow_logic_instance_v2</source_table>
|
|
712
712
|
<type>Flow Designer Logic</type>
|
|
@@ -1220,9 +1220,9 @@ exports.CompleteFlowXMLGenerator = CompleteFlowXMLGenerator;
|
|
|
1220
1220
|
* Generate PRODUCTION-READY complete flow XML
|
|
1221
1221
|
*/
|
|
1222
1222
|
function generateCompleteFlowXML(flowDef) {
|
|
1223
|
-
const generator = new CompleteFlowXMLGenerator(flowDef.name.replace(/[^a-zA-Z0-9]+/g, '_') + '_Complete_Import');
|
|
1223
|
+
const generator = new CompleteFlowXMLGenerator(this.flowDef.name.replace(/[^a-zA-Z0-9]+/g, '_') + '_Complete_Import');
|
|
1224
1224
|
const xml = generator.generateCompleteFlowXML(flowDef);
|
|
1225
|
-
const filename = flowDef.name.toLowerCase().replace(/[^a-z0-9]+/g, '_') + '_complete_flow.xml';
|
|
1225
|
+
const filename = this.flowDef.name.toLowerCase().replace(/[^a-z0-9]+/g, '_') + '_complete_flow.xml';
|
|
1226
1226
|
const filePath = generator.saveToFile(xml, filename);
|
|
1227
1227
|
const instructions = `
|
|
1228
1228
|
=== COMPLETE ServiceNow Flow Import Instructions ===
|
|
@@ -1253,7 +1253,7 @@ function generateCompleteFlowXML(flowDef) {
|
|
|
1253
1253
|
|
|
1254
1254
|
6. Review and "Commit Update Set"
|
|
1255
1255
|
|
|
1256
|
-
7. Open Flow Designer and find: "${flowDef.name}"
|
|
1256
|
+
7. Open Flow Designer and find: "${this.flowDef.name}"
|
|
1257
1257
|
|
|
1258
1258
|
💡 The flow includes ALL requested features:
|
|
1259
1259
|
✅ Automated assignment based on analysis
|
package/dist/version.js
CHANGED
|
@@ -7,12 +7,30 @@ exports.VERSION_INFO = exports.VERSION = void 0;
|
|
|
7
7
|
exports.getVersionString = getVersionString;
|
|
8
8
|
exports.getLatestFeatures = getLatestFeatures;
|
|
9
9
|
exports.isLatestVersion = isLatestVersion;
|
|
10
|
-
exports.VERSION = '1.3.
|
|
10
|
+
exports.VERSION = '1.3.31';
|
|
11
11
|
exports.VERSION_INFO = {
|
|
12
12
|
version: exports.VERSION,
|
|
13
13
|
name: 'Snow-Flow',
|
|
14
14
|
description: 'ServiceNow Queen Agent - Hive-Mind Intelligence for ServiceNow Development',
|
|
15
15
|
features: {
|
|
16
|
+
'1.3.31': [
|
|
17
|
+
'🔧 VERSION FIX: Correct version now displayed with snow-flow --version',
|
|
18
|
+
'✅ All v1.3.30 fixes included plus proper version constant update'
|
|
19
|
+
],
|
|
20
|
+
'1.3.30': [
|
|
21
|
+
'🔥 CRITICAL FIX: BUG-001 Production Blocker Resolved - flowDef is not defined error fixed',
|
|
22
|
+
'✅ Flow deployments now work correctly - all this.flowDef references fixed',
|
|
23
|
+
'⚡ Users should update immediately with npm update -g snow-flow'
|
|
24
|
+
],
|
|
25
|
+
'1.3.29': [
|
|
26
|
+
'🚨 CRITICAL FIXES: v1.3.28 - All Beta Testing Issues RESOLVED!',
|
|
27
|
+
'✅ Issue #1: Flow Deployment Creates Empty Flows - COMPLETELY FIXED',
|
|
28
|
+
'✅ Issue #2: Tool Registry Mapping Failures - COMPLETELY FIXED',
|
|
29
|
+
'✅ Issue #3: Metadata Response Failures - COMPLETELY FIXED',
|
|
30
|
+
'🚀 New CompleteFlowXMLGenerator with v2 tables and proper encoding',
|
|
31
|
+
'🧠 New MCPToolRegistry with robust tool name resolution',
|
|
32
|
+
'📊 New DeploymentMetadataHandler with complete metadata extraction'
|
|
33
|
+
],
|
|
16
34
|
'1.3.27': [
|
|
17
35
|
'🤖 AUTONOMOUS SYSTEMS: All 4 autonomous systems now ENABLED BY DEFAULT in swarm command!',
|
|
18
36
|
'✅ SELF-DOCUMENTING: Automatic documentation generation and updates (default: enabled)',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.31",
|
|
4
4
|
"description": "ServiceNow Queen Agent - Hive-Mind Intelligence for ServiceNow Development inspired by claude-flow. Transform complex workflows into elegant one-command orchestration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|