One part of a project I'm working on is interactive scripts for call centre staff. Pretty much every possibility I can think of in this case can be represented on paper as a flowchart, which is why I'll be making an interactive script builder that is essentially a flowchart builder in HTML5/JS. This will let me add conditional logic to the scripts, so the agent could be prompted to say something specific based on the reply from the person being called.Currently I'm stuck in the planning phase: how do I represent each script/flowchart in my system? I need something that can be completely represented using either JSON or XML, as the system is web based.
How can I represent a flowchart, complete with conditional logic using JSON or XML?
data structures;json;flowchart
Effectively, a flow chart is just a fancy graph.  So, you will have nodes and edges.  Nodes will have text, (optionally) position/size, and unique ids.  Edges will have a pair of nodes and a name.So, suppose we have, Ask user their name.  If their name is Bob, compliment them.  Otherwise, hang up on them.Something like this:var JsonGraph = {    Root: 1,    Nodes: {        1: {Text: Ask user their name.  Is their name Bob?},        2: {Text: Compliment the user.},        3: {Text: Hang up on the user.}    },    Edges: [        {Source:1,Destination:2,Text:yes},        {Source:1,Destination:3,Text:no}    ]}The Edge text turns into a button within the wizard.  The node text turns into the text within the wizard.