2323import io .temporal .activity .ActivityMethod ;
2424import io .temporal .activity .ActivityOptions ;
2525import io .temporal .client .WorkflowClient ;
26+ import io .temporal .client .WorkflowOptions ;
2627import io .temporal .serviceclient .WorkflowServiceStubs ;
2728import io .temporal .worker .Worker ;
2829import io .temporal .worker .WorkerFactory ;
@@ -43,7 +44,7 @@ public class HelloActivity {
4344 @ WorkflowInterface
4445 public interface GreetingWorkflow {
4546 /** @return greeting string */
46- @ WorkflowMethod ( executionStartToCloseTimeoutSeconds = 10 , taskList = TASK_LIST )
47+ @ WorkflowMethod
4748 String getGreeting (String name );
4849 }
4950
@@ -100,7 +101,9 @@ public static void main(String[] args) {
100101
101102 // Start a workflow execution. Usually this is done from another program.
102103 // Uses task list from the GreetingWorkflow @WorkflowMethod annotation.
103- GreetingWorkflow workflow = client .newWorkflowStub (GreetingWorkflow .class );
104+ GreetingWorkflow workflow =
105+ client .newWorkflowStub (
106+ GreetingWorkflow .class , WorkflowOptions .newBuilder ().setTaskList (TASK_LIST ).build ());
104107 // Execute a workflow waiting for it to complete. See {@link
105108 // io.temporal.samples.hello.HelloSignal}
106109 // for an example of starting workflow without waiting synchronously for its result.
0 commit comments