Skip to content

Commit

Permalink
Merge pull request #559 from VisheshSaluja/process_save
Browse files Browse the repository at this point in the history
Issue#524 -- Overwritting of code in processes
  • Loading branch information
VisheshSaluja authored Sep 16, 2024
2 parents 783d2f8 + ebfdee3 commit 3455227
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/main/resources/static/js/gw.process.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -1326,6 +1327,9 @@ GW.process = {

owner = msg.owner;


// GW.process.cmid = Math.floor(Math.random() * 1000);

var confidential_field =
' <div class="col-sm-1 col-form-label control-label">Confidential </div>' +
' <div class="col-sm-2" style="padding-left:30px;">';
Expand Down Expand Up @@ -1466,11 +1470,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();
});
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand All @@ -1984,6 +2004,8 @@ GW.process = {

return false;
}
// cmid = Math.floor(Math.random() * 1000);
// console.log("after add: " + cmid);
},

/**
Expand Down Expand Up @@ -2022,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);

Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/static/js/gw.process.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ GW.process.util = {
code,
code_editor_container_id,
process_window_container_id,
cmid,
)
{
$(code_editor_container_id).html("");
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3455227

Please sign in to comment.