Skip to content

Commit 213c785

Browse files
committed
Remove msg and format from start-process init token; error handling in etw-input-node; JSON.stringify in node.error removed
1 parent 8a2d566 commit 213c785

13 files changed

+28
-22
lines changed

endevent-finished-listener.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function (RED) {
2121
});
2222
});
2323
} catch (error) {
24-
node.error(JSON.stringify(error));
24+
node.error(error);
2525
}
2626

2727
node.on('close', async () => {

externaltask-input.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ module.exports = function (RED) {
179179
};
180180

181181
if (node.engine) {
182-
register();
182+
register().catch((error) => {
183+
node.error(error);
184+
});
183185
}
184186
}
185187

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@5minds/node-red-contrib-processcube",
3-
"version": "1.6.4",
3+
"version": "1.6.5",
44
"license": "MIT",
55
"description": "Node-RED nodes for ProcessCube",
66
"scripts": {

process-event-listener.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = function (RED) {
5151
});
5252
}
5353
} catch (error) {
54-
node.error(JSON.stringify(error));
54+
node.error(error);
5555
}
5656

5757
});
@@ -90,7 +90,7 @@ module.exports = function (RED) {
9090
});
9191
}
9292
} catch (error) {
93-
node.error(JSON.stringify(error));
93+
node.error(error);
9494
}
9595
});
9696
case 'resumed':
@@ -123,7 +123,7 @@ module.exports = function (RED) {
123123
});
124124
}
125125
} catch (error) {
126-
node.error(JSON.stringify(error));
126+
node.error(error);
127127
}
128128
});
129129
case 'finished':
@@ -157,7 +157,7 @@ module.exports = function (RED) {
157157
});
158158
}
159159
} catch (error) {
160-
node.error(JSON.stringify(error));
160+
node.error(error);
161161
}
162162
});
163163
case 'terminated':
@@ -189,7 +189,7 @@ module.exports = function (RED) {
189189
});
190190
}
191191
} catch (error) {
192-
node.error(JSON.stringify(error));
192+
node.error(error);
193193
}
194194
});
195195
case 'error':
@@ -222,7 +222,7 @@ module.exports = function (RED) {
222222
});
223223
}
224224
} catch (error) {
225-
node.error(JSON.stringify(error));
225+
node.error(error);
226226
}
227227
});
228228
case 'owner-changed':
@@ -254,7 +254,7 @@ module.exports = function (RED) {
254254
});
255255
}
256256
} catch (error) {
257-
node.error(JSON.stringify(error));
257+
node.error(error);
258258
}
259259
});
260260
case 'instances-deleted':
@@ -286,7 +286,7 @@ module.exports = function (RED) {
286286
});
287287
}
288288
} catch (error) {
289-
node.error(JSON.stringify(error));
289+
node.error(error);
290290
}
291291
});
292292
case 'is-executable-changed':

process-start.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ module.exports = function (RED) {
44
var node = this;
55

66
node.on('input', function (msg) {
7-
const initialToken = RED.util.encodeObject(msg.payload);
7+
let initialToken = RED.util.encodeObject(msg.payload);
8+
9+
// remote msg and format from result
10+
delete initialToken.msg;
11+
delete initialToken.format;
812

913
const startParameters = {
1014
processModelId: msg.processModelId || config.processmodel,
@@ -43,7 +47,7 @@ module.exports = function (RED) {
4347
});
4448
})
4549
.catch((error) => {
46-
node.error(JSON.stringify(error));
50+
node.error(error);
4751
});
4852
});
4953
}

process-terminate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function (RED) {
1818
node.send(msg);
1919
})
2020
.catch((error) => {
21-
node.error(JSON.stringify(error));
21+
node.error(error);
2222
});
2323
});
2424
}

processcube-engine-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function (RED) {
2424
node.engineClient = new engine_client.EngineClient(node.url);
2525
}
2626
} catch (error) {
27-
node.error(JSON.stringify(error));
27+
node.error(error);
2828
}
2929

3030
node.on('close', async () => {

processdefinition-query.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = function (RED) {
3939
node.send(msg);
4040
})
4141
.catch((error) => {
42-
node.error(JSON.stringify(error));
42+
node.error(error);
4343
});
4444
});
4545
}

signal-event-trigger.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function (RED) {
2929
});
3030
})
3131
.catch((error) => {
32-
node.error(JSON.stringify(error));
32+
node.error(error);
3333
});
3434
});
3535
}

usertask-event-listener.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = function (RED) {
4242
});
4343
}
4444
} catch (error) {
45-
node.error(JSON.stringify(error));
45+
node.error(error);
4646
}
4747
};
4848
}

usertask-input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = function (RED) {
3232
} else node.log(`No user tasks found for query: ${JSON.stringify(query)}`);
3333
})
3434
.catch((error) => {
35-
node.error(JSON.stringify(error));
35+
node.error(error);
3636
});
3737
});
3838
}

usertask-output.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function (RED) {
2929
node.send(msg);
3030
})
3131
.catch((error) => {
32-
node.error(JSON.stringify(error));
32+
node.error(error);
3333
});
3434
} else {
3535
node.error(`No UserTask found in message: ${JSON.stringify(msg.payload)}`);

wait-for-usertask.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = function (RED) {
3939
// nothing todo - wait for next notification
4040
}
4141
} catch (error) {
42-
node.error(JSON.stringify(error));
42+
node.error(error);
4343
}
4444
});
4545

@@ -67,7 +67,7 @@ module.exports = function (RED) {
6767
// let the *currentIdentity* be active
6868
}
6969
} catch (error) {
70-
node.error(JSON.stringify(error));
70+
node.error(error);
7171
}
7272
}
7373
};

0 commit comments

Comments
 (0)