Creating service flow charts using Custom Shapes and Automation

M

Matt Dargavel

Hi there,

A bit of a long one this, so bear with me!

I'm in the design phase of creating a program that lets a user design a
telecoms service flow, and I'm hoping to get the Visio 2003 Active X Control
to do the drawing and shape manipulation for me (from a c# application).
Once the flow has been designed within this new app, it will be used to drive
the equipment that will host the service.

As the flow will define the actual service, and isn't just for display
purposes, it's important how the shapes are linked together (connection
location, direction etc). For example, one of the shapes will be a database
operation which should have one input (although this could be any general
connection to the main part of the shape) and two distinct outputs (ok/fail).
I've put an example of how the shape may look as part of a simple service at
http://www.dargs.co.uk/flow_example.jpg .

I'm new to the Visio shapesheet etc and have a few questions:

First, should I be trying to control things like this within the
Visio shapesheet or catch and prevent / flag these "invalid" connections in
the C# application.

Second (depending on previous answer ;-)), I've managed to get most
of what I want by either disabling dynamic glue, and using connection points
on a shape defined solely by a set of geometries; and by defining a shape
made out of a group of sub-shapes, with dynamic glue enabled on the
sub-shapes that identify the connection points. Does anyone have any thought
on which of these approaches will be easier implement (considering the
automation control)?

Finally, one thing I haven't been able to work out how can you
control the direction of connectors allowed to connect to points on a shape.
I've tried changing the attributes of the connection points to Input and
Output, but Output doesn't seem to let you connect at all with the connector
tool. I'm obviously missing something here!?!

Any help and suggestions you can provide would be greatly appreciated,

Thanks and regards,

Matt Dargavel
 
A

Al Edlund

I'd suggest you get a copy of Graham Wideman's book (visio developers
survival guide)? It's kinda the bible for those that have to go into deep
programming of Visio.
al
 
M

Mark Nelson [MS]

Visio does not offer a way to pre-emptively enforce connectivity rules on
shapes. You can have your program handle the ConnectionAdded and
ConnectionDeleted events to react to connections and possibly unconnect
them. So the answer to your first question is that you handle connectivity
in code.

I don't think there is a single best way to set up connection points on
shapes. It depends on the behavior you want. I find static glue better
than dynamic glue if it is critical that inputs and outputs do not share the
same connection point. Generally if you can choose between grouping shapes
and not grouping shapes, the non-grouped implementation will be much
simpler. There are several extra things you must handle in code when
working with groups (getting the proper selection, recursing through
subshapes, handling events properly).

When working with connectors it is important to note that the arrowheads on
a connector are just a formatting setting and do not define the actual
direction for the connection. Every line / connector has a begin point and
end point. You apply formatting to each line end to be whatever you want.
Thus it is quite possible that a user hooks up a connector 'backward' but
adds an arrowhead to the begin point to make it look correct. You need to
decide how to enforce directional connectivity for your application. You
could put an arrowhead on the end point and GUARD it. You could just
automatically "fix" connectors that are backward. BTW, input and output for
connection points relates to 2-D glue. This is shape-to-shape glue where
one 2-D shape with an outward connection point can glue to a 2-D shape with
an inward connection point. No connectors are involved.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
M

Matt Dargavel

Thanks a lot for your help. You've given me a good idea of how to approach
the problem.

Regards,

Matt Dargavel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top