private BPMNNode CreateBPMN(String name, BPMNShapes shape, double width, double height, double offsetx, double offsety, string text = "")
        {
            BPMNNode node = new BPMNNode();

            node.Name    = name;
            node.Shape   = shape;
            node.Width   = width;
            node.Height  = height;
            node.OffsetX = offsetx;
            node.OffsetY = offsety;
            Label label = new Label();

            label.Text      = text;
            label.FontColor = "black";
            if (shape == BPMNShapes.Event && shape == BPMNShapes.Activity && text != "")
            {
                label.Offset = new DiagramPoint()
                {
                    Y = 1
                };
                label.VerticalAlignment = VerticalAlignment.Top;
            }
            else
            {
                label.Offset = new DiagramPoint()
                {
                    Y = 0.5f
                }
            };
            node.Labels.Add(label);
            DiagramContent.Nodes.Add(node);
            return(node);
        }
        private BPMNNode CreateSubProcessBPMN(String name, BPMNShapes shape, double width, double height, string BPMNSubProcess)
        {
            BPMNNode node = new BPMNNode();

            node.Name     = name;
            node.Shape    = shape;
            node.Width    = width;
            node.Height   = height;
            node.Activity = BPMNActivity.SubProcess;
            if (BPMNSubProcess == "SubprocessEventBased")
            {
                node.SubProcess = new BPMNSubProcess()
                {
                    Type = BPMNSubProcessTypes.Event, Event = BPMNEvents.Start
                }
            }
            ;
            else
            {
                node.SubProcess = new BPMNSubProcess()
                {
                    Type = BPMNSubProcessTypes.Transaction, Collapsed = true
                }
            };
            return(node);
        }
        private BPMNNode CompensationCallListBPMN(String name, BPMNShapes shape, double width, double height, bool subprocess)
        {
            BPMNNode node = new BPMNNode();

            node.Name     = name + "GateWays" + name;;
            node.Width    = width;
            node.Height   = height;
            node.Activity = BPMNActivity.SubProcess;
            node.Shape    = BPMNShapes.Activity;
            node.Event    = BPMNEvents.Start;
            if (subprocess)
            {
                node.Activity   = BPMNActivity.SubProcess;
                node.SubProcess = new BPMNSubProcess()
                {
                    Loop = BPMNLoops.Standard
                };
            }
            else
            {
                node.Activity = BPMNActivity.Task;
                node.Task     = new BPMNTask()
                {
                    Compensation = true
                };
            }
            return(node);
        }
        private BPMNNode CreateBPMNNode(String name, BPMNShapes shape, double width, double height, double offsetx, double offsety, double marginleft, double margintop, string text = "")
        {
            BPMNNode node = new BPMNNode();

            node.Name       = name;
            node.Shape      = shape;
            node.Width      = width;
            node.Height     = height;
            node.OffsetX    = offsetx;
            node.OffsetY    = offsety;
            node.MarginLeft = marginleft;
            node.MarginTop  = margintop;
            Label label = new Label();

            label.Text      = text;
            label.FontColor = "black";
            if (shape == BPMNShapes.Event && text != "")
            {
                label.Offset = new DiagramPoint()
                {
                    Y = 1
                };
                label.VerticalAlignment = VerticalAlignment.Top;
            }
            else
            {
                label.Offset = new DiagramPoint()
                {
                    Y = 0.5f
                };
            }
            node.Labels.Add(label);
            DiagramWebControl1.Model.Nodes.Add(node);
            return(node);
        }
        private BPMNNode CreateBasicBPMN(String name, BPMNShapes shape, double width, double height)
        {
            BPMNNode node = new BPMNNode();

            node.Name   = name;
            node.Shape  = shape;
            node.Width  = width;
            node.Height = height;
            return(node);
        }
        private BPMNNode CreateTaskBPMN(String name, BPMNShapes shape, double width, double height)
        {
            BPMNNode node = new BPMNNode();

            node.Name     = name;
            node.Shape    = shape;
            node.Width    = width;
            node.Height   = height;
            node.Activity = BPMNActivity.Task;
            return(node);
        }
        private BPMNNode CreateExclusiveBPMN(String name, BPMNShapes shape, double width, double height, BPMNGateways gateway)
        {
            BPMNNode node = new BPMNNode();

            node.Name     = name + "GateWays" + name;;
            node.Width    = width;
            node.Height   = height;
            node.Activity = BPMNActivity.SubProcess;
            node.Shape    = BPMNShapes.Gateway;
            node.Event    = BPMNEvents.Start;
            node.Gateway  = gateway;
            return(node);
        }
        private BPMNNode CreateTriggerBPMN(String name, BPMNShapes shape, double width, double height, BPMNTriggers triggers)
        {
            BPMNNode node = new BPMNNode();

            node.Name     = name;
            node.Shape    = shape;
            node.Width    = width;
            node.Height   = height;
            node.Activity = BPMNActivity.SubProcess;
            node.Shape    = shape;
            node.Event    = BPMNEvents.Start;
            node.Trigger  = triggers;
            return(node);
        }
        private BPMNNode CreateServiceBPMN(String name, BPMNShapes shape, double width, double height, BPMNTasks BPMNTask)
        {
            BPMNNode node = new BPMNNode();

            node.Name     = name + "GateWays" + name;;
            node.Width    = width;
            node.Height   = height;
            node.Activity = BPMNActivity.SubProcess;
            node.Shape    = BPMNShapes.Activity;
            node.Event    = BPMNEvents.Start;
            node.Activity = BPMNActivity.Task;
            node.Task     = new BPMNTask()
            {
                Type = BPMNTask
            };
            return(node);
        }
        private BPMNNode CreateBPMNShape(DiagramProperties model, String name, BPMNShapes shape, double width, double height, double offsetx, double offsety, string text = "", string description = "")
        {
            BPMNNode node = new BPMNNode();

            node.Name    = name;
            node.Shape   = shape;
            node.Width   = width;
            node.Height  = height;
            node.OffsetX = offsetx - 60;
            node.OffsetY = offsety;
            Label label = new Label();

            label.Text      = text;
            label.FontColor = "black";
            if (shape == BPMNShapes.Event && text != "")
            {
                label.Offset = new DiagramPoint()
                {
                    Y = 1
                };
                label.VerticalAlignment = VerticalAlignment.Top;
            }
            else
            {
                label.Offset = new DiagramPoint()
                {
                    Y = 0.5f
                }
            };
            if (description != "")
            {
                node.AddInfo = new Dictionary <string, object> {
                    { "Description", description }
                }
            }
            ;
            node.Labels.Add(label);
            model.Nodes.Add(node);
            return(node);
        }
        public void GenerateDiagram()
        {
            DiagramContent.Height = "600px";
            DiagramContent.Width  = "100%";
            DiagramContent.OnClientSelectionChange   = "diagramSelectionChange";
            DiagramContent.SelectedItems.Constraints = SelectorConstraints.All ^ SelectorConstraints.Rotator;

            BPMNNode node = CreateBPMN("node1", BPMNShapes.Event, 60, 60, 250, 40, "Select Support Ticket");

            node.Event = BPMNEvents.Start;

            CreateBPMN("node2", BPMNShapes.Activity, 110, 70, 250, 140, "Handle Support Ticket");
            node.Activity = BPMNActivity.Task;
            node          = CreateBPMN("node3", BPMNShapes.Gateway, 90, 70, 250, 245, "");
            node.Gateway  = BPMNGateways.Exclusive;

            node           = CreateBPMN("node4", BPMNShapes.Activity, 110, 70, 100, 350, "Respond to customer");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node           = CreateBPMN("node5", BPMNShapes.Activity, 110, 70, 250, 350, "Close ticket");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node           = CreateBPMN("node6", BPMNShapes.Activity, 110, 70, 390, 350, "Escalate ticket");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node       = CreateBPMN("node7", BPMNShapes.Event, 60, 60, 100, 460, "");
            node.Event = BPMNEvents.End;

            node       = CreateBPMN("node8", BPMNShapes.Event, 60, 60, 250, 460, "");
            node.Event = BPMNEvents.End;

            node       = CreateBPMN("node9", BPMNShapes.Event, 60, 60, 390, 460, "");
            node.Event = BPMNEvents.End;

            ConnNode(DiagramContent.Connectors, "node1", "node2");

            ConnNode(DiagramContent.Connectors, "node2", "node3");

            Collection segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal
                }
            };
            Label label = new Label()
            {
                Text = "Respond", FillColor = "white", Wrapping = TextWrapping.Wrap
            };

            ConnNode(DiagramContent.Connectors, "node3", "node4", segments, label);

            segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal
                }
            };
            label = new Label()
            {
                Text = "Close", FillColor = "white", Wrapping = TextWrapping.Wrap
            };
            ConnNode(DiagramContent.Connectors, "node3", "node5", segments, label);

            segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal
                }
            };
            label = new Label()
            {
                Text = "Escalate", FillColor = "white"
            };
            ConnNode(DiagramContent.Connectors, "node3", "node6", segments, label);

            ConnNode(DiagramContent.Connectors, "node4", "node7");
            ConnNode(DiagramContent.Connectors, "node5", "node8");
            ConnNode(DiagramContent.Connectors, "node6", "node9");
        }
        //
        public ActionResult PrintAndExport()
        {
            DiagramProperties model = new DiagramProperties();

            model.Height = "400px";
            model.Width  = "750px";
            model.PageSettings.ScrollLimit     = ScrollLimit.Diagram;
            model.SnapSettings.SnapConstraints = SnapConstraints.All;

            BPMNNode node = CreateBPMN(model, "node1", BPMNShapes.Event, 60, 60, 55, 200, "Select Support Ticket");

            node.Event = BPMNEvents.Start;

            CreateBPMN(model, "node2", BPMNShapes.Activity, 75, 70, 190, 200, "Handle Support Ticket");
            node.Activity = BPMNActivity.Task;
            node          = CreateBPMN(model, "node3", BPMNShapes.Gateway, 75, 70, 355, 200, "");
            node.Gateway  = BPMNGateways.Exclusive;

            node           = CreateBPMN(model, "node4", BPMNShapes.Activity, 75, 70, 530, 90, "Respond to customer");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node           = CreateBPMN(model, "node5", BPMNShapes.Activity, 75, 70, 530, 200, "Close ticket");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node           = CreateBPMN(model, "node6", BPMNShapes.Activity, 75, 70, 530, 300, "Escalate ticket");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node       = CreateBPMN(model, "node7", BPMNShapes.Event, 60, 60, 660, 90, "");
            node.Event = BPMNEvents.End;

            node       = CreateBPMN(model, "node8", BPMNShapes.Event, 60, 60, 660, 200, "");
            node.Event = BPMNEvents.End;

            node       = CreateBPMN(model, "node9", BPMNShapes.Event, 60, 60, 660, 300, "");
            node.Event = BPMNEvents.End;

            ConnBPMNNode(model, "node1", "node2");

            ConnBPMNNode(model, "node2", "node3");

            Collection segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 75, Direction = "top"
                },
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 85, Direction = "right"
                },
            };
            Label label = new Label()
            {
                Text = "Respond", FillColor = "white", Wrapping = TextWrapping.Wrap
            };

            ConnBPMNNode(model, "node3", "node4", segments, label);


            label = new Label()
            {
                Text = "Close", FillColor = "white", Wrapping = TextWrapping.Wrap
            };
            segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 15, Direction = "right"
                },
            };
            ConnBPMNNode(model, "node3", "node5", segments, label);


            label = new Label()
            {
                Text = "Escalate", FillColor = "white"
            };
            segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 65, Direction = "bottom"
                },
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 75, Direction = "right"
                },
            };
            ConnBPMNNode(model, "node3", "node6", segments, label);


            ConnBPMNNode(model, "node4", "node7");

            ConnBPMNNode(model, "node5", "node8");
            ConnBPMNNode(model, "node6", "node9");

            model.SnapSettings.SnapConstraints = SnapConstraints.None;
            ViewData["diagramModel"]           = model;
            return(View());
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DiagramWebControl1.Height = "500px";
            DiagramWebControl1.PageSettings.ScrollLimit     = ScrollLimit.Diagram;
            DiagramWebControl1.SnapSettings.SnapConstraints = SnapConstraints.None;
            DiagramWebControl1.OnClientSelectionChange      = "selectionChanged";
            DiagramWebControl1.Model.DefaultSettings.Node   = new Node()
            {
                BorderColor = "black",
                Labels      = new Collection()
                {
                    new Label()
                    {
                        FontColor = "white"
                    }
                }
            };
            DiagramWebControl1.Model.DefaultSettings.Connector = new Connector()
            {
                TargetDecorator = new Decorator()
                {
                    Shape       = DecoratorShapes.Arrow,
                    BorderColor = "black",
                    Width       = 5,
                    Height      = 10
                },
                Segments = new Collection()
                {
                    new Segment()
                    {
                        Type = Segments.Orthogonal
                    }
                },
            };

            CreateBPMNNode("node1", BPMNShapes.Event, 40, 40, 35, 230, 0, 0, "");

            BPMNNode node = CreateBPMNNode("node2", BPMNShapes.Activity, 520, 250, 355, 190, 0, 0, "");

            node.Activity             = BPMNActivity.SubProcess;
            node.SubProcess.Collapsed = false;
            node.SubProcess.Type      = BPMNSubProcessTypes.Transaction;
            node.SubProcess.Events    = new Collection()
            {
                new BPMNEvent()
                {
                    Event = BPMNEvents.Intermediate, Name = "intermediateerror", Trigger = BPMNTriggers.Error, Offset = new DiagramPoint()
                    {
                        X = 0.25f, Y = 1
                    }
                },
                new BPMNEvent()
                {
                    Event = BPMNEvents.Intermediate, Name = "intermediatecancel", Trigger = BPMNTriggers.Cancel, Offset = new DiagramPoint()
                    {
                        X = 0.75f, Y = 1
                    }
                }
            };
            Collection Processes = new Collection();

            Processes.Add(new BPMNNode()
            {
                Name       = "subnode01",
                MarginLeft = 20,
                MarginTop  = 40,
                Height     = 30,
                Width      = 30,
                Shape      = BPMNShapes.Event
            });
            Collection label = new Collection()
            {
                new Label()
                {
                    Text = "book hotel", Offset = new DiagramPoint(0.5f, 0.5f)
                }
            };
            BPMNTask task = new BPMNTask()
            {
                Type = BPMNTasks.Service,
                Loop = BPMNLoops.ParallelMultiInstance,
            };

            Processes.Add(new BPMNNode()
            {
                Name       = "subnode02",
                MarginLeft = 110,
                MarginTop  = 20,
                Width      = 95,
                Height     = 70,
                FillColor  = "#6FAAB0",
                Shape      = BPMNShapes.Activity,
                Activity   = BPMNActivity.Task,
                Task       = task,
                Labels     = label
            });
            Processes.Add(new BPMNNode()
            {
                Name       = "subnodecompensation",
                MarginLeft = 170,
                MarginTop  = 75,
                Width      = 30,
                Height     = 30,
                Shape      = BPMNShapes.Event,
                Event      = BPMNEvents.Intermediate,
                Trigger    = BPMNTriggers.Compensation
            });
            label = new Collection()
            {
                new Label()
                {
                    Text = "charge credit card", Offset = new DiagramPoint(0.5f, 0.6f)
                }
            };
            task = new BPMNTask()
            {
                Type = BPMNTasks.Service
            };
            Processes.Add(new BPMNNode()
            {
                Name       = "subnode03",
                MarginLeft = 290,
                MarginTop  = 20,
                Width      = 95,
                Height     = 70,
                FillColor  = "#F6B53F",
                Shape      = BPMNShapes.Activity,
                Labels     = label,
                Activity   = BPMNActivity.Task,
                Task       = task
            });
            Processes.Add(new BPMNNode()
            {
                Name       = "subnodeerror",
                MarginLeft = 350,
                MarginTop  = 75,
                Width      = 30,
                Height     = 30,
                Shape      = BPMNShapes.Event,
                Event      = BPMNEvents.Intermediate,
                Trigger    = BPMNTriggers.Error
            });
            Processes.Add(new BPMNNode()
            {
                Name       = "subnode04",
                MarginLeft = 440,
                MarginTop  = 40,
                Width      = 30,
                Height     = 30,
                Shape      = BPMNShapes.Event,
                Event      = BPMNEvents.End
            });
            label = new Collection()
            {
                new Label()
                {
                    Text = "cancel hotel reservation", Offset = new DiagramPoint(0.5f, 0.5f)
                }
            };
            task = new BPMNTask()
            {
                Type         = BPMNTasks.User,
                Compensation = true
            };
            Processes.Add(new BPMNNode()
            {
                Name       = "subnode05",
                MarginLeft = 240,
                MarginTop  = 130,
                Width      = 90,
                Height     = 80,
                FillColor  = "#E94649",
                Shape      = BPMNShapes.Activity,
                Activity   = BPMNActivity.Task,
                Labels     = label,
                Task       = task
            });
            Processes.Add(new BPMNNode()
            {
                Name       = "subnode06",
                MarginLeft = 440,
                MarginTop  = 155,
                Width      = 30,
                Height     = 30,
                Shape      = BPMNShapes.Event,
                Event      = BPMNEvents.End
            });
            node.SubProcess.Processes = Processes;
            node       = CreateBPMNNode("node3", BPMNShapes.Event, 40, 40, 305, 420, 0, 0, "hazard");
            node.Event = BPMNEvents.End;
            node       = CreateBPMNNode("node4", BPMNShapes.Event, 40, 40, 545, 420, 0, 0, "cancelled");
            node.Event = BPMNEvents.End;
            node       = CreateBPMNNode("node5", BPMNShapes.Event, 40, 40, 665, 230, 0, 0, "successful");
            node.Event = BPMNEvents.End;

            ConnectBPMN("node1", "node2");
            ConnectBPMN("node2", "node5");
            Connector connector = ConnectBPMN("intermediateerror", "node3");

            connector.Segments = new Collection()
            {
                new Segment()
                {
                    Type      = Segments.Orthogonal,
                    Length    = 50,
                    Direction = "bottom"
                }
            };
            connector.Labels = new Collection()
            {
                new Label()
                {
                    Text = "Booking system failure", FillColor = "white", Offset = new DiagramPoint(0.5f, 0.5f)
                }
            };

            connector          = ConnectBPMN("intermediatecancel", "node4");
            connector.Segments = new Collection()
            {
                new Segment()
                {
                    Type      = Segments.Orthogonal,
                    Length    = 50,
                    Direction = "bottom"
                }
            };
            ConnectBPMN("subnode01", "subnode02");
            ConnectBPMN("subnode02", "subnode03");
            ConnectBPMN("subnode03", "subnode04");

            connector          = ConnectBPMN("subnodecompensation", "subnode05");
            connector.Segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 30, Direction = "bottom"
                },
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 80, Direction = "right"
                }
            };
            connector.Shape = new ConnectorShape()
            {
                Type        = ConnectorShapes.BPMN,
                Flow        = BPMNFlows.Association,
                Association = AssociationFlows.Directional
            };

            connector          = ConnectBPMN("subnodeerror", "subnode06");
            connector.Segments = new Collection()
            {
                new Segment()
                {
                    Type      = Segments.Orthogonal,
                    Length    = 50,
                    Direction = "bottom"
                }
            };
            connector.Labels = new Collection()
            {
                new Label()
                {
                    Text = "cannot charge card", FillColor = "white", Offset = new DiagramPoint(0.75f, 0.55f)
                }
            };
        }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BPMNNode node = CreateBPMNShape(DiagramWebControl1.Nodes, "node1", BPMNShapes.Event, 60, 60, 95, 90, "Customer query", "Queries from the customer");

            node.Event   = BPMNEvents.Start;
            node.Trigger = BPMNTriggers.Message;

            CreateBPMNShape(DiagramWebControl1.Nodes, "node2", BPMNShapes.Gateway, 75, 70, 200, 90, "Enough details?", "Whether the provided information is enough?");

            node          = CreateBPMNShape(DiagramWebControl1.Nodes, "node3", BPMNShapes.Activity, 60, 50, 325, 90, "Analyse", "Analysing the query");
            node.Activity = BPMNActivity.Task;

            node             = CreateBPMNShape(DiagramWebControl1.Nodes, "node4", BPMNShapes.Gateway, 75, 70, 450, 90, "", "");
            node.Gateway     = BPMNGateways.Exclusive;
            node.Constraints = NodeConstraints.Default & ~NodeConstraints.InheritTooltip;

            CreateBPMNShape(DiagramWebControl1.Nodes, "node5", BPMNShapes.Gateway, 75, 70, 610, 90, "Validate", "Whether the reported/requested bug/feature is valid?");

            node         = CreateBPMNShape(DiagramWebControl1.Nodes, "node6", BPMNShapes.Event, 60, 60, 715, 90, "", "Send the invalid message to customer");
            node.Event   = BPMNEvents.End;
            node.Trigger = BPMNTriggers.Message;

            node = CreateBPMNShape(DiagramWebControl1.Nodes, "node7", BPMNShapes.Activity, 60, 50, 200, 200, "Request", "Requesting for more information");

            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Send;

            node         = CreateBPMNShape(DiagramWebControl1.Nodes, "node8", BPMNShapes.Event, 60, 60, 450, 200, "", "Share the User Guide/Knowledge Base link");
            node.Event   = BPMNEvents.End;
            node.Trigger = BPMNTriggers.Message;

            node          = CreateBPMNShape(DiagramWebControl1.Nodes, "node9", BPMNShapes.Activity, 70, 50, 610, 200, "Log bug/feature", "Log the bug/feature");
            node.Activity = BPMNActivity.Task;

            node                      = CreateBPMNShape(DiagramWebControl1.Nodes, "node10", BPMNShapes.Activity, 75, 55, 450, 300, "Implement", "Fix the bug/Add the feature");
            node.Activity             = BPMNActivity.SubProcess;
            node.SubProcess.Collapsed = false;
            node.SubProcess.Events    = new Collection()
            {
                new BPMNEvent()
                {
                    Event = BPMNEvents.Intermediate, Trigger = BPMNTriggers.Timer, Offset = new DiagramPoint()
                    {
                        X = 0.5f, Y = 1
                    }
                }
            };

            node         = CreateBPMNShape(DiagramWebControl1.Nodes, "node12", BPMNShapes.Event, 60, 60, 325, 300, "", "Provide the solution");
            node.Event   = BPMNEvents.End;
            node.Trigger = BPMNTriggers.Message;

            node         = CreateBPMNShape(DiagramWebControl1.Nodes, "node13", BPMNShapes.Event, 60, 60, 715, 300, "", "Share the task details");
            node.Event   = BPMNEvents.End;
            node.Trigger = BPMNTriggers.Message;


            node             = CreateBPMNShape(DiagramWebControl1.Nodes, "node14", BPMNShapes.Gateway, 60, 60, 610, 300, "", "");
            node.Gateway     = BPMNGateways.Parallel;
            node.Constraints = NodeConstraints.Default & ~NodeConstraints.InheritTooltip;

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node1", "node2");

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node2", "node3");

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node3", "node4");

            Label label = new Label()
            {
                Text = "Feature/ Bug", FillColor = "white", Offset = new DiagramPoint(0.5f, 0.9f), Wrapping = TextWrapping.Wrap
            };

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node4", "node5", null, label);

            label = new Label()
            {
                Text = "Invalid", FillColor = "white", Offset = new DiagramPoint(0.5f, 0.050f)
            };
            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node5", "node6", null, label);


            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node2", "node7");

            label = new Label()
            {
                Text = "How to?", FillColor = "white", Offset = new DiagramPoint(0.5f, 0.5f)
            };
            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node4", "node8", null, label);

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node5", "node9");

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node14", "node13");

            Collection segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 100, Direction = "right"
                },
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 100, Direction = "top"
                },
            };

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node7", "node3", segments);

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node14", "node10");

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node10", "node12");

            ConnectBPMNShapes(DiagramWebControl1.Connectors, "node9", "node14");


            DiagramWebControl1.PageSettings.ScrollLimit     = ScrollLimit.Diagram;
            DiagramWebControl1.SnapSettings.SnapConstraints = SnapConstraints.None;
            DiagramWebControl1.Tooltip = new Syncfusion.JavaScript.DataVisualization.Models.Diagram.Tooltip()
            {
                TemplateId = "mouseovertoolTipId"
            };
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BPMNNode node = CreateBPMN("node1", BPMNShapes.Event, 60, 60, 55, 200, "Select Support Ticket");

            node.Event = BPMNEvents.Start;

            CreateBPMN("node2", BPMNShapes.Activity, 75, 70, 190, 200, "Handle Support Ticket");
            node.Activity = BPMNActivity.Task;
            node          = CreateBPMN("node3", BPMNShapes.Gateway, 75, 70, 355, 200, "");
            node.Gateway  = BPMNGateways.Exclusive;

            node           = CreateBPMN("node4", BPMNShapes.Activity, 75, 70, 530, 90, "Respond to customer");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node           = CreateBPMN("node5", BPMNShapes.Activity, 75, 70, 530, 200, "Close ticket");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node           = CreateBPMN("node6", BPMNShapes.Activity, 75, 70, 530, 300, "Escalate ticket");
            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Service;

            node       = CreateBPMN("node7", BPMNShapes.Event, 60, 60, 660, 90, "");
            node.Event = BPMNEvents.End;

            node       = CreateBPMN("node8", BPMNShapes.Event, 60, 60, 660, 200, "");
            node.Event = BPMNEvents.End;

            node       = CreateBPMN("node9", BPMNShapes.Event, 60, 60, 660, 300, "");
            node.Event = BPMNEvents.End;

            ConnNode(DiagramWebControl1.Connectors, "node1", "node2");

            ConnNode(DiagramWebControl1.Connectors, "node2", "node3");

            Collection segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 75, Direction = "top"
                },
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 80, Direction = "right"
                },
            };
            Label label = new Label()
            {
                Text = "Respond", FillColor = "white", Wrapping = TextWrapping.Wrap
            };

            ConnNode(DiagramWebControl1.Connectors, "node3", "node4", segments, label);

            segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 75, Direction = "right"
                },
            };
            label = new Label()
            {
                Text = "Close", FillColor = "white", Wrapping = TextWrapping.Wrap
            };
            ConnNode(DiagramWebControl1.Connectors, "node3", "node5", segments, label);

            segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 65, Direction = "bottom"
                },
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 75, Direction = "right"
                },
            };
            label = new Label()
            {
                Text = "Escalate", FillColor = "white"
            };
            ConnNode(DiagramWebControl1.Connectors, "node3", "node6", segments, label);

            ConnNode(DiagramWebControl1.Connectors, "node4", "node7");
            ConnNode(DiagramWebControl1.Connectors, "node5", "node8");
            ConnNode(DiagramWebControl1.Connectors, "node6", "node9");
        }
        //
        // GET: /Tooltip/
        public ActionResult Tooltip()
        {
            DiagramProperties model = new DiagramProperties();

            model.Height = "450px";
            model.Width  = "100%";
            model.PageSettings.ScrollLimit = ScrollLimit.Diagram;
            BPMNNode node = CreateBPMNShape(model, "node1", BPMNShapes.Event, 60, 60, 95, 90, "Customer query", "Queries from the customer");

            node.Event       = BPMNEvents.Start;
            node.Trigger     = BPMNTriggers.Message;
            node.Constraints = NodeConstraints.Default & ~NodeConstraints.InheritTooltip;
            node.Tooltip     = new Tooltip()
            {
                TemplateId = "mouseovertoolTipId", Alignment = new Alignment()
                {
                    Horizontal = HorizontalAlignment.Left
                }, Margin = new Margin()
                {
                    Left = 180
                }
            };

            CreateBPMNShape(model, "node2", BPMNShapes.Gateway, 75, 70, 200, 90, "Enough details?", "Whether the provided information is enough?");

            node          = CreateBPMNShape(model, "node3", BPMNShapes.Activity, 60, 50, 325, 90, "Analyse", "Analysing the query");
            node.Activity = BPMNActivity.Task;

            node             = CreateBPMNShape(model, "node4", BPMNShapes.Gateway, 75, 70, 450, 90, "", "");
            node.Gateway     = BPMNGateways.Exclusive;
            node.Constraints = NodeConstraints.Default & ~NodeConstraints.InheritTooltip;

            CreateBPMNShape(model, "node5", BPMNShapes.Gateway, 75, 70, 610, 90, "Validate", "Whether the reported/requested bug/feature is valid?");

            node             = CreateBPMNShape(model, "node6", BPMNShapes.Event, 60, 60, 715, 90, "", "Send the invalid message to customer");
            node.Event       = BPMNEvents.End;
            node.Trigger     = BPMNTriggers.Message;
            node.Constraints = NodeConstraints.Default & ~NodeConstraints.InheritTooltip;
            node.Tooltip     = new Tooltip()
            {
                TemplateId = "mouseovertoolTipId", Alignment = new Alignment()
                {
                    Horizontal = HorizontalAlignment.Left
                }, Margin = new Margin()
                {
                    Left = 80
                }
            };

            node = CreateBPMNShape(model, "node7", BPMNShapes.Activity, 60, 50, 200, 200, "Request", "Requesting for more information");

            node.Activity  = BPMNActivity.Task;
            node.Task.Type = BPMNTasks.Send;

            node         = CreateBPMNShape(model, "node8", BPMNShapes.Event, 60, 60, 450, 200, "", "Share the User Guide/Knowledge Base link");
            node.Event   = BPMNEvents.End;
            node.Trigger = BPMNTriggers.Message;

            node          = CreateBPMNShape(model, "node9", BPMNShapes.Activity, 70, 50, 610, 200, "Log bug/feature", "Log the bug/feature");
            node.Activity = BPMNActivity.Task;

            node                      = CreateBPMNShape(model, "node10", BPMNShapes.Activity, 75, 55, 450, 300, "Implement", "Fix the bug/Add the feature");
            node.Activity             = BPMNActivity.SubProcess;
            node.SubProcess.Collapsed = false;
            node.SubProcess.Events    = new Collection()
            {
                new BPMNEvent()
                {
                    Event = BPMNEvents.Intermediate, Trigger = BPMNTriggers.Timer, Offset = new DiagramPoint()
                    {
                        X = 0.5f, Y = 1
                    }
                }
            };

            node         = CreateBPMNShape(model, "node12", BPMNShapes.Event, 60, 60, 325, 300, "", "Provide the solution");
            node.Event   = BPMNEvents.End;
            node.Trigger = BPMNTriggers.Message;

            node             = CreateBPMNShape(model, "node13", BPMNShapes.Event, 60, 60, 715, 300, "", "Share the task details");
            node.Event       = BPMNEvents.End;
            node.Trigger     = BPMNTriggers.Message;
            node.Constraints = NodeConstraints.Default & ~NodeConstraints.InheritTooltip;
            node.Tooltip     = new Tooltip()
            {
                TemplateId = "mouseovertoolTipId", Alignment = new Alignment()
                {
                    Horizontal = HorizontalAlignment.Left
                }, Margin = new Margin()
                {
                    Left = 70
                }
            };

            node             = CreateBPMNShape(model, "node14", BPMNShapes.Gateway, 60, 60, 610, 300, "", "");
            node.Gateway     = BPMNGateways.Parallel;
            node.Constraints = NodeConstraints.Default & ~NodeConstraints.InheritTooltip;

            ConnectBPMNNodes(model, "node1", "node2");

            ConnectBPMNNodes(model, "node2", "node3");

            ConnectBPMNNodes(model, "node3", "node4");

            Label label = new Label()
            {
                Text = "Feature/ Bug", FillColor = "white", Offset = new DiagramPoint(0.5f, 0.9f), Wrapping = TextWrapping.Wrap
            };

            ConnectBPMNNodes(model, "node4", "node5", null, label);

            label = new Label()
            {
                Text = "Invalid", FillColor = "white", Offset = new DiagramPoint(0.5f, 0.050f)
            };
            ConnectBPMNNodes(model, "node5", "node6", null, label);

            ConnectBPMNNodes(model, "node2", "node7");

            label = new Label()
            {
                Text = "How to?", FillColor = "white", Offset = new DiagramPoint(0.5f, 0.5f)
            };
            ConnectBPMNNodes(model, "node4", "node8", null, label);

            ConnectBPMNNodes(model, "node5", "node9");
            ConnectBPMNNodes(model, "node14", "node13");

            Collection segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 100, Direction = "right"
                },
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 100, Direction = "top"
                },
            };

            ConnectBPMNNodes(model, "node7", "node3", segments);

            ConnectBPMNNodes(model, "node14", "node10");
            ConnectBPMNNodes(model, "node10", "node12");
            ConnectBPMNNodes(model, "node9", "node14");

            model.SnapSettings.SnapConstraints = SnapConstraints.None;
            model.Tooltip = new Tooltip()
            {
                TemplateId = "mouseovertoolTipId"
            };
            ViewData["diagramModel"] = model;
            return(View());
        }
        public ActionResult UserHandles()
        {
            colors.Add(new ColorData {
                value = "Black", text = "Black"
            });
            colors.Add(new ColorData {
                value = "White", text = "White"
            });
            colors.Add(new ColorData {
                value = "Goldenrod", text = "Goldenrod"
            });
            colors.Add(new ColorData {
                value = "Indigo", text = "Indigo"
            });
            colors.Add(new ColorData {
                value = "DarkGoldenRod", text = "DarkGoldenRod"
            });
            colors.Add(new ColorData {
                value = "FireBrick", text = "FireBrick"
            });
            colors.Add(new ColorData {
                value = "DarkRed", text = "DarkRed"
            });
            colors.Add(new ColorData {
                value = "Khaki", text = "Khaki"
            });
            colors.Add(new ColorData {
                value = "LightCoral", text = "LightCoral"
            });
            colors.Add(new ColorData {
                value = "Moccasin", text = "Moccasin"
            });
            colors.Add(new ColorData {
                value = "Teal", text = "Teal"
            });

            DiagramProperties model = new DiagramProperties();

            model.Height = "600px";
            model.Width  = "100%";
            model.PageSettings.ScrollLimit = ScrollLimit.Diagram;
            model.SelectionChange          = "selectionChanged";
            model.DefaultSettings.Node     = new Node()
            {
                BorderColor = "black",
                Labels      = new Collection()
                {
                    new Label()
                    {
                        FontColor = "white"
                    }
                }
            };
            model.DefaultSettings.Connector = new Connector()
            {
                TargetDecorator = new Decorator()
                {
                    Shape       = DecoratorShapes.Arrow,
                    BorderColor = "black",
                    Width       = 5,
                    Height      = 10
                },
                Segments = new Collection()
                {
                    new Segment()
                    {
                        Type = Segments.Orthogonal
                    }
                },
            };

            CreateBPMNNode(model, "node1", BPMNShapes.Event, 40, 40, 85, 230, 0, 0, "");

            BPMNNode node = CreateBPMNNode(model, "node2", BPMNShapes.Activity, 520, 250, 405, 230, 0, 0, "");

            node.Activity             = BPMNActivity.SubProcess;
            node.SubProcess.Collapsed = false;
            node.SubProcess.Type      = BPMNSubProcessTypes.Transaction;
            node.SubProcess.Events    = new Collection()
            {
                new BPMNEvent()
                {
                    Event = BPMNEvents.Intermediate, Name = "intermediateerror", Trigger = BPMNTriggers.Error, Offset = new DiagramPoint()
                    {
                        X = 0.25f, Y = 1
                    }
                },
                new BPMNEvent()
                {
                    Event = BPMNEvents.Intermediate, Name = "intermediatecancel", Trigger = BPMNTriggers.Cancel, Offset = new DiagramPoint()
                    {
                        X = 0.75f, Y = 1
                    }
                }
            };
            Collection Processes = new Collection();

            Processes.Add(new BPMNNode()
            {
                Name       = "subnode01",
                MarginLeft = 20,
                MarginTop  = 40,
                Height     = 30,
                Width      = 30,
                Shape      = BPMNShapes.Event
            });
            Collection label = new Collection()
            {
                new Label()
                {
                    Text = "book hotel", Offset = new DiagramPoint(0.5f, 0.5f)
                }
            };
            BPMNTask task = new BPMNTask()
            {
                Type = BPMNTasks.Service,
                Loop = BPMNLoops.ParallelMultiInstance,
            };

            Processes.Add(new BPMNNode()
            {
                Name       = "subnode02",
                MarginLeft = 110,
                MarginTop  = 20,
                Width      = 95,
                Height     = 70,
                FillColor  = "#6FAAB0",
                Shape      = BPMNShapes.Activity,
                Activity   = BPMNActivity.Task,
                Task       = task,
                Labels     = label
            });
            Processes.Add(new BPMNNode()
            {
                Name       = "subnodecompensation",
                MarginLeft = 170,
                MarginTop  = 75,
                Width      = 30,
                Height     = 30,
                Shape      = BPMNShapes.Event,
                Event      = BPMNEvents.Intermediate,
                Trigger    = BPMNTriggers.Compensation
            });
            label = new Collection()
            {
                new Label()
                {
                    Text = "charge credit card", Offset = new DiagramPoint(0.5f, 0.6f)
                }
            };
            task = new BPMNTask()
            {
                Type = BPMNTasks.Service
            };
            Processes.Add(new BPMNNode()
            {
                Name       = "subnode03",
                MarginLeft = 290,
                MarginTop  = 20,
                Width      = 95,
                Height     = 70,
                FillColor  = "#F6B53F",
                Shape      = BPMNShapes.Activity,
                Labels     = label,
                Activity   = BPMNActivity.Task,
                Task       = task
            });
            Processes.Add(new BPMNNode()
            {
                Name       = "subnodeerror",
                MarginLeft = 350,
                MarginTop  = 75,
                Width      = 30,
                Height     = 30,
                Shape      = BPMNShapes.Event,
                Event      = BPMNEvents.Intermediate,
                Trigger    = BPMNTriggers.Error
            });
            Processes.Add(new BPMNNode()
            {
                Name       = "subnode04",
                MarginLeft = 440,
                MarginTop  = 40,
                Width      = 30,
                Height     = 30,
                Shape      = BPMNShapes.Event,
                Event      = BPMNEvents.End
            });
            label = new Collection()
            {
                new Label()
                {
                    Text = "cancel hotel reservation", Offset = new DiagramPoint(0.5f, 0.5f)
                }
            };
            task = new BPMNTask()
            {
                Type         = BPMNTasks.User,
                Compensation = true
            };
            Processes.Add(new BPMNNode()
            {
                Name       = "subnode05",
                MarginLeft = 240,
                MarginTop  = 130,
                Width      = 90,
                Height     = 80,
                FillColor  = "#E94649",
                Shape      = BPMNShapes.Activity,
                Activity   = BPMNActivity.Task,
                Labels     = label,
                Task       = task
            });
            Processes.Add(new BPMNNode()
            {
                Name       = "subnode06",
                MarginLeft = 440,
                MarginTop  = 155,
                Width      = 30,
                Height     = 30,
                Shape      = BPMNShapes.Event,
                Event      = BPMNEvents.End
            });
            node.SubProcess.Processes = Processes;
            node       = CreateBPMNNode(model, "node3", BPMNShapes.Event, 40, 40, 355, 420, 0, 0, "hazard");
            node.Event = BPMNEvents.End;
            node       = CreateBPMNNode(model, "node4", BPMNShapes.Event, 40, 40, 595, 420, 0, 0, "cancelled");
            node.Event = BPMNEvents.End;
            node       = CreateBPMNNode(model, "node5", BPMNShapes.Event, 40, 40, 715, 230, 0, 0, "successful");
            node.Event = BPMNEvents.End;

            ConnectBPMN(model, "node1", "node2");
            ConnectBPMN(model, "node2", "node5");
            Connector connector = ConnectBPMN(model, "intermediateerror", "node3");

            connector.Segments = new Collection()
            {
                new Segment()
                {
                    Type      = Segments.Orthogonal,
                    Length    = 50,
                    Direction = "bottom"
                }
            };
            connector.Labels = new Collection()
            {
                new Label()
                {
                    Text = "Booking system failure", FillColor = "white", Offset = new DiagramPoint(0.5f, 0.5f)
                }
            };

            connector          = ConnectBPMN(model, "intermediatecancel", "node4");
            connector.Segments = new Collection()
            {
                new Segment()
                {
                    Type      = Segments.Orthogonal,
                    Length    = 50,
                    Direction = "bottom"
                }
            };
            ConnectBPMN(model, "subnode01", "subnode02");
            ConnectBPMN(model, "subnode02", "subnode03");
            ConnectBPMN(model, "subnode03", "subnode04");

            connector          = ConnectBPMN(model, "subnodecompensation", "subnode05");
            connector.Segments = new Collection()
            {
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 30, Direction = "bottom"
                },
                new Segment()
                {
                    Type = Segments.Orthogonal, Length = 80, Direction = "right"
                }
            };
            connector.Shape = new ConnectorShape()
            {
                Type        = ConnectorShapes.BPMN,
                Flow        = BPMNFlows.Association,
                Association = AssociationFlows.Directional
            };

            connector          = ConnectBPMN(model, "subnodeerror", "subnode06");
            connector.Segments = new Collection()
            {
                new Segment()
                {
                    Type      = Segments.Orthogonal,
                    Length    = 50,
                    Direction = "bottom"
                }
            };
            connector.Labels = new Collection()
            {
                new Label()
                {
                    Text = "cannot charge card", FillColor = "white", Offset = new DiagramPoint(0.75f, 0.55f)
                }
            };

            model.SnapSettings.SnapConstraints = SnapConstraints.None;
            ViewData["diagramModel"]           = model;
            ViewBag.datasource = colors;
            return(View());
        }