Kay
Kay

Reputation: 413

How to do data modelling for a flowchart?

I've a requirement to persist a flowchart built by users into database. Until now, I've been using BLOBs to store the flowchart image. But I want to serialize the flow chart and persist them as a structured data.

For example, a flow chart will have start and end, process box, input/output box, decision flow etc. All these elements will be connected by arrows. I'm blanking out on how to model data structure that will store this information. Any tips would be appreciated?

Upvotes: 1

Views: 921

Answers (1)

paulsm4
paulsm4

Reputation: 121599

Sorry, but this question is too vague.

Perhaps the best question to start off asking yourself:

Q: Do I really want to invent my own format, or find an existing "flowchart" format that does what I need?

If you want to invent your own, I'd strongly suggest:

  1. Using JSON or XML (instead of something completely ad-hoc), and
  2. Finding JSON or XML examples for storing "graphs" (nodes, edges, etc).
    Here is one such example: http://jsongraphformat.info/

But then your next challenge would be how to DISPLAY your flowchat, after you've read it from the database.

ANOTHER SUGGESTION:

Assume, for example, you're using Visio. I'd just store the .vsd in your database!

Upvotes: 1

Related Questions