@bpmn-io/dmn-variable-resolver
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -197,5 +197,31 @@ /** @typedef {import('./VariableResolver').Variable} Variable */ | ||
const encapsulatedLogic = bkm.get('encapsulatedLogic'); | ||
if (encapsulatedLogic) { | ||
handleEncapsulatedLogic(encapsulatedLogic, variable); | ||
} | ||
context.variables.push(variable); | ||
} | ||
function handleEncapsulatedLogic(encapsulatedLogic, currentVariable, context) { | ||
const formalParameters = encapsulatedLogic.get('formalParameter'); | ||
const params = formalParameters.map((parameter, index) => { | ||
const param = { | ||
name: parameter.get('name') || `param ${index + 1}`, | ||
type: parameter.get('typeRef') | ||
}; | ||
if (!param.type) { | ||
delete param.type; | ||
} | ||
return param; | ||
}); | ||
Object.assign(currentVariable, { | ||
type: 'function', | ||
params | ||
}); | ||
} | ||
function handleExpression(expression, context) { | ||
@@ -202,0 +228,0 @@ if (is(expression, 'dmn:FunctionDefinition')) { |
{ | ||
"name": "@bpmn-io/dmn-variable-resolver", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "dmn-js plugin for resolving available variables", | ||
@@ -19,7 +19,9 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@bpmn-io/feel-editor": "^0.9.1", | ||
"@bpmn-io/feel-editor": "^1.4.0", | ||
"babel-loader": "^9.1.3", | ||
"babel-plugin-istanbul": "^6.1.1", | ||
"chai": "^4.3.10", | ||
"cross-env": "^7.0.3", | ||
"css-loader": "^6.8.1", | ||
"dmn-js": "^14.4.0", | ||
"dmn-js": "^16.3.2", | ||
"dmn-moddle": "^10.0.0", | ||
@@ -39,3 +41,3 @@ "eslint": "^8.50.0", | ||
"npm-run-all": "^4.1.5", | ||
"puppeteer": "^21.3.6", | ||
"puppeteer": "^22.9.0", | ||
"raw-loader": "^4.0.2", | ||
@@ -42,0 +44,0 @@ "style-loader": "^3.3.3", |
10431
268
25