Skip to content

Commit

Permalink
Rearrange
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Dec 12, 2024
1 parent 1f4ad3e commit d0b7470
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions packages/client/src/workflow-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,32 @@ export class WorkflowClient extends BaseClient {
return await decodeFromPayloadsAtIndex(this.dataConverter, 0, response.queryResult?.payloads);
}

protected async _createUpdateWorkflowRequest(
lifecycleStage: temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage,
input: WorkflowStartUpdateInput
): Promise<temporal.api.workflowservice.v1.IUpdateWorkflowExecutionRequest> {
const updateId = input.options?.updateId ?? uuid4();
return {
namespace: this.options.namespace,
workflowExecution: input.workflowExecution,
firstExecutionRunId: input.firstExecutionRunId,
waitPolicy: {
lifecycleStage,
},
request: {
meta: {
updateId,
identity: this.options.identity,
},
input: {
header: { fields: input.headers },
name: input.updateName,
args: { payloads: await encodeToPayloads(this.dataConverter, ...input.args) },
},
},
};
}

/**
* Start the Update.
*
Expand Down Expand Up @@ -969,32 +995,6 @@ export class WorkflowClient extends BaseClient {
};
}

protected async _createUpdateWorkflowRequest(
lifecycleStage: temporal.api.enums.v1.UpdateWorkflowExecutionLifecycleStage,
input: WorkflowStartUpdateInput
): Promise<temporal.api.workflowservice.v1.IUpdateWorkflowExecutionRequest> {
const updateId = input.options?.updateId ?? uuid4();
return {
namespace: this.options.namespace,
workflowExecution: input.workflowExecution,
firstExecutionRunId: input.firstExecutionRunId,
waitPolicy: {
lifecycleStage,
},
request: {
meta: {
updateId,
identity: this.options.identity,
},
input: {
header: { fields: input.headers },
name: input.updateName,
args: { payloads: await encodeToPayloads(this.dataConverter, ...input.args) },
},
},
};
}

/**
* Send the Update-With-Start MultiOperation request.
*
Expand Down

0 comments on commit d0b7470

Please sign in to comment.