private void ElementChanged(object sender, BpmnElementEvent e)
        {
            //No process id is defined, or the process does not exist -- the element is in the phase of deletion
            if (string.IsNullOrEmpty(e.Element.ProcessId) || !_processManager.ProcessExists(e.Element.ProcessId))
            {
                return;
            }

            IContractElement contractElement = null;

            if (e.Element.Type == "bpmn:Participant")
            {
                _contractManager.TryGetProcess(e.Element.ProcessId, out var process);
                process.Name    = e.Element.Name;
                contractElement = process;
            }

            if (_processManager.TryRetrieveIElementById(e.Element.Id, out var element))
            {
                //Parse element name
                element.Name = e.Element.Name;
                //Parse element loop type
                if (element is Abstraction.Processes.Tasks.Task)
                {
                    var taskElement = element as Abstraction.Processes.Tasks.Task;
                    if (e.Element.LoopType == "bpmn:MultiInstanceLoopCharacteristics")
                    {
                        if (e.Element.IsSequential)
                        {
                            taskElement.InstanceType = Abstraction.Processes.Tasks.InstanceType.Sequential;
                        }
                        else
                        {
                            taskElement.InstanceType = Abstraction.Processes.Tasks.InstanceType.Parallel;
                        }
                    }
                    else
                    {
                        taskElement.InstanceType = Abstraction.Processes.Tasks.InstanceType.Single;
                    }
                }
                if (element is BoundaryEvent)
                {
                    Console.WriteLine($"Attached to: {e.Element.AttachedTo}");
                    var boundaryEvent = element as BoundaryEvent;
                    boundaryEvent.AttachedTo = e.Element.AttachedTo;
                }

                //Parse incoming and outgoing if processElement
                if (element is ProcessElement)
                {
                    var processElement = element as ProcessElement;
                    processElement.Incoming = new List <string>(e.Element.Incoming);
                    processElement.Outgoing = new List <string>(e.Element.Outgoing);
                }

                //Parse sequence flow information
                if (element is SequenceFlow)
                {
                    var sequenceFlow = element as SequenceFlow;
                    _processManager.UpdateSequenceFlowSourceAndTarget(sequenceFlow, e.Element.Source, e.Element.Target, e.Element.ProcessId);
                }

                //Check if parent process of the element has changed
                if (_processManager.TryGetProcessOfElement(element.Id, out var process))
                {
                    if (process.Id != e.Element.ProcessId)
                    {
                        Console.WriteLine($"Process changed in element, prev process: {process.Id}, new Process: {e.Element.ProcessId}");
                        _processManager.ChangeProcessOfElement(element, process.Id, e.Element.ProcessId);
                    }
                }
                contractElement = element;
            }
            //Notify about element modification if currently selected
            if (_editElementService.EditElement == contractElement)
            {
                _editElementService.EditedElementModified();
            }
        }