@@ -5,7 +5,21 @@ module.exports = function (RED) {
55 const EVENT_START_FLOW = "comp-start-flow" ;
66 const EVENT_RETURN_FLOW = "comp-flow-return" ;
77
8- function sendStartFlow ( msg , node ) {
8+ function evaluateNodeProperty ( value , type , node , msg )
9+ {
10+ return new Promise ( ( resolve , reject ) => {
11+ RED . util . evaluateNodeProperty ( value , type , node , msg , ( err , res ) => {
12+ if ( err ) {
13+ reject ( err ) ;
14+ } else {
15+ //console.log("Res: " + res);
16+ resolve ( res ) ;
17+ }
18+ } ) ;
19+ } ) ;
20+ }
21+
22+ async function sendStartFlow ( msg , node ) {
923 try {
1024 // create / update state for new execution
1125 if ( typeof msg . _comp == "undefined" ) {
@@ -67,8 +81,9 @@ module.exports = function (RED) {
6781 // an empty, optional parameter is evaluated only, if the source type is "string".
6882 // In that case, the parameter is set(!). It is not put into the message in all other cases.
6983 if ( paramSource . source && paramSource . source . length > 0 || paramSource . sourceType == "str" ) {
70- val = RED . util . evaluateNodeProperty ( paramSource . source , paramSource . sourceType , node , msg ) ;
84+ val = await evaluateNodeProperty ( paramSource . source , paramSource . sourceType , node , msg ) ;
7185 }
86+ //console.log("Val: " + val);
7287 if ( val == null || val == undefined ) {
7388 if ( paramDef . required ) {
7489 validationErrors [ paramName ] = RED . _ ( "components.message.missingProperty" , { parameter : paramName } ) ;
0 commit comments