From e57b2561ef74651b37cec9076a05bed840ecfccf Mon Sep 17 00:00:00 2001 From: Vishesh Saluja Date: Sat, 31 Aug 2024 18:48:29 -0400 Subject: [PATCH 1/2] process_save_issue-524 --- src/main/resources/static/js/gw.process.js | 28 +++++++++++++++++-- .../resources/static/js/gw.process.util.js | 5 ++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/main/resources/static/js/gw.process.js b/src/main/resources/static/js/gw.process.js index 6a6c9182..6e148ddb 100644 --- a/src/main/resources/static/js/gw.process.js +++ b/src/main/resources/static/js/gw.process.js @@ -764,6 +764,7 @@ GW.process = { $("#add-process-" + GW.process.cmid).click(function () { if (GW.process.add(false, GW.process.cmid)) frame.closeFrame(); + cmid = Math.floor(Math.random() * 1000); }); $("#run-process-" + GW.process.cmid).click(function () { @@ -1326,6 +1327,9 @@ GW.process = { owner = msg.owner; + + GW.process.cmid = Math.floor(Math.random() * 1000); + var confidential_field = '
Confidential
' + '
'; @@ -1465,12 +1469,12 @@ GW.process = { $("#processid").val(process_id); - GW.process.displayCodeArea(process_id, process_name, code_type, code); + GW.process.displayCodeArea(process_id, process_name, code_type, code, GW.process.cmid); GW.process.displayToolbar(process_id, process_name, code_type); $("#showCurrent").click(function () { - GW.menu.details(process_id, "process"); + GW.menu.details(process_id); GW.process.showSaved(); }); @@ -1569,12 +1573,13 @@ GW.process = { $("#" + codeareaid).append(cont); }, - displayCodeArea: function (process_id, process_name, code_type, code) { + displayCodeArea: function (process_id, process_name, code_type, code, cmid) { GW.process.util.displayCodeArea( code_type, code, "#code-embed", "#process_code_window", + cmid, ); }, @@ -1607,6 +1612,7 @@ GW.process = { GW.process.current_pid = $("#processid").val(); GW.process.update(GW.process.current_pid); + // GW.process.update(GW.process.current_pid, GW.process.cmid); $("#processcategory").prop("disabled", true); //don't allow change of process category @@ -1903,6 +1909,7 @@ GW.process = { var pdesc = $("#processcategory").val(); + // var pcode = GW.process.getCode(cmid); var pcode = GW.process.getCode(); var confidential = $('input[name="confidential_process"]:checked').val(); @@ -1967,6 +1974,19 @@ GW.process = { GW.process.expand(req.lang); + // GW.menu.details(msg.id, 'process').click(); + + // GW.process.display(msg); + console.log("add process id: " + msg.id); + + setTimeout(function() { + // if (GW.process.editor) { + // GW.process.editor.setValue(req.code); // Set the editor's content to the added process code + // } + GW.menu.details(msg.id, 'process')?.click(); + }, 100); + + if (run) GW.process.runProcess( msg.id, @@ -1984,6 +2004,8 @@ GW.process = { return false; } + // cmid = Math.floor(Math.random() * 1000); + // console.log("after add: " + cmid); }, /** diff --git a/src/main/resources/static/js/gw.process.util.js b/src/main/resources/static/js/gw.process.util.js index 7c6ec538..ef2a849f 100644 --- a/src/main/resources/static/js/gw.process.util.js +++ b/src/main/resources/static/js/gw.process.util.js @@ -8,6 +8,7 @@ GW.process.util = { code, code_editor_container_id, process_window_container_id, + cmid, ) { $(code_editor_container_id).html(""); @@ -180,6 +181,10 @@ GW.process.util = { // Add any additional editor options or event listeners here }); + if(cmid!=null){ + console.log("Editor cmid: " + cmid); + } + } // GW.process.util.refreshCodeEditor(); From ebfdee371de9b1428b0bc1a5ba23ef9f51cd695d Mon Sep 17 00:00:00 2001 From: Vishesh Saluja Date: Mon, 16 Sep 2024 11:53:53 -0400 Subject: [PATCH 2/2] cleaned --- src/main/resources/static/js/gw.process.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/resources/static/js/gw.process.js b/src/main/resources/static/js/gw.process.js index 6e148ddb..fd02308a 100644 --- a/src/main/resources/static/js/gw.process.js +++ b/src/main/resources/static/js/gw.process.js @@ -764,7 +764,7 @@ GW.process = { $("#add-process-" + GW.process.cmid).click(function () { if (GW.process.add(false, GW.process.cmid)) frame.closeFrame(); - cmid = Math.floor(Math.random() * 1000); + // cmid = Math.floor(Math.random() * 1000); }); $("#run-process-" + GW.process.cmid).click(function () { @@ -1328,7 +1328,7 @@ GW.process = { owner = msg.owner; - GW.process.cmid = Math.floor(Math.random() * 1000); + // GW.process.cmid = Math.floor(Math.random() * 1000); var confidential_field = '
Confidential
' + @@ -1469,7 +1469,8 @@ GW.process = { $("#processid").val(process_id); - GW.process.displayCodeArea(process_id, process_name, code_type, code, GW.process.cmid); + GW.process.displayCodeArea(process_id, process_name, code_type, code); + // GW.process.displayCodeArea(process_id, process_name, code_type, code, GW.process.cmid); GW.process.displayToolbar(process_id, process_name, code_type); @@ -1573,13 +1574,12 @@ GW.process = { $("#" + codeareaid).append(cont); }, - displayCodeArea: function (process_id, process_name, code_type, code, cmid) { + displayCodeArea: function (process_id, process_name, code_type, code) { GW.process.util.displayCodeArea( code_type, code, "#code-embed", "#process_code_window", - cmid, ); }, @@ -2044,8 +2044,10 @@ GW.process = { } }, - sendExecuteRequest: function (req, dialog, button) { + sendExecuteRequest: function (req, dialog, button, log_pid) { + console.log("sendExecRequest-1"); GW.process.clearProcessLogging(); + console.log("sendExecRequest-2"); var newhistid = GW.general.makeid(12);