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); } }
private Process GetProcess(string processId) { if (!_contractManager.TryGetProcess(processId, out var process)) { throw new InvalidIdException($"Process id {processId} does not exist"); } return(process); }