rez_core 2.2.120 → 2.2.122
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/package.json
CHANGED
|
@@ -149,10 +149,19 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
149
149
|
);
|
|
150
150
|
const [workflows, stageGroups, stages] = factoryData;
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
`SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id =
|
|
152
|
+
let statusRow = await this.dataSource.query(
|
|
153
|
+
`SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = ?`,
|
|
154
|
+
[organization_id],
|
|
154
155
|
);
|
|
155
156
|
|
|
157
|
+
if (statusRow.length === 0) {
|
|
158
|
+
statusRow = await this.dataSource.query(
|
|
159
|
+
`SELECT * FROM cr_list_master_items WHERE code='STATUS_ACTIVE' AND organization_id = -1`,
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const statusValue = statusRow[0]?.id;
|
|
164
|
+
|
|
156
165
|
// === 1. Workflow mapping
|
|
157
166
|
const workflowIdMap: Record<number, number> = {};
|
|
158
167
|
for (const row of workflows) {
|
|
@@ -163,7 +172,7 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
163
172
|
organization_id,
|
|
164
173
|
level_id: organization_id,
|
|
165
174
|
entity_type: 'WRFW',
|
|
166
|
-
status:
|
|
175
|
+
status: statusValue,
|
|
167
176
|
},
|
|
168
177
|
loggedInUser,
|
|
169
178
|
);
|
|
@@ -190,7 +199,7 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
190
199
|
organization_id,
|
|
191
200
|
level_id: organization_id,
|
|
192
201
|
entity_type: 'STGP',
|
|
193
|
-
status:
|
|
202
|
+
status: statusValue,
|
|
194
203
|
},
|
|
195
204
|
loggedInUser,
|
|
196
205
|
);
|
|
@@ -213,7 +222,7 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
213
222
|
organization_id,
|
|
214
223
|
level_id: organization_id,
|
|
215
224
|
entity_type: 'STG',
|
|
216
|
-
status:
|
|
225
|
+
status: statusValue,
|
|
217
226
|
},
|
|
218
227
|
loggedInUser,
|
|
219
228
|
);
|
|
@@ -301,7 +310,7 @@ export class PopulateWorkflowService extends EntityServiceImpl {
|
|
|
301
310
|
level_id: organization_id,
|
|
302
311
|
entity_type: 'ACTN',
|
|
303
312
|
form: formActionCategory.length > 0 ? formViewMaster[0]?.id : null,
|
|
304
|
-
status:
|
|
313
|
+
status: statusValue,
|
|
305
314
|
},
|
|
306
315
|
loggedInUser,
|
|
307
316
|
);
|