コード例 #1
0
 /// <summary>
 /// Initializes a new <see cref="V1CreateWorkflowInstanceCommand"/>
 /// </summary>
 /// <param name="lifetime">The lifetime of the <see cref="V1Correlation"/> to create</param>
 /// <param name="conditionType">The type of <see cref="V1CorrelationCondition"/> evaluation the <see cref="V1Correlation"/> should use</param>
 /// <param name="conditions">An <see cref="IEnumerable{T}"/> containing all <see cref="V1CorrelationCondition"/>s the <see cref="V1Correlation"/> to create is made out of</param>
 /// <param name="outcome">The <see cref="V1CorrelationOutcome"/> of the <see cref="V1Correlation"/> to create</param>
 /// <param name="context">The initial <see cref="V1CorrelationContext"/> of the <see cref="V1Correlation"/> to create</param>
 public V1CreateCorrelationCommand(V1CorrelationLifetime lifetime, V1CorrelationConditionType conditionType,
                                   IEnumerable <V1CorrelationCondition> conditions, V1CorrelationOutcome outcome, V1CorrelationContext?context)
 {
     this.Lifetime      = lifetime;
     this.ConditionType = conditionType;
     this.Conditions    = conditions;
     this.Outcome       = outcome;
     this.Context       = context;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new <see cref="V1CorrelationCreatedDomainEvent"/>
 /// </summary>
 /// <param name="id">The id of the newly created <see cref="V1Correlation"/></param>
 /// <param name="lifetime">The lifetime of the newly created <see cref="V1Correlation"/></param>
 /// <param name="conditionType">The type of <see cref="V1CorrelationCondition"/> evaluation the newly created <see cref="V1Correlation"/> should use</param>
 /// <param name="conditions">An <see cref="IEnumerable{T}"/> containing all <see cref="V1CorrelationCondition"/>s the newly created <see cref="V1Correlation"/> is made out of</param>
 /// <param name="outcome">The <see cref="V1CorrelationOutcome"/> of the newly created <see cref="V1Correlation"/></param>
 /// <param name="context">The initial <see cref="V1CorrelationContext"/> of the newly created <see cref="V1Correlation"/></param>
 public V1CorrelationCreatedDomainEvent(string id, V1CorrelationLifetime lifetime, V1CorrelationConditionType conditionType,
                                        IEnumerable <Models.V1CorrelationCondition> conditions, Models.V1CorrelationOutcome outcome, Models.V1CorrelationContext?context)
     : base(id)
 {
     this.Lifetime      = lifetime;
     this.ConditionType = conditionType;
     this.Conditions    = conditions;
     this.Outcome       = outcome;
     this.Context       = context;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new <see cref="V1Correlation"/>
 /// </summary>
 /// <param name="lifetime">The <see cref="V1Correlation"/>'s lifetime</param>
 /// <param name="conditionType">A value determining the type of the <see cref="V1Correlation"/>'s <see cref="V1CorrelationCondition"/> evaluation</param>
 /// <param name="conditions">An <see cref="IReadOnlyCollection{T}"/> containing the <see cref="V1Correlation"/>'s conditions</param>
 /// <param name="outcome">The outcome of the <see cref="V1Correlation"/></param>
 /// <param name="context">The initial <see cref="V1CorrelationContext"/></param>
 public V1Correlation(V1CorrelationLifetime lifetime, V1CorrelationConditionType conditionType, IEnumerable <V1CorrelationCondition> conditions, V1CorrelationOutcome outcome, V1CorrelationContext?context = null)
     : base(Guid.NewGuid().ToString())
 {
     if (conditions == null ||
         !conditions.Any())
     {
         throw DomainException.ArgumentNull(nameof(conditions));
     }
     if (outcome == null)
     {
         throw DomainException.ArgumentNull(nameof(outcome));
     }
     this.On(this.RegisterEvent(new V1CorrelationCreatedDomainEvent(this.Id, lifetime, conditionType, conditions, outcome, context)));
 }