@xuda.io/xuda-worker-bundle-min 1.3.1095 → 1.3.1096

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.
Files changed (2) hide show
  1. package/index.js +87 -36
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -8091,6 +8091,51 @@ func.events.execute = async function (
8091
8091
 
8092
8092
  return _value;
8093
8093
  };
8094
+
8095
+ const set_outputField = async function (SESSION_ID, elementP, triggerP, functionP, dsSessionP, result) {
8096
+ var _session = SESSION_OBJ[SESSION_ID];
8097
+
8098
+ const output_field = await get_args_property_value("outputField");
8099
+
8100
+ // if (!output_field) {
8101
+ // func.utils.debug_report(
8102
+ // SESSION_ID,
8103
+ // "func.events.execute",
8104
+ // `${elementP} >${triggerP} >${functionP} > Output field not defined`,
8105
+ // "W"
8106
+ // );
8107
+
8108
+ // }
8109
+
8110
+
8111
+
8112
+ if (output_field) {
8113
+ let datasource_changes = {};
8114
+
8115
+ let ret_get_value = await func.datasource.get_value(
8116
+ SESSION_ID,
8117
+ output_field,
8118
+ dsSessionP
8119
+ );
8120
+ if (ret_get_value.found) {
8121
+ let _ds = _session.DS_GLB[ret_get_value.dsSessionP];
8122
+ if (!datasource_changes[_ds.dsSession]) {
8123
+ datasource_changes[_ds.dsSession] = {};
8124
+ }
8125
+ if (
8126
+ !datasource_changes[_ds.dsSession][ret_get_value.currentRecordId]
8127
+ ) {
8128
+ datasource_changes[_ds.dsSession][ret_get_value.currentRecordId] =
8129
+ {};
8130
+ }
8131
+ datasource_changes[_ds.dsSession][ret_get_value.currentRecordId][
8132
+ output_field
8133
+ ] = result;
8134
+ await func.datasource.update(SESSION_ID, datasource_changes);
8135
+ }
8136
+ }
8137
+
8138
+ }
8094
8139
  var args = {
8095
8140
  prog_id: refIdP?.prog,
8096
8141
  screenIdP: refIdP?.prog,
@@ -8650,7 +8695,11 @@ func.events.execute = async function (
8650
8695
  return this.get_data();
8651
8696
  },
8652
8697
  batch: async function () {
8653
- return this.get_data();
8698
+ const result = this.get_data();
8699
+ debugger
8700
+ await set_outputField(SESSION_ID, elementP, triggerP, functionP, dsSessionP, result);
8701
+ return result
8702
+
8654
8703
  },
8655
8704
  update: async function () {
8656
8705
  const obj_values_to_update =
@@ -8785,46 +8834,48 @@ func.events.execute = async function (
8785
8834
  return;
8786
8835
  }
8787
8836
 
8788
- const output_field = await get_args_property_value("outputField");
8837
+ // const output_field = await get_args_property_value("outputField");
8789
8838
 
8790
- if (!output_field) {
8791
- func.utils.debug_report(
8792
- SESSION_ID,
8793
- "func.events.execute",
8794
- `${elementP} >${triggerP} >${functionP} > Output field not defined`,
8795
- "W"
8796
- );
8797
- // func.events.delete_job(SESSION_ID, jobNoP);
8798
- // return;
8799
- }
8839
+ // if (!output_field) {
8840
+ // func.utils.debug_report(
8841
+ // SESSION_ID,
8842
+ // "func.events.execute",
8843
+ // `${elementP} >${triggerP} >${functionP} > Output field not defined`,
8844
+ // "W"
8845
+ // );
8846
+ // // func.events.delete_job(SESSION_ID, jobNoP);
8847
+ // // return;
8848
+ // }
8800
8849
 
8801
8850
  const api_ret = await func.api.call_project_api(_prog_id, params_obj);
8802
8851
 
8803
- if (output_field) {
8804
- let datasource_changes = {};
8852
+ await set_outputField(SESSION_ID, elementP, triggerP, functionP, dsSessionP, api_ret);
8805
8853
 
8806
- let ret_get_value = await func.datasource.get_value(
8807
- SESSION_ID,
8808
- output_field,
8809
- dsSessionP
8810
- );
8811
- if (ret_get_value.found) {
8812
- let _ds = _session.DS_GLB[ret_get_value.dsSessionP];
8813
- if (!datasource_changes[_ds.dsSession]) {
8814
- datasource_changes[_ds.dsSession] = {};
8815
- }
8816
- if (
8817
- !datasource_changes[_ds.dsSession][ret_get_value.currentRecordId]
8818
- ) {
8819
- datasource_changes[_ds.dsSession][ret_get_value.currentRecordId] =
8820
- {};
8821
- }
8822
- datasource_changes[_ds.dsSession][ret_get_value.currentRecordId][
8823
- output_field
8824
- ] = api_ret;
8825
- await func.datasource.update(SESSION_ID, datasource_changes);
8826
- }
8827
- }
8854
+ // if (output_field) {
8855
+ // let datasource_changes = {};
8856
+
8857
+ // let ret_get_value = await func.datasource.get_value(
8858
+ // SESSION_ID,
8859
+ // output_field,
8860
+ // dsSessionP
8861
+ // );
8862
+ // if (ret_get_value.found) {
8863
+ // let _ds = _session.DS_GLB[ret_get_value.dsSessionP];
8864
+ // if (!datasource_changes[_ds.dsSession]) {
8865
+ // datasource_changes[_ds.dsSession] = {};
8866
+ // }
8867
+ // if (
8868
+ // !datasource_changes[_ds.dsSession][ret_get_value.currentRecordId]
8869
+ // ) {
8870
+ // datasource_changes[_ds.dsSession][ret_get_value.currentRecordId] =
8871
+ // {};
8872
+ // }
8873
+ // datasource_changes[_ds.dsSession][ret_get_value.currentRecordId][
8874
+ // output_field
8875
+ // ] = api_ret;
8876
+ // await func.datasource.update(SESSION_ID, datasource_changes);
8877
+ // }
8878
+ // }
8828
8879
  func.events.delete_job(SESSION_ID, jobNoP);
8829
8880
  },
8830
8881
  call_system_api: async function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.1095",
3
+ "version": "1.3.1096",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {