mirror of https://github.com/node-red/node-red.git
Support for context stores using JSONata and evaluateNodeProperty()
The function prepareJSONataExpression() does not take context store into account. This causes problems when using typedInput fields and getting the value of a property based on its type using evaluateNodeProperty().
This commit is contained in:
parent
5090b01b8e
commit
b78ef006ec
|
@ -558,11 +558,11 @@ function evaluateNodeProperty(value, type, node, msg, callback) {
|
||||||
*/
|
*/
|
||||||
function prepareJSONataExpression(value,node) {
|
function prepareJSONataExpression(value,node) {
|
||||||
var expr = jsonata(value);
|
var expr = jsonata(value);
|
||||||
expr.assign('flowContext',function(val) {
|
expr.assign('flowContext',function(val, store) {
|
||||||
return node.context().flow.get(val);
|
return node.context().flow.get(val, store);
|
||||||
});
|
});
|
||||||
expr.assign('globalContext',function(val) {
|
expr.assign('globalContext',function(val, store) {
|
||||||
return node.context().global.get(val);
|
return node.context().global.get(val, store);
|
||||||
});
|
});
|
||||||
expr.assign('env', function(name) {
|
expr.assign('env', function(name) {
|
||||||
var val = getSetting(node, name);
|
var val = getSetting(node, name);
|
||||||
|
|
Loading…
Reference in New Issue