@xuda.io/xuda-worker-bundle 1.3.1154 → 1.3.1156

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 +86 -35
  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,
@@ -8205,8 +8250,8 @@ func.events.execute = async function (
8205
8250
  func.utils.debug.log(
8206
8251
  SESSION_ID,
8207
8252
  _session.DS_GLB[dsP].prog_id +
8208
- "_" +
8209
- _session.DS_GLB[dsP].callingMenuId,
8253
+ "_" +
8254
+ _session.DS_GLB[dsP].callingMenuId,
8210
8255
  {
8211
8256
  module: "widgets",
8212
8257
  action: "Init",
@@ -8226,8 +8271,8 @@ func.events.execute = async function (
8226
8271
  func.utils.debug.log(
8227
8272
  SESSION_ID,
8228
8273
  _session.DS_GLB[dsP].prog_id +
8229
- "_" +
8230
- _session.DS_GLB[dsP].callingMenuId,
8274
+ "_" +
8275
+ _session.DS_GLB[dsP].callingMenuId,
8231
8276
  {
8232
8277
  module: "widgets",
8233
8278
  action: "Init",
@@ -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
8839
  // if (!output_field) {
8791
8840
  // func.utils.debug_report(
8792
8841
  // SESSION_ID,
8793
8842
  // "func.events.execute",
8794
8843
  // `${elementP} >${triggerP} >${functionP} > Output field not defined`,
8795
- // "E"
8844
+ // "W"
8796
8845
  // );
8797
- // func.events.delete_job(SESSION_ID, jobNoP);
8798
- // return;
8846
+ // // func.events.delete_job(SESSION_ID, jobNoP);
8847
+ // // return;
8799
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 () {
@@ -9081,7 +9132,7 @@ func.events.delete_job = function (SESSION_ID, jobNoP) {
9081
9132
  if (ds_obj) {
9082
9133
  delete SCREEN_BLOCKER_OBJ[
9083
9134
  ds_obj.screenId +
9084
- (ds_obj.callingScreenId ? "_" + ds_obj.callingScreenId : "")
9135
+ (ds_obj.callingScreenId ? "_" + ds_obj.callingScreenId : "")
9085
9136
  ];
9086
9137
  }
9087
9138
  if (
@@ -9108,7 +9159,7 @@ func.events.delete_job_0 = function (SESSION_ID) {
9108
9159
  if (ds_obj) {
9109
9160
  delete SCREEN_BLOCKER_OBJ[
9110
9161
  ds_obj.screenId +
9111
- (ds_obj.callingScreenId ? "_" + ds_obj.callingScreenId : "")
9162
+ (ds_obj.callingScreenId ? "_" + ds_obj.callingScreenId : "")
9112
9163
  ];
9113
9164
  }
9114
9165
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle",
3
- "version": "1.3.1154",
3
+ "version": "1.3.1156",
4
4
  "description": "xuda framework",
5
5
  "main": "index.js",
6
6
  "scripts": {