@manyos/smileconnect-api 1.46.2 → 1.46.3

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/conf/clients.json CHANGED
@@ -240,9 +240,7 @@
240
240
  "basequery": "",
241
241
  "scripts": {
242
242
  "POST": {
243
- "postMapping": [
244
- "reject"
245
- ]
243
+ "postMapping": []
246
244
  }
247
245
  }
248
246
  },
@@ -120,7 +120,7 @@ async function deleteTaskFlow(rootRequestInstanceId) {
120
120
  async function updateTaskFlow(clientConfig, rootForm, rootRequestId, rootRequestInstanceId) {
121
121
  await deleteTaskFlow(rootRequestInstanceId)
122
122
  let flowBuilderRequest = {
123
- "Parent Name": rootForm,
123
+ "Parent Name": rootRequestId,
124
124
  "ParentID" : rootRequestInstanceId,
125
125
  "Parent Type": "Root Request",
126
126
  "zTmpInternalCommand" : "CREATE",
@@ -133,6 +133,26 @@ async function updateTaskFlow(clientConfig, rootForm, rootRequestId, rootRequest
133
133
 
134
134
  flowBuilderRequest = mappingUtil.applyMapping2Remedy(flowBuilderRequest, mappingflow, clientConfig.flowBuilder.constants);
135
135
  const taskFlowResult = await arquery.createEntry('TMS:FlowBuilder', flowBuilderRequest, clientConfig.options)
136
+ await activateTaskFlow(clientConfig, rootRequestInstanceId)
137
+ }
138
+
139
+ async function activateTaskFlow(clientConfig, rootRequestInstanceId) {
140
+ const form = 'TMS:Flow'
141
+ const idField = 'Flow ID'
142
+ const flowRequest = {
143
+ "PredecessorStatusReasonSelection": "Success",
144
+ "Predecessor Status" : "Closed",
145
+ "zTmpInternalCommand": "EVALUATE",
146
+ "zTmpInternal" : "True"
147
+ };
148
+ const records = await arquery.executeARQuery(form, undefined,
149
+ `'RootRequestInstanceID'="${rootRequestInstanceId}" AND 'ParentID' = "${rootRequestInstanceId}" AND 'Predecessor Link' = "Start" AND 'Status' = "Pending" AND 'Sequence Mode' = "Yes"`, idField)
150
+ if (records && records.data) {
151
+ for (let x=0; x<records.data.length; x++) {
152
+ const record = records.data[x]
153
+ const updateResult = await arquery.updateEntry(form, record[idField], flowRequest)
154
+ }
155
+ }
136
156
  }
137
157
 
138
158
 
package/docs/releases.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## API
4
4
 
5
+ ### 1.46.3 - 18.10.21
6
+ Fix issue: Task not activated when phase already active
7
+ Known issues: Tasks might get activated early
8
+
5
9
  ### 1.46.2 - 14.10.21
6
10
  Fix issue: Promise Rejection in scripts prevented
7
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyos/smileconnect-api",
3
- "version": "1.46.2",
3
+ "version": "1.46.3",
4
4
  "description": "A proxy and abstraction layer for BMCs IT Service Management Suite",
5
5
  "main": "app.js",
6
6
  "scripts": {