Exemple #1
0
        public void UpdatePayload(string payload)
        {
            var evt = new CaseFilePayloadUpdatedEvent(Guid.NewGuid().ToString(), AggregateId, Version, DateTime.UtcNow, payload);

            Handle(evt);
            DomainEvents.Add(evt);
        }
Exemple #2
0
        private void Handle(CaseFilePayloadUpdatedEvent caseFilePayloadUpdatedEvent)
        {
            if (string.IsNullOrWhiteSpace(caseFilePayloadUpdatedEvent.Payload))
            {
                throw new AggregateValidationException(new List <KeyValuePair <string, string> >
                {
                    new KeyValuePair <string, string>("validation", "payload must be specified")
                });
            }

            try
            {
                CMMNParser.ParseWSDL(caseFilePayloadUpdatedEvent.Payload);
            }
            catch
            {
                throw new AggregateValidationException(new List <KeyValuePair <string, string> >
                {
                    new KeyValuePair <string, string>("validation", "xml file is not valid")
                });
            }

            Payload        = caseFilePayloadUpdatedEvent.Payload;
            UpdateDateTime = caseFilePayloadUpdatedEvent.UpdateDatetime;
        }