@manyos/smileconnect-api 1.45.4 → 1.45.6
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/controller/taskController.js +17 -17
- package/docs/releases.md +1 -1
- package/package.json +1 -1
|
@@ -55,40 +55,40 @@ async function createTask(clientConfig, rootForm, rootRequestId, taskData, creat
|
|
|
55
55
|
const mapping = config.getMapping('task');
|
|
56
56
|
//add required data
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
allTask.forEach(thisTask => {
|
|
60
|
-
thisTask.TaskName = thisTask.summary;
|
|
61
|
-
thisTask.TaskType = 2000;
|
|
62
|
-
thisTask.Status = 1000;
|
|
63
|
-
thisTask.RootRequestFormName = rootForm;
|
|
64
|
-
thisTask.RootRequestMode = "1";
|
|
65
|
-
thisTask.RootRequestName = rootRequestId;
|
|
66
|
-
thisTask.RootRequestInstanceId = rootRequest.data[0]['InstanceId'];
|
|
67
|
-
thisTask.sequence = thisTask.sequence || "1";
|
|
68
|
-
allTaskFinal.push(thisTask);
|
|
69
|
-
});
|
|
58
|
+
let allTaskFinal = allTask;
|
|
70
59
|
|
|
71
60
|
fields.push('TaskName', 'RootRequestInstanceId', 'TaskType', 'Status', 'RootRequestFormName', 'RootRequestMode', 'RootRequestName', 'sequence')
|
|
72
61
|
|
|
73
62
|
//run preScripts
|
|
74
63
|
if (scripts && scripts.preMapping) {
|
|
75
|
-
await scriptController.runScripts(scripts.preMapping,
|
|
64
|
+
await scriptController.runScripts(scripts.preMapping, allTaskFinal, clientConfig.clientId, globalScriptParams);
|
|
76
65
|
}
|
|
77
66
|
|
|
78
|
-
|
|
67
|
+
allTaskFinal = mappingUtil.applyMapping2Remedy(allTaskFinal, mapping, clientConfig.task.constants, fields);
|
|
68
|
+
|
|
69
|
+
allTaskFinal.forEach(thisTask => {
|
|
70
|
+
thisTask.TaskName = thisTask.Summary;
|
|
71
|
+
thisTask.TaskType = 2000;
|
|
72
|
+
thisTask.Status = 1000;
|
|
73
|
+
thisTask.RootRequestFormName = rootForm;
|
|
74
|
+
thisTask.RootRequestMode = "1";
|
|
75
|
+
thisTask.RootRequestName = rootRequestId;
|
|
76
|
+
thisTask.RootRequestInstanceId = rootRequest.data[0]['InstanceId'];
|
|
77
|
+
thisTask.sequence = thisTask.Sequence || "1";
|
|
78
|
+
});
|
|
79
79
|
|
|
80
80
|
//run postScripts
|
|
81
81
|
if (scripts && scripts.postMapping) {
|
|
82
|
-
await scriptController.runScripts(scripts.postMapping,
|
|
82
|
+
await scriptController.runScripts(scripts.postMapping, allTaskFinal, clientConfig.clientId, globalScriptParams);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const taskResult = await arquery.createEntry('TMS:Task',
|
|
85
|
+
const taskResult = await arquery.createEntry('TMS:Task', allTaskFinal, clientConfig.options)
|
|
86
86
|
const taskId = taskResult['0'];
|
|
87
87
|
globalScriptParams.id2 = taskId;
|
|
88
88
|
|
|
89
89
|
//run afterExecution
|
|
90
90
|
if (scripts && scripts.afterExecution) {
|
|
91
|
-
await scriptController.runScripts(scripts.afterExecution,
|
|
91
|
+
await scriptController.runScripts(scripts.afterExecution, allTaskFinal, clientConfig.clientId, globalScriptParams);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
log.debug('Create Task Result', taskResult);
|
package/docs/releases.md
CHANGED