/// <summary> /// Internal constructor. /// </summary> /// <param name="client">The associated client.</param> /// <param name="methodName"> /// Optionally identifies the target workflow method by the name specified in /// the <c>[WorkflowMethod]</c> attribute tagging the method. Pass a <c>null</c> /// or empty string to target the default method. /// </param> /// <param name="options">Optional workflow options.</param> internal WorkflowFutureStub(TemporalClient client, string methodName = null, StartWorkflowOptions options = null) { Covenant.Requires <ArgumentNullException>(client != null, nameof(client)); var workflowInterface = typeof(WorkflowInterface); var method = TemporalHelper.GetWorkflowMethod(workflowInterface, methodName); TemporalHelper.ValidateWorkflowInterface(workflowInterface); this.client = client; this.workflowTypeName = TemporalHelper.GetWorkflowTarget(workflowInterface, methodName).WorkflowTypeName; this.options = StartWorkflowOptions.Normalize(client, options, workflowInterface, method); }
/// <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); TemporalHelper.ValidateWorkflowInterface(workflowInterface); this.parentWorkflow = parentWorkflow; this.options = options; this.hasStarted = false; var workflowTarget = TemporalHelper.GetWorkflowTarget(workflowInterface, methodName); this.workflowTypeName = workflowTarget.WorkflowTypeName; this.targetMethod = workflowTarget.TargetMethod; }