Skip to content

Commit 493f15e

Browse files
Sushisourceaxfelix
andauthored
Add Java/Python to override samples (#3887)
Co-authored-by: Alex Garnett <[email protected]>
1 parent ace9d2f commit 493f15e

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

docs/production-deployment/worker-deployments/worker-versioning.mdx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ Worker Deployment Version:
430430
DrainageLastCheckedTime 31 seconds ago
431431
432432
Task Queues:
433-
Name Type
433+
Name Type
434434
hello-world activity
435435
hello-world workflow
436436
```
@@ -460,6 +460,33 @@ workflowOptions := client.StartWorkflowOptions{
460460
we, err := c.ExecuteWorkflow(context.Background(), workflowOptions, HelloWorld, "Hello")
461461
```
462462
</SdkTabs.Go>
463+
<SdkTabs.Java>
464+
```java
465+
MyWorkflow handle = client.newWorkflowStub(
466+
MyWorkflow.class,
467+
WorkflowOptions.newBuilder()
468+
.setWorkflowId("MyWorkflowId")
469+
.setTaskQueue("MyTaskQueue")
470+
.setVersioningOverride(new VersioningOverride.PinnedVersioningOverride(
471+
new WorkerDeploymentVersion("DeployName", "1.0")))
472+
.build()
473+
);
474+
WorkflowExecution we = WorkflowClient.start(handle::execute, "Hello");
475+
```
476+
</SdkTabs.Java>
477+
<SdkTabs.Python>
478+
```python
479+
handle = client.start_workflow(
480+
MyWorkflow.run,
481+
"Hello",
482+
id="MyWorkflowId",
483+
task_queue="MyTaskQueue",
484+
versioning_override=PinnedVersioningOverride(
485+
WorkerDeploymentVersion("DeployName", "1.0")
486+
),
487+
)
488+
```
489+
</SdkTabs.Python>
463490
<SdkTabs.TypeScript>
464491
```ts
465492
const handle = await client.workflow.start('helloWorld', {

0 commit comments

Comments
 (0)