Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createEntrysetInput(prefix, getDistributionElement) {
let propertyName = prefix+'.entryset';
let valueProperty = propertyName+'.value';
let probabilityProperty = propertyName+'.probability';
return entryFactory.table({
id : propertyName,
modelProperty : propertyName,
labels: [ 'Value', 'Probability' ],
modelProperties: [ valueProperty, probabilityProperty ],
addLabel: 'New entry',
show: function(element, node) {
return true;
},
getElements: function(element) {
let distribution = getDistributionElement(element);
if(!distribution) return [];//For unknown reasons, the system tries to create the table for other elements than those it is actually created for
let entries = distribution.$children.filter(each => each.$type == 'scylla:'+'entry');
return entries.map(each => {
let entry = new Object();
entry[valueProperty] = ""+each.value;
entry[probabilityProperty] = ""+each.probability;
function createResourceTable() {
return entryFactory.table({
id : 'resource',
description : 'Which resource to assign',
modelProperty : 'resources',
labels: [ 'Resource', 'Quantity' ],
modelProperties: [ 'resourceName', 'quantity' ],
addLabel: 'Add assignment',
show: function(element, node) {
return true;
},
getElements: resourcesOf,
addElement: function(element, node) {
ensureResources(element);
const moddle = modeler.get('moddle');
let newAssignment = moddle.createAny('scylla:Resource');
newAssignment.resourceName = 'foo';
newAssignment.quantity = 1;