private void ShapeAdded(object sender, BpmnElementEvent e)
        {
            //New process is being added (along with a participant/pool)
            if (e.Element.Type == "bpmn:Participant")
            {
                _contractManager.AddNewProcess(e.Element.ProcessId, e.Element.Id);

                if (_contractManager.TryGetProcess(e.Element.ProcessId, out var process))
                {
                    if (_editElementService.EditElement == process)
                    {
                        _editElementService.EditedElementModified();
                    }
                    else
                    {
                        _editElementService.EditElement = process;
                    }
                }
            }
            //Process element is being added
            else
            {
                ElementAdded(e);
            }
        }
Example #2
0
        public void AssignNewElementAndChangeIt_ShouldNotify()
        {
            var editElementService = new EditElementService();
            var element            = new ScriptTask()
            {
                Id = "Script-1"
            };
            var mock = new Mock <IEditElementConsumer>();
            Expression <Action <IEditElementConsumer> > call = m => m.ConsumeEditElementChanged(editElementService, EventArgs.Empty);

            mock.Setup(call).Verifiable();
            editElementService.EditElementModified += mock.Object.ConsumeEditElementChanged;
            // ACT
            editElementService.EditElement = element;
            element.Name = "Hello";
            editElementService.EditedElementModified();
            // ASSERT
            mock.Verify(call, Times.Once);
        }