Thanks for sharing! Holger
> On 24 Jul 2024, at 4:53 PM, Marie Valadez <mevalade...@gmail.com> wrote: > > 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); > > }; > }""" . > > On Friday, July 12, 2024 at 9:45:29 AM UTC-6 Marie Valadez wrote: >> Good to know will have to look into it after the 8.0 update. Thank you >> Holger! >> >> On Friday, July 12, 2024 at 7:46:43 AM UTC-6 Holger Knublauch wrote: >>> >>>> On 12 Jul 2024, at 3:37 PM, Marie Valadez <meval...@gmail.com <>> wrote: >>>> >>>> Thanks Holger. We are still on 7.8, but hopefully getting moved to the >>>> newer version in the next couple of weeks. Does the ModifyAction wizard >>>> also work with BatchActions? >>> >>> Yes, also with BatchActions, and even in 8.0 the BatchActions already >>> support the paramsObject field. >>> >>> Holger >>> >>> >>> >>>> >>>> On Friday, July 12, 2024 at 12:52:21 AM UTC-6 Holger Knublauch wrote: >>>>> Normally the number of sh:parameters for ModifyActions is fixed. >>>>> >>>>> If you are on 8.0 (onwards), you can however use Wizard-based Actions. See >>>>> >>>>> Resource Actions — edg-documentation 8.0.0 documentation >>>>> archive.topquadrant.com >>>>> >>>>> >>>>> <https://archive.topquadrant.com/doc/latest/scripting/actions.html#batch-actions>Resource >>>>> Actions — edg-documentation 8.0.0 documentation >>>>> <https://archive.topquadrant.com/doc/latest/scripting/actions.html#batch-actions> >>>>> archive.topquadrant.com >>>>> <https://archive.topquadrant.com/doc/latest/scripting/actions.html#batch-actions> >>>>> >>>>> <https://archive.topquadrant.com/doc/latest/scripting/actions.html#batch-actions> >>>>> These would allow you to ask the user for the number of groups on the >>>>> first wizard page and then, on the second page, present a dynamic list of >>>>> arguments. >>>>> >>>>> I am not sure though if that approach would then allow you to query those >>>>> arguments with regular JS variables on the final step. For that you MAY >>>>> need to wait for 8.1 where the paramsObject is supported. 8.1 may be >>>>> available in a few weeks. >>>>> >>>>> A completely different approach would be to have a single large text >>>>> field as input field, with some domain-specific language of your choice >>>>> where you parse in the script for the value pairs. If users are geeky >>>>> enough, this could even be rdf:JSON. >>>>> >>>>> HTH >>>>> Holger >>>>> >>>>> >>>>> >>>>>> On 11 Jul 2024, at 5:36 PM, Marie Valadez <meval...@gmail.com <>> wrote: >>>>>> >>>>> >>>>>> Hello! >>>>>> >>>>>> I am working in TopBraid EDG 7.8. I have a Modify Action group where I >>>>>> would like the option of having multiple optional parameters (attribute >>>>>> and map). >>>>>> >>>>>> ex:ExampleModifyAction >>>>>> sh:parameter ex:ExampleModifyAction-attribute ; >>>>>> sh:parameter ex:ExampleModifyAction-map. >>>>>> >>>>>> Is there a way for the user to add multiple attributes and maps without >>>>>> having to create a new parameter for each (example below)? >>>>>> >>>>>> Would prefer not to have to do this: >>>>>> >>>>>> ex:ExampleModifyAction >>>>>> sh:parameter ex:ExampleModifyAction-attribute1 ; >>>>>> sh:parameter ex:ExampleModifyAction-map1; >>>>>> sh:parameter ex:ExampleModifyAction-attribute2 ; >>>>>> sh:parameter ex:ExampleModifyAction-map2 ; >>>>>> sh:parameter ex:ExampleModifyAction-attribute3 ; >>>>>> sh:parameter ex:ExampleModifyAction-map3. >>>>>> >>>>>> So instead of having to add all the optional parameters like above, the >>>>>> user could select multiples within the popup itself. I see a "+" button, >>>>>> but this only seems to allow the user to create a new Attribute itself >>>>>> and not a new mapping in the Modify Action. Is there possibly a >>>>>> property I can add to the parameter that declares it as repeatable or >>>>>> something? >>>>>> >>>>>> Thanks for any help! >>>>>> >>>>>> Marie >>>>>> >>>>>> >>>>>> >>>>> >>>>>> -- >>>>>> The topics of this mailing list include TopBraid EDG and related >>>>>> technologies such as SHACL. >>>>>> To post to this group, send email to topbrai...@googlegroups.com <> >>>>>> --- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "TopBraid Suite Users" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>>> an email to topbraid-user...@googlegroups.com <>. >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/topbraid-users/d324408d-e3c5-41dd-809a-c2f393d72c45n%40googlegroups.com >>>>>> >>>>>> <https://groups.google.com/d/msgid/topbraid-users/d324408d-e3c5-41dd-809a-c2f393d72c45n%40googlegroups.com?utm_medium=email&utm_source=footer>. >>>>> >>>> >>>> >>>> -- >>>> The topics of this mailing list include TopBraid EDG and related >>>> technologies such as SHACL. >>>> To post to this group, send email to topbrai...@googlegroups.com <> >>>> --- >>>> You received this message because you are subscribed to the Google Groups >>>> "TopBraid Suite Users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to topbraid-user...@googlegroups.com <>. >>> >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/topbraid-users/72db9647-f4f0-40a7-82fe-1966f0aafe2dn%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/topbraid-users/72db9647-f4f0-40a7-82fe-1966f0aafe2dn%40googlegroups.com?utm_medium=email&utm_source=footer>. >>> > > > -- > The topics of this mailing list include TopBraid EDG and related technologies > such as SHACL. > To post to this group, send email to topbraid-users@googlegroups.com > --- > You received this message because you are subscribed to the Google Groups > "TopBraid Suite Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to topbraid-users+unsubscr...@googlegroups.com > <mailto:topbraid-users+unsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/topbraid-users/90619654-0bff-4bb8-979c-bde88e200444n%40googlegroups.com > > <https://groups.google.com/d/msgid/topbraid-users/90619654-0bff-4bb8-979c-bde88e200444n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- The topics of this mailing list include TopBraid EDG and related technologies such as SHACL. To post to this group, send email to topbraid-users@googlegroups.com --- You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/DE70F3FF-558C-45FD-9E29-B144296911F4%40topquadrant.com.