public EFCoreSagaStateData(string sagaId, string sagaType, SagaStates state, string messagePayload) { SagaId = sagaId; SagaType = sagaType; State = state; MessagePayload = messagePayload; }
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); }
public virtual void Reject() { State = SagaStates.Rejected; throw new ChronicleException("Saga rejection called by method"); }
public virtual void Complete() => State = SagaStates.Completed;
public virtual void Initialize(SagaId id, SagaStates state) => (Id, State) = (id, state);
private SagaState(Guid id, Type type, SagaStates state, object data) => (Id, Type, State, Data) = (id, type, state, data);
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; }
void ISaga.Initialize(Guid id, SagaStates state, object data) => Initialize(id, state, (TData)data);
public virtual void Initialize(Guid id, SagaStates state, TData data) => (Id, State, Data) = (id, state, data);
public void Update(SagaStates state, object data = null) { State = state; MessagePayload = JsonConvert.SerializeObject(data); }
private SagaData(Guid sagaId, Type sagaType, SagaStates state, object data) => (SagaId, SagaType, State, Data) = (sagaId, sagaType, state, data);
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);