/// <summary> /// Internal constructor. /// </summary> /// <param name="parentWorkflow">The parent workflow.</param> /// <param name="workflowTypeName">The workflow type name.</param> /// <param name="options">Optional child workflow options.</param> internal ChildWorkflowFutureStub(Workflow parentWorkflow, string workflowTypeName, ChildWorkflowOptions options = null) { Covenant.Requires <ArgumentNullException>(parentWorkflow != null, nameof(parentWorkflow)); Covenant.Requires <ArgumentNullException>(!string.IsNullOrEmpty(workflowTypeName), nameof(workflowTypeName)); this.parentWorkflow = parentWorkflow; this.client = parentWorkflow.Client; this.WorkflowTypeName = workflowTypeName; this.Options = ChildWorkflowOptions.Normalize(client, options); if (string.IsNullOrEmpty(Options.Domain)) { Options.Domain = parentWorkflow.WorkflowInfo.Domain; } }
/// <summary> /// Internal constructor. /// </summary> /// <param name="parentWorkflow">The associated parent workflow.</param> /// <param name="methodName">Identifies the target workflow method or <c>null</c> or empty.</param> /// <param name="options">The child workflow options or <c>null</c>.</param> internal ChildWorkflowStub(Workflow parentWorkflow, string methodName, ChildWorkflowOptions options) { Covenant.Requires <ArgumentNullException>(parentWorkflow != null, nameof(parentWorkflow)); var workflowInterface = typeof(TWorkflowInterface); CadenceHelper.ValidateWorkflowInterface(workflowInterface); this.parentWorkflow = parentWorkflow; this.options = ChildWorkflowOptions.Normalize(parentWorkflow.Client, options); this.hasStarted = false; var workflowTarget = CadenceHelper.GetWorkflowTarget(workflowInterface, methodName); this.workflowTypeName = workflowTarget.WorkflowTypeName; this.targetMethod = workflowTarget.TargetMethod; }