/// <summary>
 /// Initializes a new <see cref="V1CreateWorkflowInstanceCommand"/>
 /// </summary>
 /// <param name="workflowId">The id of the <see cref="V1Workflow"/> to instanciate</param>
 /// <param name="activationType">The <see cref="V1Workflow"/>'s activation type</param>
 /// <param name="inputData">The input data of the <see cref="V1WorkflowInstance"/> to create</param>
 /// <param name="correlationContext">The <see cref="V1CorrelationContext"/> of the <see cref="V1WorkflowInstance"/> to create</param>
 /// <param name="autoStart">A boolean indicating whether or not to start the <see cref="V1WorkflowInstance"/> once it has been created</param>
 /// <param name="parentId">The id of the parent <see cref="V1WorkflowInstance"/> of the <see cref="V1WorkflowInstance"/> to create</param>
 public V1CreateWorkflowInstanceCommand(string workflowId, V1WorkflowInstanceActivationType activationType, object?inputData, V1CorrelationContext?correlationContext, bool autoStart, string?parentId)
 {
     this.WorkflowId         = workflowId;
     this.ActivationType     = activationType;
     this.InputData          = inputData;
     this.CorrelationContext = correlationContext;
     this.AutoStart          = autoStart;
     this.ParentId           = parentId;
 }
 /// <summary>
 /// Initializes a new <see cref="V1WorkflowInstance"/>
 /// </summary>
 /// <param name="key">The <see cref="V1WorkflowInstance"/>'s key</param>
 /// <param name="workflow">The <see cref="V1WorkflowInstance"/>'s <see cref="V1Workflow"/></param>
 /// <param name="activationType">The <see cref="V1WorkflowInstance"/>'s activation type</param>
 /// <param name="input">The <see cref="V1WorkflowInstance"/>'s input data</param>
 /// <param name="correlationContext">An <see cref="IEnumerable{T}"/> containing the <see cref="CloudEvent"/>s that have triggered the creation of the <see cref="V1WorkflowInstance"/></param>
 /// <param name="parent">The <see cref="V1WorkflowInstance"/>'s parent, if any</param>
 public V1WorkflowInstance(string key, V1Workflow workflow, V1WorkflowInstanceActivationType activationType, object?input = null, V1CorrelationContext?correlationContext = null, V1WorkflowInstance?parent = null)
     : this()
 {
     if (workflow == null)
     {
         throw DomainException.ArgumentNull(nameof(workflow));
     }
     if (input == null)
     {
         input = new();
     }
     if (correlationContext == null)
     {
         correlationContext = new();
     }
     this.On(this.RegisterEvent(new V1WorkflowInstanceCreatedDomainEvent(BuildUniqueIdentifier(key, workflow), workflow.Id, key.ToLowerInvariant(), activationType, input, correlationContext, parent?.Id)));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new <see cref="V1WorkflowInstanceCreatedDomainEvent"/>
 /// </summary>
 /// <param name="id">The id of the newly created <see cref="V1WorkflowInstance"/></param>
 /// <param name="workflowId">The id of the instanciated <see cref="V1Workflow"/></param>
 /// <param name="key">The key of the newly created <see cref="V1WorkflowInstance"/></param>
 /// <param name="activationType">The type of the <see cref="V1WorkflowInstance"/>'s activation</param>
 /// <param name="input">The newly created <see cref="V1WorkflowInstance"/>'s input data</param>
 /// <param name="correlationContext">The newly created <see cref="V1WorkflowInstance"/>'s <see cref="V1CorrelationContext"/></param>
 /// <param name="parentId">The id of the newly created <see cref="V1WorkflowInstance"/>'s parent, if any</param>
 public V1WorkflowInstanceCreatedDomainEvent(string id, string workflowId, string key, V1WorkflowInstanceActivationType activationType, object?input, Models.V1CorrelationContext correlationContext, string?parentId)
     : base(id)
 {
     this.Key                = key;
     this.WorkflowId         = workflowId;
     this.ActivationType     = activationType;
     this.Input              = input;
     this.CorrelationContext = correlationContext;
     this.ParentId           = parentId;
 }