Event handling in Visio

D

Danny Ferreira

I'm not sure how this works, I've never posted anything on Groups
before, this message is primarily intended for Mark Nelson but if
anyone can help me with it I would appreciate it.

I am relatively new to Visio development. I have been working on a
solution for the couple of months and as I delve deeper I have been
facing some difficulties.

I am trying to create a process modelling tool that conforms to the
BPMN (business process modelling notation) spec 1.0. Most of the
issues that I am having are related to event handling, particularly
performing actions in Visio while handling an event. While
researching how to overcome this hurdle I bumped into a Visio
Conference '06 ppt by Mark Nelson "Building Model-Driven Solutions"
and loved it. Absolutely brilliant.

I have a couple of questions about it:

Is the sample code 'Factory Process Modeler' available to the public
or was it strictly complimentary to attendees of the conference? If
it is available, I would love to get a copy of it, could you point me
in its direction.

In my existing attempt at a solution I have created a data model which
corresponds to the BPMN spec. The model manager class in your
presentation seems to be designed to handle models in a very general
way by describing them in terms of model objects and relationships,
while this a great general solution, in my case it seems that the
model objects are related to one another in a way that is suggestive
of alternative representation: the BPMN spec defines the model objects
and their relationships to one another. The relationships are mainly
isA and hasA which lend themselves to be expressed directly using
language constructs (inheritance and composition). Are there problems
with using this sort of a model description? (sorry if i have not
communicated this well)

Event Queue question. How do i handle QueryXXX events? The best I
could come up with is to cancel (ie return true)when i receive the
actual visio event and queue a custom version of the same event which
my solution would handle by queueing an appropriate action based on
the response, such as delete page if it were a querycancelpagedelete
event.


Thank you so much for any time you might devote to a reply.

Danny Ferreira
 
M

Mark Nelson [MS]

Hi Danny,

Thanks for the compliments. Many customers and partners have a need for
model-driven solutions, and I'm happy that we were able to shine some light
on the subject at the Visio Partner Conference last year. The presentation
audio and slides are available here: http://www.visioconferencecontent.com/.
The sample code was given out to attendees. I'll see about making the code
more broadly available. That's as much as I can promise on that front.

The model framework presented in the Factory Process Modeler sample is quite
generic. It could definitely be better structured for Visio diagrams. You
are asking about how to represent typical inheritance and composition
relationships. BPMN definitely relies on inheritance and composition more
than a separate notion of relationships, so it makes sense to me to define a
model where some relationships are set up as model relationships and others
are set up through language constructs. I haven't tried this out to see
whether there are pitfalls, but the approach seems reasonable.

QueryCancel events pose a problem for a queued event framework because Visio
needs an answer right away to determine whether the action should take place
or not. I do not recommend always replying with Cancel (True). That's not
helpful for the user and could be troublesome for any other solution that
might be running at the same time (including Visio's own add-ons). You just
need a way to bypass the queue and forward the event to your handler.
Hopefully the response does not depend on the contents of the event queue.
I'm not sure I understand the scenario where you need to cancel an event
built trigger the action yourself later. Remember you are not supposed to
respond to the action here; you simply have to tell Visio whether it is okay
for the action to happen at all.

If you want to follow up on this discussion, feel free to send me an e-mail.
You just have to drop the "online" from my address to reach me.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

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

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