@xuda.io/xuda-worker-bundle 1.3.1277 → 1.3.1278
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 +62 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3215,7 +3215,8 @@ func.datasource.run_events_functions = async function (
|
|
|
3215
3215
|
dataSourceSession,
|
|
3216
3216
|
event_id,
|
|
3217
3217
|
calling_job,
|
|
3218
|
-
async_event
|
|
3218
|
+
async_event,
|
|
3219
|
+
event_parameters
|
|
3219
3220
|
) {
|
|
3220
3221
|
|
|
3221
3222
|
if (typeof dataSourceSession === "undefined" || dataSourceSession === null) {
|
|
@@ -3242,7 +3243,7 @@ func.datasource.run_events_functions = async function (
|
|
|
3242
3243
|
dataSourceSession,
|
|
3243
3244
|
val.data.event_name,
|
|
3244
3245
|
args.callingSourceP,
|
|
3245
|
-
val.data.parameters
|
|
3246
|
+
event_parameters// val.data.parameters
|
|
3246
3247
|
);
|
|
3247
3248
|
|
|
3248
3249
|
if (calling_job || async_event) continue
|
|
@@ -8087,7 +8088,39 @@ func.events.validate = async function (
|
|
|
8087
8088
|
const set_arguments = async function () {
|
|
8088
8089
|
var args = argumentsP || {};
|
|
8089
8090
|
|
|
8090
|
-
for await (let [key, fieldId] of Object.entries(
|
|
8091
|
+
// for await (let [key, fieldId] of Object.entries(
|
|
8092
|
+
// val.data.parameters
|
|
8093
|
+
// )) {
|
|
8094
|
+
// const field_info = func.common.find_item_by_key(
|
|
8095
|
+
// _view_obj.progFields,
|
|
8096
|
+
// "field_id",
|
|
8097
|
+
// fieldId
|
|
8098
|
+
// );
|
|
8099
|
+
|
|
8100
|
+
// var value = await func.common.get_cast_val(
|
|
8101
|
+
// SESSION_ID,
|
|
8102
|
+
// "events",
|
|
8103
|
+
// fieldId,
|
|
8104
|
+
// field_info.props.fieldType,
|
|
8105
|
+
// args[fieldId]
|
|
8106
|
+
// );
|
|
8107
|
+
|
|
8108
|
+
// const ret = await func.datasource.get_value(
|
|
8109
|
+
// SESSION_ID,
|
|
8110
|
+
// fieldId,
|
|
8111
|
+
// dsSessionP,
|
|
8112
|
+
// _ds.currentRecordId
|
|
8113
|
+
// );
|
|
8114
|
+
|
|
8115
|
+
// const datasource_changes = {
|
|
8116
|
+
// [ret.dsSessionP]: {
|
|
8117
|
+
// [ret.currentRecordId]: { [fieldId]: value },
|
|
8118
|
+
// },
|
|
8119
|
+
// };
|
|
8120
|
+
// await func.datasource.update(SESSION_ID, datasource_changes);
|
|
8121
|
+
// }
|
|
8122
|
+
|
|
8123
|
+
for await (let [fieldId, val_obj] of Object.entries(
|
|
8091
8124
|
val.data.parameters
|
|
8092
8125
|
)) {
|
|
8093
8126
|
const field_info = func.common.find_item_by_key(
|
|
@@ -8096,14 +8129,34 @@ func.events.validate = async function (
|
|
|
8096
8129
|
fieldId
|
|
8097
8130
|
);
|
|
8098
8131
|
|
|
8099
|
-
|
|
8132
|
+
if (field_info?.data?.type !== "virtual") {
|
|
8133
|
+
console.warn("parameter field must be virtual, update ignored");
|
|
8134
|
+
continue;
|
|
8135
|
+
}
|
|
8136
|
+
|
|
8137
|
+
if (!args[fieldId]) continue
|
|
8138
|
+
|
|
8139
|
+
|
|
8140
|
+
|
|
8141
|
+
let value = await func.common.get_cast_val(
|
|
8100
8142
|
SESSION_ID,
|
|
8101
8143
|
"events",
|
|
8102
8144
|
fieldId,
|
|
8103
8145
|
field_info.props.fieldType,
|
|
8104
|
-
args[fieldId]
|
|
8146
|
+
args[fieldId].value
|
|
8105
8147
|
);
|
|
8106
8148
|
|
|
8149
|
+
if (!_.isEmpty(args[fieldId].fx)) {
|
|
8150
|
+
value = (
|
|
8151
|
+
await func.expression.get(
|
|
8152
|
+
SESSION_ID,
|
|
8153
|
+
args[fieldId].fx,
|
|
8154
|
+
dsSessionP,
|
|
8155
|
+
"update"
|
|
8156
|
+
)
|
|
8157
|
+
).result;
|
|
8158
|
+
}
|
|
8159
|
+
// find the target field in the program dataset
|
|
8107
8160
|
const ret = await func.datasource.get_value(
|
|
8108
8161
|
SESSION_ID,
|
|
8109
8162
|
fieldId,
|
|
@@ -9054,7 +9107,8 @@ func.events.execute = async function (
|
|
|
9054
9107
|
dsP,
|
|
9055
9108
|
event_name,
|
|
9056
9109
|
jobNoP,
|
|
9057
|
-
null
|
|
9110
|
+
null,
|
|
9111
|
+
calling_trigger_prop?.data?.name?.parameters || {}
|
|
9058
9112
|
);
|
|
9059
9113
|
}
|
|
9060
9114
|
// done_execution(event_name);
|
|
@@ -9084,7 +9138,8 @@ func.events.execute = async function (
|
|
|
9084
9138
|
dsP,
|
|
9085
9139
|
event_name,
|
|
9086
9140
|
jobNoP,
|
|
9087
|
-
calling_trigger_prop?.props?.async
|
|
9141
|
+
calling_trigger_prop?.props?.async,
|
|
9142
|
+
calling_trigger_prop?.data?.name?.parameters || {}
|
|
9088
9143
|
);
|
|
9089
9144
|
// done_execution(event_name);
|
|
9090
9145
|
}
|