public static ProcessInstanceAggregate New(List <DomainEvent> evts) { var result = new ProcessInstanceAggregate(); foreach (var evt in evts) { result.Handle(evt); } return(result); }
public static ProcessInstanceAggregate New(string processFileId, string processFileName, ICollection <BaseFlowNode> elements, ICollection <BPMNInterface> interfaces, ICollection <Message> messages, ICollection <ItemDefinition> itemDefs, ICollection <SequenceFlow> sequenceFlows) { var result = new ProcessInstanceAggregate(); var evt = new ProcessInstanceCreatedEvent(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 0, processFileId, processFileName, interfaces, messages, itemDefs, sequenceFlows, DateTime.UtcNow); result.Handle(evt); result.DomainEvents.Add(evt); foreach (var elt in elements) { result.AddFlowNodeDef(elt); } return(result); }