I was able to accomplish it with the ModifyAction in its current state. Adding in the code I used in case it is helpful to anyone else.
dash:js """
/*The first page that is displayed to the user*/
function begin() {
return DataViewers.createNextPageJSON({
title: 'Concept Attribute Map',
message: `Enter in an integer for the number of attributes you want to map to the selected concept: ${focusNode}.`,
params: [
{
varName: 'AttributeCount',
label: 'Attribute Count',
description: 'Number of Attributes to Map to the selected concepts',
datatype: xsd.integer,
}
],
callback: handleFirstPage,
})
}
/*The second page that asks the user to select the attributes to map to the concept*/
function handleFirstPage(state) {
// The AttributeCount is the parameter defined on the first page.
let vals = [];
for (let i =1; i <= AttributeCount; i++) {
let attrdict = {
'varName':`Attribute${i}`,
'label':`Attribute ${i}`,
'class': graph.node({qname: 'ex:Attribute'}),
'description': 'Select the Attribute to Map to the Concept'
};
vals.push(attrdict);
let mapdict = {
'varName':`MapType${i}`,
'label': `Map Type ${i}`,
'class': graph.node({qname: 'ex:Map'}),
'description': 'Select the Map Type for the Concept Attribute.'
};
vals.push(mapdict)
}
return DataViewers.createNextPageJSON({
title: 'Select Attributes and Attribute Map Type' ,
message: `Select the Attributes to Map to the selected concept: ${focusNode}.`,
last: true, // Last Page, allow Ok and Preview
params:
vals,
state: {
attrCnt: AttributeCount,
},
callback: handleOk,
})
}
/*This is called when the user clicks OK on the second page. This is where the modifications are added to the graph.*/
function handleOk(state) {
let vals = [];
for (let i =1; i <= state.attrCnt; i++) {
let uuid = graph.eval(`spif:generateUUID()`);
let camNode = graph.node({qname: `ex:CAM_${uuid}`});
let map = eval(`MapType${i}`);
let attr = eval(`Attribute${i}`);
let label = `${map} ${attr}`;
/****Not showing all values below. Just an example of how to use the wizard***/
focusNode.add(ex:property, graph.node(camNode));
camNode.add(ex:attribute, attr);
camNode.add(ex:map, map);
};
}""" .