@xuda.io/xuda-worker-bundle-min 1.3.1067 → 1.3.1069
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/index.js +73 -41
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5013,6 +5013,33 @@ func.datasource.get_progFields = async function (SESSION_ID, dsSessionP) {
|
|
|
5013
5013
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP];
|
|
5014
5014
|
const _view_obj = await func.utils.VIEWS_OBJ.get(SESSION_ID, _ds.prog_id);
|
|
5015
5015
|
return _view_obj.progFields;
|
|
5016
|
+
};
|
|
5017
|
+
func.datasource.update_changes_for_out_parameter = async function (
|
|
5018
|
+
SESSION_ID,
|
|
5019
|
+
dsSessionP
|
|
5020
|
+
) {
|
|
5021
|
+
let _session = SESSION_OBJ[SESSION_ID];
|
|
5022
|
+
let _ds = _session.DS_GLB[dsSessionP];
|
|
5023
|
+
//
|
|
5024
|
+
if (_ds.PARAM_OUT_INFO) {
|
|
5025
|
+
let data = {};
|
|
5026
|
+
for await (const [key, val] of Object.entries(_ds.PARAM_OUT_INFO)) {
|
|
5027
|
+
if (val.prop === "out") {
|
|
5028
|
+
try {
|
|
5029
|
+
const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
|
|
5030
|
+
data[val.details] = _ds.data_feed.rows[row_idx][val.fieldId];
|
|
5031
|
+
} catch (err) {
|
|
5032
|
+
console.error(err);
|
|
5033
|
+
}
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
5036
|
+
if (!_.isEmpty(data)) {
|
|
5037
|
+
let datasource_changes = {
|
|
5038
|
+
[_ds.dsSession]: { [_ds.currentRecordId]: data },
|
|
5039
|
+
};
|
|
5040
|
+
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
5041
|
+
}
|
|
5042
|
+
}
|
|
5016
5043
|
};
|
|
5017
5044
|
func.utils = {};
|
|
5018
5045
|
|
|
@@ -7421,7 +7448,7 @@ func.events.validate = async function (
|
|
|
7421
7448
|
argumentsP,
|
|
7422
7449
|
return_validation_onlyP,
|
|
7423
7450
|
};
|
|
7424
|
-
|
|
7451
|
+
const search_event_in_parent_ds = async function () {
|
|
7425
7452
|
if (_ds && typeof _ds.parentDataSourceNo !== "undefined") {
|
|
7426
7453
|
await func.events.validate(
|
|
7427
7454
|
SESSION_ID,
|
|
@@ -7801,7 +7828,6 @@ func.events.execute = async function (
|
|
|
7801
7828
|
var _ds = _session.DS_GLB[dsSessionP];
|
|
7802
7829
|
if (functionP === "update") refIdP = null; // in case of left over when program changing from call function to update
|
|
7803
7830
|
|
|
7804
|
-
var _session = SESSION_OBJ[SESSION_ID];
|
|
7805
7831
|
var job_index = func.events.find_job_index(SESSION_ID, jobNoP);
|
|
7806
7832
|
if (_session.WORKER_OBJ.jobs?.[job_index]?.stat === "busy") {
|
|
7807
7833
|
if (jobNoP) _session.WORKER_OBJ.stat = job_index;
|
|
@@ -7919,21 +7945,21 @@ func.events.execute = async function (
|
|
|
7919
7945
|
}
|
|
7920
7946
|
}
|
|
7921
7947
|
|
|
7922
|
-
var log_error = function (descP, detailsP, warning) {
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
};
|
|
7948
|
+
// var log_error = function (descP, detailsP, warning) {
|
|
7949
|
+
// func.utils.debug.log(SESSION_ID, log_nodeId, {
|
|
7950
|
+
// module: "event",
|
|
7951
|
+
// action: functionP,
|
|
7952
|
+
// source: log_source,
|
|
7953
|
+
// prop: descP,
|
|
7954
|
+
// details: detailsP,
|
|
7955
|
+
// result: null,
|
|
7956
|
+
// error: !warning,
|
|
7957
|
+
// warning: warning,
|
|
7958
|
+
// fields: null,
|
|
7959
|
+
// type: "event",
|
|
7960
|
+
// prog_id: log_prog_id,
|
|
7961
|
+
// });
|
|
7962
|
+
// };
|
|
7937
7963
|
|
|
7938
7964
|
const get_params_obj = async function () {
|
|
7939
7965
|
const _prog = await func.utils.VIEWS_OBJ.get(
|
|
@@ -8527,31 +8553,37 @@ func.events.execute = async function (
|
|
|
8527
8553
|
|
|
8528
8554
|
let _ds_new = _session.DS_GLB[ret.dsSessionP];
|
|
8529
8555
|
let parameters = args?.calling_trigger_prop?.data?.name?.parameters;
|
|
8530
|
-
if (parameters && !_.isEmpty(parameters)
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
_ds_new.
|
|
8534
|
-
)
|
|
8535
|
-
if (val.prop === "out") {
|
|
8536
|
-
try {
|
|
8537
|
-
const row_idx = func.common.find_ROWID_idx(
|
|
8538
|
-
_ds_new,
|
|
8539
|
-
_ds_new.currentRecordId
|
|
8540
|
-
);
|
|
8541
|
-
data[val.details] =
|
|
8542
|
-
_ds_new.data_feed.rows[row_idx][val.fieldId];
|
|
8543
|
-
} catch (err) {
|
|
8544
|
-
console.error(err);
|
|
8545
|
-
}
|
|
8546
|
-
}
|
|
8547
|
-
}
|
|
8548
|
-
if (!_.isEmpty(data)) {
|
|
8549
|
-
let datasource_changes = {
|
|
8550
|
-
[_ds.dsSession]: { [_ds.currentRecordId]: data },
|
|
8551
|
-
};
|
|
8552
|
-
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
8553
|
-
}
|
|
8556
|
+
if (parameters && !_.isEmpty(parameters)) {
|
|
8557
|
+
await func.datasource.update_changes_for_out_parameter(
|
|
8558
|
+
SESSION_ID,
|
|
8559
|
+
_ds_new.dsSession
|
|
8560
|
+
);
|
|
8554
8561
|
}
|
|
8562
|
+
// if (parameters && !_.isEmpty(parameters) && _ds_new.PARAM_OUT_INFO) {
|
|
8563
|
+
// let data = {};
|
|
8564
|
+
// for await (const [key, val] of Object.entries(
|
|
8565
|
+
// _ds_new.PARAM_OUT_INFO
|
|
8566
|
+
// )) {
|
|
8567
|
+
// if (val.prop === "out") {
|
|
8568
|
+
// try {
|
|
8569
|
+
// const row_idx = func.common.find_ROWID_idx(
|
|
8570
|
+
// _ds_new,
|
|
8571
|
+
// _ds_new.currentRecordId
|
|
8572
|
+
// );
|
|
8573
|
+
// data[val.details] =
|
|
8574
|
+
// _ds_new.data_feed.rows[row_idx][val.fieldId];
|
|
8575
|
+
// } catch (err) {
|
|
8576
|
+
// console.error(err);
|
|
8577
|
+
// }
|
|
8578
|
+
// }
|
|
8579
|
+
// }
|
|
8580
|
+
// if (!_.isEmpty(data)) {
|
|
8581
|
+
// let datasource_changes = {
|
|
8582
|
+
// [_ds.dsSession]: { [_ds.currentRecordId]: data },
|
|
8583
|
+
// };
|
|
8584
|
+
// await func.datasource.update(SESSION_ID, datasource_changes);
|
|
8585
|
+
// }
|
|
8586
|
+
// }
|
|
8555
8587
|
|
|
8556
8588
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
8557
8589
|
}
|