Hi Dojo,
I'm currently working on a use case here which includes child shapes in Visio for generated services... let me try to explain:
1. We use a service template to generate multiple services within a specific view. All these services are basically structured the same way and are using the same child elements and are using the same service protocol as well as the same automatically assigned Visio.
2. The view containing these generated services has a (different) Visio assigned, which uses child shapes to dynamically generate shapes for every service that is part of the view.
3. Every child shape in this view's visual consists actually of different shapes, representing several parameters of each individual service (name, alarm state, certain properties and values, etc.)
(up to this point I was already able to get things to work. Here comes the tricky part:)
4. For every service there is one parameter of two of the service's child elements for which we want to be able to set the parameter value. For this we want the dynamically generated child shapes of the visual to include shapes/buttons to set these parameters (including show/hide conditions, because of on/off switching).
I'm having a hard time to find a way to set this up, using the correct placeholders and the correct places to use them.
Background information: these two child elements in question for each service are actually representing main and backup encoding, and we want to be able to perform a stop and start of the encoding instances for each service from the Visual.
I hope I was able to clearly describe what's the challenge - if not I'd be happy to clarify!
Anything comes to your mind? Thanks a lot!
The real challenge here is not the Execute itself, but to make sure that every “button” you draw ends up in the context of the correct encoder element (main or backup) that belongs to the service.
If the shape is correctly linked to that element, you can treat it exactly the same as any ordinary element shape: show its parameters and add an Execute field that writes the start/stop value.
Below are two ways to get your button-shape into the right element context, but there are most likely more.
- Work with nested Children shapes
- On the Visio page that is linked to the view, create a first children shape which automatically generates a shape for every service in the view.
- Inside that generated service-shape, add a second container and set
Children = Element
ChildrenFilter = Protocol=YourEncoderProtocol (optional, only list the encoder elements)Because this second container is a child of the Service-shape, it “looks” inside that service and creates a shape for every element that belongs to it.
- Inside each automatically generated encoder-shape you can now add:
• A small sub-shape linked to [param:*] or Info to show status, alarm color, …
• A clickable shape with Execute = … to push the start/stop value to the parameter.
- Use a service property that stores the element ID (alternative approach)
If every service already contains a custom property holding the ID or name of its main/backup encoder:
In the service-child shape, put an ordinary Element shape and set
Element = [Property:EncoderMain] (or EncoderBackup, …)
Once linked, all normal placeholders and Execute actions work exactly the same way as on any standalone element page.
That probably means you need to disable some of the parent shapes (and enable the child shape containing the execute shape data): https://docs.dataminer.services/dataminer/Operator_guide/Visio/miscellaneous/Disabling_the_default_hyperlink_behavior_of_a_linked_shape.html
Yeah, that's exactly what I thought and tested as well. I've burned some time trying to figure out which shapes need to be disabled and so forth, but after not being successful I reached out to you again. I'll give it another try after the weekend – cheers!
With renewed energy! Alright, let me know how that works out.
Hi Seba,
thanks a lot for your input! That already helped a lot (although it still took some effort and caused some headache during testing, to be honest), and I definitely got closer to the goal.
However, when adding a sub-shape down the line (which contains the Execute shape data) this shape is not clickable by itself to set the parameter, but instead it behaves as being linked to the element in question, opening the element card. I couldn't find a way yet to resolve this behavior…