Example #1
0
 public EFCoreSagaStateData(string sagaId, string sagaType, SagaStates state, string messagePayload)
 {
     SagaId         = sagaId;
     SagaType       = sagaType;
     State          = state;
     MessagePayload = messagePayload;
 }
Example #2
0
        public async Task SetSagaStateAsync(Guid id, SagaStates state, CancellationToken cancellationToken)
        {
            var filter = Builders <IntegrationSagaEntity> .Filter.Eq(s => s.Id, id);

            var update = Builders <IntegrationSagaEntity> .Update.Set(s => s.State, state);

            await SagasCollection.UpdateOneAsync(filter, update, null, cancellationToken);
        }
Example #3
0
 public virtual void Reject()
 {
     State = SagaStates.Rejected;
     throw new ChronicleException("Saga rejection called by method");
 }
Example #4
0
 public virtual void Complete()
 => State = SagaStates.Completed;
Example #5
0
 public virtual void Initialize(SagaId id, SagaStates state)
 => (Id, State) = (id, state);
Example #6
0
 private SagaState(Guid id, Type type, SagaStates state, object data)
 => (Id, Type, State, Data) = (id, type, state, data);
Example #7
0
 public virtual void Reject(Exception innerException = null)
 {
     State = SagaStates.Rejected;
     throw new ChronicleException("Saga rejection called by method", innerException);
 }
 public void Update(SagaStates state, object data = null)
 {
     State = state;
     Data  = data;
 }
Example #9
0
 void ISaga.Initialize(Guid id, SagaStates state, object data)
 => Initialize(id, state, (TData)data);
Example #10
0
 public virtual void Initialize(Guid id, SagaStates state, TData data)
 => (Id, State, Data) = (id, state, data);
Example #11
0
 public void Update(SagaStates state, object data = null)
 {
     State          = state;
     MessagePayload = JsonConvert.SerializeObject(data);
 }
Example #12
0
 private SagaData(Guid sagaId, Type sagaType, SagaStates state, object data)
 => (SagaId, SagaType, State, Data) = (sagaId, sagaType, state, data);
Example #13
0
 public virtual void Reject() => State = SagaStates.Rejected;
 public RedisSagaState(SagaId id, Type type, SagaStates state, object data = null, Type dataType = null)
 => (Id, Type, State, Data, DataType) = (id, type, state, data, dataType);